Microphone.silenceLevel
549
Generally, echo suppression is advisable when the sound being captured is played through
speakers—instead of a headset—on the same computer. If your SWF file allows users to specify
the sound output device, you may want to call
Microphone.setUseEchoSuppression(true)
if
they indicate they are using speakers and will be using the microphone as well.
Users can also adjust these settings in the Flash Player Microphone Settings panel.
Example
The following example turns on echo suppression if the user selects a CheckBox instance called
useEchoSuppression_ch
. The ProgressBar instance called
activityLevel_pb
displays the
current activity level of the audio stream.
var useEchoSuppression_ch:mx.controls.CheckBox;
var activityLevel_pb:mx.controls.ProgressBar;
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
activityLevel_pb.mode = "manual";
activityLevel_pb.label = "Activity Level: %3";
useEchoSuppression_ch.selected = active_mic.useEchoSuppression;
this.onEnterFrame = function() {
activityLevel_pb.setProgress(active_mic.activityLevel, 100);
};
var chListener:Object = new Object();
chListener.click = function(evt:Object) {
active_mic.setUseEchoSuppression(evt.target.selected);
};
useEchoSuppression_ch.addEventListener("click", chListener);
See also
Microphone.setGain()
,
Microphone.useEchoSuppression
Microphone.silenceLevel
Availability
Flash Player 6.
Usage
active_mic
.silenceLevel
:Number
Description
Read-only property; an integer that specifies the amount of sound required to activate the
microphone and invoke
Microphone.onActivity(true)
. The default value is 10.
Example
The following example changes the silence level based on the user’s input in a NumericStepper
instance called
silenceLevel_nstep
. The ProgressBar instance called
silenceLevel_pb
modifies its appearance depending on whether the audio stream is considered silent. Otherwise, it
displays the activity level of the audio stream.
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...