forceSpeaker property

bool forceSpeaker
final

Normally, audio played will respect the devices configured preferences. However, if you want to bypass that and flag the system to use the built-in speakers, you can set this flag.

On android, it will set audioManager.isSpeakerphoneOn.

On iOS, it will either:

  • set the .defaultToSpeaker option OR
  • call overrideOutputAudioPort(AVAudioSession.PortOverride.speaker)

Note that, on iOS, this forces the category to be .playAndRecord, and thus is forbidden when respectSilence is set.

Implementation

final bool forceSpeaker;