Temporarily changes the current audio route.
- iOS 6.0+
- Mac Catalyst 13.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, otherwise
If your app uses the
play category, calling this method with the
AVAudio option causes the system to route audio 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’d prefer to permanently enable this behavior, you should instead set the category’s
default option. Setting this option routes to the speaker rather than the receiver if no other accessory such as headphones are in use.