Skip to content

Set Audio Output Mode

adamrangs edited this page Aug 8, 2022 · 1 revision

By default, the audio of the call will play through the connected audio output device(headset, earpiece, etc.). Developers can modify the audio output mode through the system API after the call is established according to the usage scenario of their app.

android.media.AudioManager am = (android.media.AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
        if (am !=null){
            am.setMode(android.media.AudioManager.MODE_IN_COMMUNICATION);
            am.setSpeakerphoneOn(on);
        }
Clone this wiki locally