gkaindia.com

Home > > Showing sound levels on audio record

Showing sound levels on audio record

Advertisement
Hi --
I am recording an audio stream from the microphone and wanted
to know if there is a way to show the sound levels of the audio
from the mic in a graphical display?
Advertisement
MrLoofer,
The client that publishes the mic can use Mic.activityLevel
to set a graphical representation of the mic level.
Make a graph bar movieClip that spans from 0 to 100 keyframes
and apply a shape tween.
Enter the following on the __micMeter movieClip
this.onEnterFrame = function() {
if(this.owner.__mic.activityLevel == 0)
bar.gotoAndStop(0);
} else {
bar.gotoAndStop(this.owner.__mic.activityLevel);
__mic is the Mic object you created.
owner is the reference to the graph movieclips owner object.
var __mic:Microphone = Microphone.get();
var __micMeter:MovieClip;
__micMeter["owner"] = this;
This will move the meter when the mic broadcasts. Now, a
client playing the audio has no access to Mic.activityLevel, so you
would have to use NetStream.send(__mic.activityLevel) to their
__micMeter.
HTH,
Shack
Read the other 7 answers