Skip to main content
Known Participant
March 29, 2010
Question

Mute/unmute issue

  • March 29, 2010
  • 2 replies
  • 3417 views

I want to perform mute /unmute For that i am using following code

               public function audioMuteUnMute(state:String):void{
                           
                if (state=="Mute"){
                    ns.attachAudio(null);
                    ns.receiveAudio(false);
                   
                }
                else  
                {
                   
                    ns.attachAudio(microphone);
                    ns.receiveAudio(true);
                   
                }
            }


Give errror at ns = new NetStream(nc);

firstly i mute then press for unmute then it gives folloeing error.

Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Seek.Failed
    at com.controller::BroadcastPod/connectStream()
    at com.controller::BroadcastPod/init()
    at com.controller::BroadcastPod/___BroadcastPod_Canvas1_creationComplete()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()
    at mx.core::UIComponent/set initialized()
    at mx.managers::LayoutManager/doPhasedInstantiation()
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.core::UIComponent/callLaterDispatcher2()
    at mx.core::UIComponent/callLaterDispatcher()

    This topic has been closed for replies.

    2 replies

    March 29, 2010

    HI,

    Does your stream get muted when you press mute? Also can you provide the details where you are changing the state variable from "Mute" to "Unmute". Also there is no need to set attachAudio to null.

    And you can also check return values of recieveAudio function as to it returns true or false

    Thanks,

    Abhishek

    Known Participant
    March 29, 2010

    yes stream is get muted but when i again press on same button for unmute

    te it give error , state variable set on mute/unmute button press .it is a toggle button

    March 29, 2010

    Hi,

    If possible can you post your entire client side code, so that I can nail down the issue you are facing. If you are not comfortable posting here, you can send it as a private message to me.

    Thanks,

    Abhishek

    Janaki Lakshmikanthan
    Adobe Employee
    Adobe Employee
    March 29, 2010

    Hi,

    Why do you want to call "ns.attachAudio()" method. Just calling ns.receiveAudio(); with true and false does not work?

    Regards,

    Janaki L