Description
When you integrate the Android sample app for Streaming(Millicast) in your application, you may notice that when you subscribe to the stream and try to play it via the viewer app - the audio is streamed from the earpiece speaker, resulting in very low audio levels.
Currently, the Android sample app for Streaming, streams the audio from the earpiece speaker by default and not from the device speaker. If you want to enable the audio to the device speaker, then you can do this by the code changes outlined in the solution section below. This solution can be customized as per your app requirement, using a UI component to switch to the available speakers.
Solution
You need to update setAudioMode in the sample app code with the following changes:
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
audioManager.setSpeakerphoneOn(true);
Then add the following Android permission for audio settings to make it work.
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
Action Plan
The sample application will add the option to set the default external speaker.
Affected Product(s)
Dolby.io Streaming Android SDK sample app
Comments
0 comments
Article is closed for comments.