How to switch the default Audio output to Speaker?

Earpieces are the default audio device. On receiving the Active-Talker event after joining the EnableX room, you can switch the audio output to a speaker or any other connected audio device. The Active-Talker event gets triggered whenever there is a change in the Active Talker list. Therefore, use proper flag checks to direct the audio output to speakers in an atomic manner.  

Use the following API list to switch the audio devices: 

Android:

  • Get the list of connected devices.

https://www.enablex.io/developer/video-api/client-api/android-toolkit/get-devices 

  • Switch to the desired audio media device.

https://www.enablex.io/developer/video-api/client-api/android-toolkit/switch-camera-mic-speaker/

iOS:

  • Get the list of connected devices. 

https://www.enablex.io/developer/video-api/client-api/ios-toolkit/get-devices

  • Switch to the desired audio media device.

https://www.enablex.io/developer/video-api/client-api/ios-toolkit/switch-camera-mic-speaker/