AgoraIO-Extensions / react-native-agora

React Native around the Agora RTC SDKs for Android and iOS agora
https://www.agora.io
MIT License
622 stars 228 forks source link

Momentary pause in audio when switching between client role Audience <=> Broadcaster #379

Closed jaydgoss closed 3 years ago

jaydgoss commented 3 years ago

When using the method setClientRole to toggle between ClientRole.Broadcaster and ClientRole.Audience there is a brief pause in audio from the stream while the OS appears to switch between recording and publishing, to not recording and just consuming.

Is there an alternate method to switch between broadcasting <=> consuming, or an additional parameter I can configure to prevent this momentary lapse in audio from the stream?

Using react-native-agora v3.3.3.

LichKing-2234 commented 3 years ago

you can use muteLocalAudioStream or muteRemoteAuduoStream API to control it.

jaydgoss commented 3 years ago

I did try this but found that when using .muteLocalAudioStream(false), LocalAudioStateChanged would never update to recording or encoding. I'll try again to get more details.

jaydgoss commented 3 years ago

This was due to the audio profile scenario being set to AudioScenario.GameStreaming.