ryanheise / audio_session

MIT License
118 stars 83 forks source link

How to change output between speaker and headphones in iOS #46

Closed wijesijp closed 3 years ago

wijesijp commented 3 years ago

I am having trouble figuring out how to change output in iOS

I thought following would change it . But it is giving me an error. I am also seeing only the speaker option so I assume there must be a different way to do this.

await AVAudioSession().overrideOutputAudioPort(AVAudioSessionPortOverride.speaker);

Can anyone provide some assistance for this?

ryanheise commented 3 years ago

I'll close this as a duplicate of #37 . Screen Shot 2021-11-02 at 6 23 18 pm

If anyone would like to discuss how this can be done, please discuss it in #37 and those discussions will also eventually lead to a convenience method.