Skip to content

Fix TTS and audiobook audio interruptions handling - #904

Merged
mickael-menu merged 6 commits into
developfrom
fix/tts-resume
Sep 23, 2026
Merged

mickael-menu merged 6 commits into
developfrom
fix/tts-resume

Conversation

@mickael-menu

Copy link
Copy Markdown
Member

Changed

Shared

  • AudioSessionUser.play() is removed. Conformers must implement the new interruption hooks instead, see the migration guide.

Fixed

Navigator

  • Fixed audio session interruptions:
    • The TTS pauses when an audio interruption begins, and resumes when it ends.
    • The audio navigator no longer resumes after an audio interruption if it was paused beforehand.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

AudioNavigator has unresolved interruption-state synchronization and pending-play cancellation issues.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

This PR updates TTS and audiobook playback behavior during audio-session interruptions and replaces the old AudioSessionUser.play() API.

Changes:

  • Adds interruption lifecycle hooks and migration documentation.
  • Pauses and conditionally resumes TTS.
  • Improves audiobook interruption and playback state handling.
  • Documents the release changes.
File Description
Sources/​Shared/​Toolkit/​Media/​AudioSession.swift Defines and dispatches interruption hooks.
Sources/​Navigator/​TTS/​PublicationSpeechSynthesizer.swift Handles TTS interruption behavior.
Sources/​Navigator/​TTS/​AVTTSEngine.swift Handles cancellation before speech starts.
Sources/​Navigator/​Audiobook/​AudioNavigator.swift Tracks interruption state and audiobook playback.
docs/​Migration Guide.md Documents the new interruption API.
CHANGELOG.md Records the changes and fixes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Sources/Navigator/Audiobook/AudioNavigator.swift Outdated
Comment thread Sources/Navigator/Audiobook/AudioNavigator.swift Outdated
Comment thread Sources/Navigator/Audiobook/AudioNavigator.swift
@mickael-menu
mickael-menu merged commit c7a9bea into develop Sep 23, 2026
5 checks passed
@mickael-menu
mickael-menu deleted the fix/tts-resume branch September 23, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resume TTS after interruption

3 participants