Temporarily changes the current audio route.
- iOS 6.0+
- tvOS 9.0+
- watchOS 2.0+
The override option for audio output. For a list of constants, see
Session .Port Override
true if the new audio routing option was set successfully, or
false if it was not.
If your app uses the
play category, calling this method with the
AVAudio option causes audio to be routed to the built-in speaker and microphone regardless of other settings. This change remains in effect only until the current route changes or you call this method again with the
If you would prefer to permanently enable this behavior, you should instead set the category's
default option. Setting this option will always route to the speaker rather than receiver if no other accessory such as headphones are in use.