Highlighted

accessing audio data

Community Beginner ,
Aug 16, 2015

Copy link to clipboard

Copied

Hi !

I would like to detect events in the audio and take some action eg set a keyframe for another item.

Specifically I'm looking to count the number of peaks (like you would see in a slate clap say) within a time period and get this as a numeric value that I can use in other calculations.

There may be more than one such event per video frame however so ideally I would need access to the actual audio sample data.

Is there a way to get the audio data as an array of values say?

It's not so hard to look for a leading edge over a certain amplitude and count that as an "event" if you have the data.

I can't find anything about audio in the scripting guide, other than if an AVItem has audio or isEnabled.

Alternatively if this is available in Premier or Audition I am happy to work there but they do not seem to support scripting at all !

Anyone?

Thanks!

+Leo

If you need to get down to the auto sample detail, I think you'll need to go the plugin route. None of the plugins I've written have involved audio samples, but that data does seem to be accessible, according to the SDK. Maybe that should be your next stop.

Dan

TOPICS
Scripting

Views

309

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

accessing audio data

Community Beginner ,
Aug 16, 2015

Copy link to clipboard

Copied

Hi !

I would like to detect events in the audio and take some action eg set a keyframe for another item.

Specifically I'm looking to count the number of peaks (like you would see in a slate clap say) within a time period and get this as a numeric value that I can use in other calculations.

There may be more than one such event per video frame however so ideally I would need access to the actual audio sample data.

Is there a way to get the audio data as an array of values say?

It's not so hard to look for a leading edge over a certain amplitude and count that as an "event" if you have the data.

I can't find anything about audio in the scripting guide, other than if an AVItem has audio or isEnabled.

Alternatively if this is available in Premier or Audition I am happy to work there but they do not seem to support scripting at all !

Anyone?

Thanks!

+Leo

If you need to get down to the auto sample detail, I think you'll need to go the plugin route. None of the plugins I've written have involved audio samples, but that data does seem to be accessible, according to the SDK. Maybe that should be your next stop.

Dan

TOPICS
Scripting

Views

310

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 16, 2015 0
Guide ,
Aug 16, 2015

Copy link to clipboard

Copied

I think your script will need to issue the menu command to convert the audio to keyframes, then process the audio data as necessary, and delete the audio keyframe layer.

Dan

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 16, 2015 0
Community Beginner ,
Aug 16, 2015

Copy link to clipboard

Copied

‌HI Dan,

Thanks so much for your reply!

I have played extensively with the convert audio to keyframes function - it's great fun 🙂

Unfortunately in this situation I often get more than one audio trigger event per frame duration and that function only gives you an average amplitude level per frame.  I need to count up the total number of events to know what to do in this case.

I know this is unusual, but isn't that where we always find ourselves ?!

Is it possible to access the audio data in more detail?

- is it possible as a plugin rather than a script?

Thanks again for your reply,

+Leonard.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 16, 2015 0
Guide ,
Aug 16, 2015

Copy link to clipboard

Copied

If you need to get down to the auto sample detail, I think you'll need to go the plugin route. None of the plugins I've written have involved audio samples, but that data does seem to be accessible, according to the SDK. Maybe that should be your next stop.

Dan

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 16, 2015 0
Community Beginner ,
Aug 17, 2015

Copy link to clipboard

Copied

Thanks Dan,

Great to have someone confirm this before I delete all the swift and put c++ back in my head !

I'll mark this as answered and hopefully you'll get the points for it 🙂

+Leo

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 17, 2015 0
Advocate ,
Aug 17, 2015

Copy link to clipboard

Copied

I actually built a script that will allow you to choose a peak level value and it processes the audio in a comp and places markers at those peak areas. Dan is right about the Convert Audio to Keyframes, that is how I got mine to work.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 17, 2015 0
Community Beginner ,
Aug 17, 2015

Copy link to clipboard

Copied

Thanks for your reply David,

Yes I had quite some fun with the convert audio to keyframe function - it's pretty cute - but it won't help me here unfortunately.

I spend the day refreshing my c++ from a dusty corner of my mind and I'll have a look at the plugin SDK tomorrow - unless I can think of a better way to do this overall !

Nothing has been shot yet so I still have time to build a better solution if I can think of one.

There are worse things than building AFX plugins surely ?!

Thanks again,

+Leo

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 17, 2015 0
zcream LATEST
Explorer ,
Oct 02, 2020

Copy link to clipboard

Copied

Did leopardc manage to access the audio stream inside ae? I'd be curious to know how. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 02, 2020 0