Skip to content

Improve concurrency around AudioSessionManaging - #905

Merged
mickael-menu merged 2 commits into
developfrom
fix/audio-session
Sep 23, 2026
Merged

mickael-menu merged 2 commits into
developfrom
fix/audio-session

Conversation

@mickael-menu

Copy link
Copy Markdown
Member

Changed

Shared

  • AudioSessionManaging changed to activate the audio session off the main thread, see the migration guide.
    • start(with:isPlaying:) is now async, and returns when the audio session is ready to play.
    • end(with:) takes the AudioSessionUser instead of an AudioSessionToken, which is removed.

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

🔵 Needs a closer look

Audio activation is not reliably awaited across all playback paths and failure or overlapping requests can be reported as successful.

Review effort: Lite
Findings: None

What changed in this PR

This PR makes audio-session activation asynchronous and updates audiobook/TTS integrations for the new API.

Changes:

  • Moves activation/deactivation off the main thread.
  • Replaces AudioSessionToken with user-based session ending.
  • Updates consumers, migration documentation, and changelog.
File Summary
Sources/​Shared/​Toolkit/​Media/​AudioSession.swift Implements asynchronous session management; activation waiting and failure handling require changes.
Sources/​Navigator/​TTS/​PublicationSpeechSynthesizer.swift Migrates TTS session usage; some playback paths do not await activation.
Sources/​Navigator/​Audiobook/​AudioNavigator.swift Updates audiobook playback for the asynchronous API.
docs/​Migration Guide.md Documents the API migration.
CHANGELOG.md Records the audio-session changes.

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

@mickael-menu
mickael-menu merged commit 5d6258b into develop Sep 23, 2026
5 checks passed
@mickael-menu
mickael-menu deleted the fix/audio-session branch September 23, 2026 14:20
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.

2 participants