As you created this pseudo code in our earlier conversation, this is what i am doing in the session at first.
async function audioHandler(){
/* The microphone permission was blocked*/
await stream.startAudio({speakerOnly:true});
/* After some other things, rejoin the audio with the microphone connected*/
await stream.stopAudio();
await stream.startAudio(); // Can hear the sound, but cannot speak? And no error on the console?
}
After this i am sharing my screen with tab audio enabled, so because of this my mic gets muted and the tab audio start sharing. but when i am calling the muteShareAudio function then audio should switch to microphone but that is not happening. When i call the unmuteShareAudio function it successfully switching back to tab audio but there is some issue with switching to microphone.
Sorry, I forgot to mention that now mic permission is given and at first I started with speakerOnly option. and then I stopped the audio and started the audio again with speakerOnly set to false.
Now after this when I start the screen share with tab audio. then the mic audio gets muted and tab audio starts going to other participants. Now i am calling muteShareAudio function, after this tab audio gets muted but the microphone audio doesnât start after that.
So when i am calling muteShareAudio, the audio source should switch to microphone now, but it is not happening right now.
I want to get the volume of the audio track created by startAudio() function. How can I achieve that?
just like the function of getCurrentVolume provided for the localAudioTrack.
We didnât provide the getVolume API of the current user during the session. The audio will be adjusted to an appropriate volume inside the Video SDK before sending it to the other users.
We have an active-speaker event in the Video SDK Web. In the ZOOM client, when someone (including the current user) is talking, the active-speaker event will be triggered. The animation green bar is not the reflection of the volume, itâs just an indication that the one is speaking.
Through the active-speaker event, yes I will get to know who is speaking, but if I want to show the volume animation, then it is not possible.
Also, you are saying that âthe green animation is not the reflection of the volume but an indication that one is speakingâ.
But the green bar going up and down is based on the volume of the audio. It is detecting the audio volume and as per that, it is moving up and down.
if I will speak very low then the green bar will not fill up completely but if I will speak very high then the green bar will fill up completely.
Thatâs right on the ZOOM native client, but on the ZOOM web client, the green bar is not related to the volume. We havenât provided API for the accurate volume of each speaking user so far.
For the audio, we havenât provided the similar option yet, but you can call the switchMicrophone or switchSpeaker method right after the startAudio method.