setSpeakerPhone

fun setSpeakerPhone(enable: Boolean, defaultFallback: StreamAudioDevice? = null)

Enables or disables the speakerphone.

When the speaker is disabled the device that gets selected next is by default the first device that is NOT a speakerphone. To override this use defaultFallback. If you want the earpice to be selected if the speakerphone is disabled do

setSpeakerPhone(enable, StreamAudioDevice.Earpiece)

Parameters

enable

if true, enables the speakerphone, if false disables it and selects another device.

defaultFallback

when enable is false this is used to select the next device after the speaker.