ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# visualizing decibel number on after effects

FAQ   •   VIEW ALL
 visualizing decibel number on after effects on Mar 20, 2011 at 6:29:55 pm

hi there, i'm a newbie here, first post.

i 'd like to ask if anyone knows of a way i can visualize the decibel value of an audio track.
This is NOT about visualizing the waveform of the audio track, i've already managed that through Effects>Generate>Audio Waveform.

What I want, is a three digit number, like a counter, that changes real time, corresponding to the content of the audio track. Kinda like what the waveform does, only in the form of a number that is altering all the time.

any ideas?

 Re: visualizing decibel number on after effectson Mar 21, 2011 at 11:47:08 am

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events

 Re: visualizing decibel number on after effectson Mar 21, 2011 at 1:57:56 pm

Trapcode Soundkeys is ultra good BUT if you want a quick way to do this, you can link the audio values to the Source Text property of a Text Layer.

If you stick the following Expression to a Text Layer's Source Text Property, you will obtain values between 030 and 999.

To always have only 3 digits, values lower than 10 will have two leading zeros. Values between 12 and 99 will have one leading zero while values greater than 1000 will be reduced to 999.

I've added a Scalar variable to allow you to easily scale the original audio values to suit your needs - so, change the Scalar value to suit your needs.

// Start Script
audioVal = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
Scalar =30;
J = Math.round(audioVal)*Scalar;
if (J <10) {
"0"+"0"+J
} else
if (J <100) {
"0"+J
} else
if (J >999) {
J=999
} else {
J
}
// End Script

HTH
RoRK

AE Training in South East Asia. AE templates for sale and rental. Click here for more

 Re: visualizing decibel number on after effectson Mar 31, 2011 at 8:04:51 pm

I tried using the Expression you sent me, but i' m getting the following message from AE:

couldn't find layer named 'Audio
Amplitude'
Expression disabled.

Error occured at line 2.
Comp: 'DSC_1194'
Layer: 1 ('34')
Property: 'Source Text'

No, it can be that i' m doing something wrong, cause i' m not that familiar with Expressions. But all i do, is create a new text layer, select the 'Source Text' in it, and go to Animate>Add Expression, and i just paste it in. Is it something i' m doing wrong? Also, in case what you send me is actually ok, and it 's me who does it wrong, would you please mind change the 3 digit value to two, if it's not much trouble? i realised it' ll be better that way..

thanks again for your help anyway!

harry

 Re: visualizing decibel number on after effectson Apr 1, 2011 at 3:27:49 am

Hi Harry, what you want requires basic knowledge of Expressions. Take a look at this COW Tutorial - on a topic related to Expressions and audio.

The error you are alluding to is due to the fact that you have not created the Audio Amplitude layer. This layer will be created if you had selected an audio layer and selected from AE's Menu, Animation>Keyframe Assistant>Convert Audio to Keyframes.

Here's the amended script to lock the numbers displayed down to two characters with 99 and 00 being the maximum and lowest values respectively.

//Start of Script
audioVal = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
Scalar =5;
J = Math.round(audioVal)*Scalar;
if (J <10) {
"0"+J
} else
if (J >99) {
J=99
} else
{
J
}
//End of Script

I've added a variable, Scalar, to allow you to multiply the actual values found after you've created the Audio Amplitude. This will come in handy should the actual values be too small or too large. Scalar is now set to a value of 1, meaning that whatever the actual value is, it will be multiplied by 5. Change the number after the equal sign (Scalar = ...) in the script above to suit your needs.

HTH
RoRK

AE Training in South East Asia. AE templates for sale and rental. Click here for more

 Re: visualizing decibel number on after effectson Mar 30, 2011 at 8:18:02 pm

hey Walter sorry for being so late to reply, i was away, and very busy.
Thanks for your answer, i tried Trapcode Soundkeys, but i haven't exactly figured out how to do it with this plugin yet. Can you please help me in using it, by being a bit more specific in what i should do?
Let me make it clear that i don't necessary want the exact decibel number of the actual audio clip, but a way to connect a two-(changed my mind, not three)-digit number with the audio of the footage, so that it will change real-time following the changes of the audio file.

Thanks again! : )

 Re: visualizing decibel number on after effectson Mar 21, 2011 at 3:19:20 pm

[harry krek] "i 'd like to ask if anyone knows of a way i can visualize the decibel value of an audio track."

The other folks have told you how it's done. However, it's going to be tough to get the actual decibel level from an audio file if that's what you actually need.

You can record the sound of someone sitting in a chair. You can record the sound of a bomb exploding. Both can be recorded at the proper audio levels, but the actual decibel levels will be very different.

Dave LaRonde
Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA