Microphone silenceTimeOut [AS 2]
Klasa: Microphone
Kompatybilność: ActionScript 1.0, Flash 6+
Wartość liczbowa reprezentująca liczbę milisekund pomiędzy czasem wykrycia zatrzymania odbierania dźwięków z mikrofonu oraz czasem wywołania funkcji Microphone.onActivity(false)
.
Domyślna wartość to 2000 (2 sekundy).
Listing
var silenceLevel_pb:mx.controls.ProgressBar;
var silenceTimeOut_nstep:mx.controls.NumericStepper;
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
silenceLevel_pb.label = "Activity level: %3";
silenceLevel_pb.mode = "manual";
silenceTimeOut_nstep.minimum = 0;
silenceTimeOut_nstep.maximum = 10;
silenceTimeOut_nstep.value = active_mic.silenceTimeOut/1000;
var nstepListener:Object = new Object();
nstepListener.change = function(evt:Object) {
active_mic.setSilenceLevel(active_mic.silenceLevel, evt.target.value 1000);
};
silenceTimeOut_nstep.addEventListener("change", nstepListener);
this.onEnterFrame = function() {
silenceLevel_pb.setProgress(active_mic.activityLevel, 100);
};
active_mic.onActivity = function(active:Boolean) {
if (active) {
silenceLevel_pb.indeterminate = false;
silenceLevel_pb.setStyle("themeColor", "haloGreen");
silenceLevel_pb.label = "Activity level: %3";
} else {
silenceLevel_pb.indeterminate = true;
silenceLevel_pb.setStyle("themeColor", "0xFF0000");
silenceLevel_pb.label = "Activity level: (inactive)";
}
};
var silenceTimeOut_nstep:mx.controls.NumericStepper;
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
silenceLevel_pb.label = "Activity level: %3";
silenceLevel_pb.mode = "manual";
silenceTimeOut_nstep.minimum = 0;
silenceTimeOut_nstep.maximum = 10;
silenceTimeOut_nstep.value = active_mic.silenceTimeOut/1000;
var nstepListener:Object = new Object();
nstepListener.change = function(evt:Object) {
active_mic.setSilenceLevel(active_mic.silenceLevel, evt.target.value 1000);
};
silenceTimeOut_nstep.addEventListener("change", nstepListener);
this.onEnterFrame = function() {
silenceLevel_pb.setProgress(active_mic.activityLevel, 100);
};
active_mic.onActivity = function(active:Boolean) {
if (active) {
silenceLevel_pb.indeterminate = false;
silenceLevel_pb.setStyle("themeColor", "haloGreen");
silenceLevel_pb.label = "Activity level: %3";
} else {
silenceLevel_pb.indeterminate = true;
silenceLevel_pb.setStyle("themeColor", "0xFF0000");
silenceLevel_pb.label = "Activity level: (inactive)";
}
};
Dodano przez: divix
Ranga: Administrator serwisu Punktów: 0
Ranga: Administrator serwisu Punktów: 0
Komentarze użytkowników
:: Losowe artykuły
:: Wymiana linków
Modowe inspiracje |
Android Gry i Aplikacje |
ZaplanujTransport.pl: Przeprowadzki, transport, aukcje |
Logo dla firmy |
Change Tires - Car Weather Forecast Reminder |
Laminas: MVC Framework for PHP |
IT Books Reviews and Programming: JS, JAVA, PHP, ANDROID, CSS |
Katalog roślin |
Programming articles: JAVA, PHP, C++, Python, JavaScript |
Kancelaria Adwokacka Łukasz Huszno