How To Play Audio Through Headphones on WatchOS 11?

I have an app that plays audio and the behaviour of it has changed in watchOS 11. I can no longer figure out how to play the audio through the headphones.

To play audio I..

let session = AVAudioSession.sharedInstance()
try session.setCategory(.playback,
                                        mode: .default,
                                        policy: .longFormAudio,
                                        options: [] 

let activated = try await session.activate()
if activated {
    // play audio
}

In previous versions, 'try await session.activate()` would bring up a route picker where the user could select their headphones. Now on watchOS 11 it just plays the audio out of the speaker.

Maybe that's what some people want but if they do want it to play out of the headphones I can't see how I can give that option now? There's no AVRoutePickerView available on watchOS for selecting it.

I've tried setting the category to .multiRoute instead of .playback and that does bring up the picker but selecting the speaker results in an error code and selecting the headphones results in it saying it cannot find my headphones (which shouldn't be the case since Apple Music on watchOS finds them).

Tried overriding the output with try session.overrideOutputAudioPort(.speaker) but the compiler complains that speaker isn't available on watchOS, which is strange as if I understand correctly it's possible to play through the speaker now at least on some Apple Watches.

So is this a bug or is there some way I've not found of playing audio through the headphones?

Hello @megatron1000, thank you for your post. Your code looks correct. To play audio through headphones on watchOS, you set the policy of your audio session to longFormAudio and call activate. In addition to that, you need to enable the audio background mode in your Xcode project. Activating the session should bring up the route picker if no route is currently active. Please see Streaming Audio on watchOS 6 for details on that.

You can use the speakers on watchOS. To do that, simply don't use the longFormAudio policy. However, you should use the longFormAudio policy when the audio that you are playing is of long-form nature, such as a music track.

If you are already adding the audio background mode and are still unable to playback audio through the headphones on watchOS 11, please use Feedback Assistant to submit a bug report and attach a sysdiagnose. After that, please post here the FB number for my reference.

How To Play Audio Through Headphones on WatchOS 11?
 
 
Q