Post

Replies

Boosts

Views

Activity

Reply to Audio cues not working when app is in the background
We keep the app running in the background using WKExtendedRuntimeSession (with self-care background mode). The audio session is configured with .playback category, .longFormAudio policy, and .mixWithOthers + .duckOthers options, and activated while the app is in the foreground. For audio playback we use AVAudioPlayer(data:) with in-memory WAV data for metronome ticks, and AVSpeechSynthesizer for voice counts. We also run a continuous near-silent AVAudioPlayer loop to keep the audio session active between beeps. Two specific questions: Is WKExtendedRuntimeSession the correct mechanism for this use case, or should we use something else? (We can't use HKWorkoutSession since users run this alongside other workout apps.) Does .longFormAudio work correctly with .mixWithOthers, or are those contradictory?
Apr ’26
Reply to Audio cues not working when app is in the background
We keep the app running in the background using WKExtendedRuntimeSession (with self-care background mode). The audio session is configured with .playback category, .longFormAudio policy, and .mixWithOthers + .duckOthers options, and activated while the app is in the foreground. For audio playback we use AVAudioPlayer(data:) with in-memory WAV data for metronome ticks, and AVSpeechSynthesizer for voice counts. We also run a continuous near-silent AVAudioPlayer loop to keep the audio session active between beeps. Two specific questions: Is WKExtendedRuntimeSession the correct mechanism for this use case, or should we use something else? (We can't use HKWorkoutSession since users run this alongside other workout apps.) Does .longFormAudio work correctly with .mixWithOthers, or are those contradictory?
Replies
Boosts
Views
Activity
Apr ’26
Reply to Audio cues not working when app is in the background
Hi and thanks for the additional information. WKExtendedRuntimeSession was added but that didn't help and I'm not using HKWorkoutSession so to not conflict with other workout apps. Hopefully a watchOS person will have an idea.
Replies
Boosts
Views
Activity
Apr ’26