---
title: "Audio Coaching"
canonical: "https://aifitnessapi.com/audio-coaching"
type: "cluster-index"
pages: "12"
last_reviewed: "2026-10-03"
publisher: "AIFitnessAPI"
---

# Audio Coaching

> 12 pages. Each entry below shows the question the page owns, followed by its answer capsule.

## playback or ambient: choosing the AVAudioSession category for workout cues

- Question: avaudiosession category for workout app
- HTML: https://aifitnessapi.com/audio-coaching/avaudiosession-category-workout-app
- Markdown: https://aifitnessapi.com/audio-coaching/avaudiosession-category-workout-app.md
- Last reviewed: 2026-10-03

The audio session category decides whether a workout cue survives the screen locking and whether it stops the user's music. Apple documents that the default category, soloAmbient, silences other background audio when your app plays and is itself silenced by screen locking and the Silent switch, and that ambient mixes with other apps but is silenced the same way. The playback category keeps playing through the Silent switch and the lock, and needs the audio value in UIBackgroundModes to continue in the background, but Apple says it is nonmixable by default, so on its own it interrupts the user's music. For cues that must be heard mid-workout, that points to playback with a mixing option such as duckOthers, plus the voicePrompt mode when the cue is synthesized speech.

## duckOthers: lowering the user's music for a workout cue, then giving it back

- Question: avaudiosession duckothers
- HTML: https://aifitnessapi.com/audio-coaching/avaudiosession-duckothers-workout-cues
- Markdown: https://aifitnessapi.com/audio-coaching/avaudiosession-duckothers-workout-cues.md
- Last reviewed: 2026-10-03

duckOthers is the AVAudioSession category option that, in Apple's words, reduces the volume of other audio sessions while audio from your session plays. Apple documents that it can be set only with the playAndRecord, playback or multiRoute category, that ducking begins when you activate your session and ends when you deactivate it, and that it should be used on a temporary basis only, never to duck other apps for more than a few seconds. For an exercise app Apple says to also set interruptSpokenAudioAndMixWithOthers, which pauses podcast-style spoken audio instead of talking over it. So activate the session immediately before each cue and deactivate it with notifyOthersOnDeactivation once the cue has finished, which lets the music return to full volume and a paused podcast resume.

## Spoken workout cues with AVSpeechSynthesizer, and when to stay quiet

- Question: avspeechsynthesizer workout cues
- HTML: https://aifitnessapi.com/audio-coaching/avspeechsynthesizer-workout-cues
- Markdown: https://aifitnessapi.com/audio-coaching/avspeechsynthesizer-workout-cues.md
- Last reviewed: 2026-10-03

AVSpeechSynthesizer speaks AVSpeechUtterance objects from a queue, and three documented details decide whether it works for workout cues. Apple notes the system doesn't automatically retain the synthesizer, so keep a reference for the whole workout, and because it speaks queued utterances in order, a cue that has gone stale must be cancelled with stopSpeaking(at:), which removes all unspoken utterances, rather than left to play late. usesApplicationAudioSession decides who handles ducking: set to false, Apple says the system creates a separate session that manages speech, interruptions, mixing and ducking for you. Apple also publishes promptStyle for voice-prompt apps, naming exercise prompts, which tells you when to speak, when to use a short nonverbal prompt, and when not to prompt at all.

## Audio interruptions during a workout on iOS: calls, Siri and the cue that never comes back

- Question: avaudiosession interruption workout app
- HTML: https://aifitnessapi.com/audio-coaching/audio-interruptions-during-workout-ios
- Markdown: https://aifitnessapi.com/audio-coaching/audio-interruptions-during-workout-ios.md
- Last reviewed: 2026-10-03

An interruption deactivates your audio session underneath you: Apple documents that when interruptionNotification arrives with the began type, the system interrupted your session and it's no longer active, and that the ended type carries options in which shouldResume is a hint that it's appropriate to resume without waiting for user input. In iOS 27 Apple added lifecycle notifications, didBecomeInactiveNotification and resumptionRecommendationNotification, and recommends them for new code because they don't get out of sync when the system can't deliver an end event; for iOS 26 and earlier you still observe interruptionNotification. For a workout the audio and the clock are separate decisions: suspend speech during the interruption, keep the workout timer running, and never replay a cue whose moment passed during a call.

## Background audio for an iPhone workout app: UIBackgroundModes audio, and what it does not promise

- Question: uibackgroundmodes audio workout app
- HTML: https://aifitnessapi.com/audio-coaching/background-audio-workout-app-ios
- Markdown: https://aifitnessapi.com/audio-coaching/background-audio-workout-app-ios.md
- Last reviewed: 2026-10-03

An iPhone workout app needs two things for cues to keep playing after the screen locks: an audio session category that continues when the screen locks, such as playback, and the audio value in the UIBackgroundModes array, which Xcode adds when you tick Audio, AirPlay, and Picture in Picture under the Background Modes capability. Apple asks you to use background execution modes sparingly, and App Store Review Guideline 2.5.4 says multitasking apps may only use background services for their intended purposes, audio playback among them. Apple's pages do not state whether an app keeps executing during silent gaps between cues, so verify your cue timing on a locked device. On Apple Watch, background cues are valid only while a workout session is running.

## Headphones out mid-run: route changes on iOS and AUDIO_BECOMING_NOISY on Android

- Question: headphones disconnected during workout audio
- HTML: https://aifitnessapi.com/audio-coaching/headphones-disconnect-route-change
- Markdown: https://aifitnessapi.com/audio-coaching/headphones-disconnect-route-change.md
- Last reviewed: 2026-10-03

When headphones disconnect, both platforms tell you and both expect you not to carry on through the speaker. Apple's route-change guide says users who disconnect headphones don't want to automatically share what they're listening to, and that apps should automatically pause playback; the signal is routeChangeNotification with the reason oldDeviceUnavailable, posted on a secondary thread. Google documents ACTION_AUDIO_BECOMING_NOISY as a hint sent when a wired headset is unplugged or an A2DP sink disconnects and audio is about to switch to the speaker, and says to register a receiver while you are playing. A workout app makes two decisions here: stop its spoken cues, and usually keep the workout itself running.

## Android audio focus for workout cues: AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK

- Question: audiofocus_gain_transient_may_duck
- HTML: https://aifitnessapi.com/audio-coaching/android-audio-focus-may-duck
- Markdown: https://aifitnessapi.com/audio-coaching/android-audio-focus-may-duck.md
- Last reviewed: 2026-10-03

For each cue, request AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK, play only when the request returns AUDIOFOCUS_REQUEST_GRANTED, and abandon focus with the same AudioFocusRequest instance when the cue finishes. Google documents that focus type as a short, temporary request where it is acceptable for other apps to keep playing at a lowered volume, and since Android 8.0 the system ducks the other app automatically, without calling its listener, unless that app is playing CONTENT_TYPE_SPEECH content or set setWillPauseWhenDucked(true). Speech apps such as podcast players receive AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK instead, so they can pause. Never request AUDIOFOCUS_GAIN for a cue: on Android 12 and higher Google documents that it makes the system fade out a playing media app, which stays muted until it requests focus again.

## AUDIOFOCUS_REQUEST_FAILED in the background on Android 15: your cue needs a foreground service

- Question: audiofocus_request_failed android 15
- HTML: https://aifitnessapi.com/audio-coaching/audiofocus-request-failed-android-15
- Markdown: https://aifitnessapi.com/audio-coaching/audiofocus-request-failed-android-15.md
- Last reviewed: 2026-10-03

If your app targets Android 15 (API level 35) or higher, Google documents that it cannot request audio focus unless it's the top app or running a foreground service, and that the request returns AUDIOFOCUS_REQUEST_FAILED otherwise. A workout app speaking cues with the screen off is not the top app, so unless it started a foreground service its first background cue fails silently. The fix is to run the workout in a foreground service started when the user taps start: Google's foreground service types page lists health for long-running fitness use cases such as exercise trackers, and mediaPlayback for continuing audio or video playback in the background, each with its own manifest permission. A second, unrelated cause of the same return value is focus locked by a phone call.

## TextToSpeech workout cues on Android: initialization, focus, queue and completion

- Question: android texttospeech workout cues
- HTML: https://aifitnessapi.com/audio-coaching/texttospeech-workout-cues-android
- Markdown: https://aifitnessapi.com/audio-coaching/texttospeech-workout-cues-android.md
- Last reviewed: 2026-10-03

Android's TextToSpeech can only speak after initialization completes, which Google signals through TextToSpeech.OnInitListener, and speak() is asynchronous: it only queues the request, so completion arrives through an UtteranceProgressListener keyed by the utterance id you pass. Google's reference does not say TextToSpeech manages audio focus, so a cue app requests AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK before speaking and abandons it in onDone, onStop or onError; Google documents that by onDone all audio has been played back. Set the cue's AudioAttributes with setAudioAttributes, use QUEUE_FLUSH when a newer cue makes the queued one stale, declare the android.intent.action.TTS_SERVICE intent in a queries element when targeting Android 11, and call shutdown() when the workout ends.

## Which AudioAttributes usage a workout coaching cue should declare

- Question: audioattributes usage for voice coaching
- HTML: https://aifitnessapi.com/audio-coaching/audioattributes-usage-coaching-cues
- Markdown: https://aifitnessapi.com/audio-coaching/audioattributes-usage-coaching-cues.md
- Last reviewed: 2026-10-03

Usage is, in Google's words, the most important information to supply in AudioAttributes, and it changes how Android treats your cue. Google describes USAGE_ASSISTANCE_NAVIGATION_GUIDANCE as driving or navigation directions, USAGE_ASSISTANT as audio responses to user queries, audio instructions or help utterances, USAGE_ASSISTANCE_SONIFICATION as user interface sounds, and USAGE_MEDIA as music or movie soundtracks; a focus request with no attributes defaults to USAGE_MEDIA. Android 12's forced fade-out and incoming-call mute apply to USAGE_MEDIA and USAGE_GAME players, and CONTENT_TYPE_SPEECH stops the system ducking a player automatically. No usage names exercise coaching, so our judgement is navigation guidance with speech content for spoken cues, sonification for tones, and media for long guided sessions.

## Audio cues on the wrist: Wear OS speakers, Bluetooth, and Apple Watch workout sessions

- Question: wear os workout audio cues speaker
- HTML: https://aifitnessapi.com/audio-coaching/wear-os-watchos-workout-audio
- Markdown: https://aifitnessapi.com/audio-coaching/wear-os-watchos-workout-audio.md
- Last reviewed: 2026-10-03

The two watch platforms draw the line in different places. Google's Wear OS audio guide says to play media only when Bluetooth headphones or speakers are connected, but encourages non-media sound on the built-in speaker and gives fitness apps providing exercise instructions as its example; you find outputs with AudioManager.getDevices and types such as TYPE_BUILTIN_SPEAKER and TYPE_BLUETOOTH_A2DP. Apple documents that watchOS workout apps can play short clips such as coaching in the background only while an active workout session is running, that the Audio background mode is required alongside Workout processing if the session plays audio or haptics, and that long-form background audio requires a Bluetooth route.

## Testing workout audio cues: calls, Siri, Bluetooth and the podcast that never resumes

- Question: testing workout audio cues
- HTML: https://aifitnessapi.com/audio-coaching/testing-workout-audio-cues
- Markdown: https://aifitnessapi.com/audio-coaching/testing-workout-audio-cues.md
- Last reviewed: 2026-10-03

Audio cue bugs live in transitions a desk test never triggers, so the test plan is a list of documented platform events caused on purpose, each with an expected result from the platform's documentation. On iOS that means a screen lock with music playing, a podcast app playing, an incoming call in both banner and full-screen styles, Siri listening, which Apple documents as setting promptStyle to none, headphones being removed, and Apple's own Reset Media Services item in the Developer menu of Settings. On Android it means a background cue from an app targeting API level 35, speech content playing, a phone call, headphones removed and a missing TTS voice. Keep the cue decision a pure function you unit-test, and test the delivery on devices.
