I want to direct iOS VoiceOver sound to headphone even if it's not plugged in.
In other words, while my app is open, VoiceOver sound (and other sounds played by me in app using AVSpeechUtterance
etc.) should NEVER go to speakers, but should come out of headset, if connected.
Can anyone suggest something on this?
Apparently it's not possible to forcefully direct sound to headphone unless an accessory is plugged to headphone jack (which activates a physical switch to direct voice to headphone).
I've achieved my purpose using following code (in Swift) which directs VoiceOver and other sounds to phone speaker (from where we listen to phone calls) and silences loud speaker while my app is in foreground.