Microphone.activitylevel - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Microphone.activityLevel

Availability
Flash Player 6.
Usage
active_mic.activityLevel:Number
Description
Read-only property; a numeric value that specifies the amount of sound the microphone is
detecting. Values range from 0 (no sound is being detected) to 100 (very loud sound is being
detected). The value of this property can help you determine a good value to pass to the
Microphone.setSilenceLevel()
If the microphone is available but is not yet being used because
called, this property is set to -1.
Example
The following example displays the activity level of the current microphone in a ProgressBar
instance called
activityLevel_pb
var activityLevel_pb:mx.controls.ProgressBar;
activityLevel_pb.mode = "manual";
activityLevel_pb.label = "Activity Level: %3%%";
activityLevel_pb.setStyle("themeColor", "0xFF0000");
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
this.onEnterFrame = function() {
activityLevel_pb.setProgress(active_mic.activityLevel, 100);
};
active_mic.onActivity = function(active:Boolean) {
if (active) {
var haloTheme_str:String = "haloGreen";
} else {
var haloTheme_str:String = "0xFF0000";
}
activityLevel_pb.setStyle("themeColor", haloTheme_str);
};
See also
Microphone.setGain()
method.
.
has not been
Microphone.get()
Microphone.activityLevel
449

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents