Witam,
mam problem z przyciskiem wyciszenia mikrofonu w flash. Znalazłem skrypt który odowiada za wyciszenie mikrofonu w flash:
import flash.media.Microphone;
import flash.system.Security;
import flash.system.SecurityPanel;
var mic:Microphone;
var cryNum:Number = 0;
var isMuted:Boolean;
function init():void{
//setup the microphone
mic = Microphone.getMicrophone();
//set the sample-rate to 44 khz
mic.rate = 44;
//adjust the gain - (0 - 100) - default 50;
//mic.gain = 50;
// send the audio from the mic to the speakers. this can cause terrible feedback. Other options are to connect the audio to a netStream.
mic.setLoopBack(true);
//set echo supression
mic.setUseEchoSuppression(true);
//pop open the security panel, but sense we are looping back to the speakers, the security box opens automatically
//Security.showSettings(SecurityPanel.MICROPHONE);
}
// mute/unmute all sounds
function muteSounds(val:Boolean):void{
isMuted = !isMuted;
var trans:SoundTransform;
if(isMuted){
trans = new SoundTransform(0);
SoundMixer.soundTransform = trans;
}
else{
trans = new SoundTransform(1);
SoundMixer.soundTransform = trans;
}
}
init();
stop();
Problem jest jednak, że nie wiem jak użyć opcji ismute… jak nadać przyciskowi opcję aby aktywował.
Chodzi mi o kod mniej więcej takiej reakcji:
Po nacisnięciu zmień wartosć na ismute (a ten kod powyżej powinienm sam już potem zinterpretować is mute i wyłączyć mikrofon?