Disable and enable the microphone Location

239 views
Skip to first unread message

Jordan Martins

unread,
Sep 3, 2015, 11:51:47 AM9/3/15
to EasyRTC
Adding the function to disable and enable Local Microphone

Hello, dear friends!

I come again to ask for help, to add another function to my project based on EaseRTC.
I need to put the function (icon) to disable and enable the local microphone.

I have studied just about everything, and have come to no conclusion.

You guys can help me, telling how to do this?

Already, thanks!

Jordan Martins

unread,
Sep 3, 2015, 1:18:57 PM9/3/15
to EasyRTC
Hello again, Eric!

easyrtc.enableMicrophone (false); It works well at the start coxeão.

But I wanted to have the power to silence and open the local mic with the ongoing connection.

example:
A is connected to B:
B for some reason do not want A, hear her voice, then he can click Stop Mic and mutes the microphone himself.

B wanting to re-issue their sound, click Start Mic and returns to broadcast your voice.

Understand?

Eric Davies

unread,
Sep 3, 2015, 1:46:27 PM9/3/15
to EasyRTC
If B doesn't want to hear A, the simplest solution is that B mutes the video box that A is playing from. That doesn't impact anybody else.

If B wants to have a more global effect, then B sends A a message asking it to mute A's microphone. Sending that message and responding to it is an application level issue.
See easyrtc.sendPeerMessage  for sending the message, and easyrtc.setPeerListener for creating a listener for that message.

Jordan Martins

unread,
Sep 3, 2015, 2:01:01 PM9/3/15
to EasyRTC
No no.

In the example, B do not want to send Voice A.
Then B just off the local microphone by clicking Stop Mic.
Understand?

Hypothetical example:
When you are with someone on the phone, and at some point do not want that someone listen to your hambiente sound, you mute the microphone of your phone without disconnecting the call. After you power cycling your microphone and continues the conversation. Understand?

What I want to do is exactly that, the video chat.
Place the mute function (enable or disable) the local microphone, without shutting down the connection to the other.

Eric Davies

unread,
Sep 3, 2015, 2:27:57 PM9/3/15
to EasyRTC
I think you are confusing  easyrtc.enableMicrophone with easyrtc.enableAudio.

easyrtc.enableMicrophone modifies the local media stream so that microphone is muted. You can call it at any point.

Jordan Martins

unread,
Sep 4, 2015, 9:02:06 AM9/4/15
to EasyRTC
In fact, you're right.
However even the "easyrtc.enableAudio(false)" only works within the "function connect()"
And within the "function connect()" I can not change anything, while transmitting.

You can show me a script for me to use as a reference?
I've read and re-read the tutorials, I tried to find examples, however did not find anything ...

Eric Davies

unread,
Sep 4, 2015, 10:17:33 AM9/4/15
to EasyRTC
Just add the following to your html.

    <button onclick="easyrtc.enableMicrophone(false);"> mute mike</button>

    <button onclick="easyrtc.enableMicrophone(true);"> unmute mike</button>


Click either at anytime during the conversation. It's that simple.

Jordan Martins

unread,
Sep 4, 2015, 10:41:49 AM9/4/15
to EasyRTC
Friend, is so simple that gave up shame now.
Again you saved me. I here .. over two days trying to resolve an issue that simple.

Thank you very much emsmo!
You are the man! You're a legend!
My hero!
Reply all
Reply to author
Forward
0 new messages