Skip to content

Reuse compatible iOS audio session in TTSKit playback#464

Open
shura-v wants to merge 3 commits into
argmaxinc:mainfrom
shura-v:reuse-audio-session
Open

Reuse compatible iOS audio session in TTSKit playback#464
shura-v wants to merge 3 commits into
argmaxinc:mainfrom
shura-v:reuse-audio-session

Conversation

@shura-v
Copy link
Copy Markdown
Contributor

@shura-v shura-v commented Apr 29, 2026

Adds a preserveExistingAudioSession option to TTSKitConfig for iOS playback.

By default, behavior is unchanged and TTSKit still configures AVAudioSession for .playback when starting playback. When preserveExistingAudioSession is enabled, TTSKit only activates the existing session and leaves its category, mode, and options untouched.

Why

Some apps already own an active .playAndRecord session when starting TTS playback. Attempting to switch that shared session to .playback can fail at runtime, so this opt-in allows host apps to keep their existing audio session configuration.

Testing

  • swift build --target TTSKit
  • Manual review of the iOS playback startup path

@shura-v shura-v force-pushed the reuse-audio-session branch from 1fa83db to 38ea263 Compare April 29, 2026 03:24
@shura-v shura-v marked this pull request as draft April 29, 2026 03:36
@shura-v shura-v marked this pull request as ready for review April 29, 2026 03:49
@a2they
Copy link
Copy Markdown
Contributor

a2they commented May 1, 2026

Hi @shura-v , thank you for the contribution. Please rebase your PR to pickup latest CI changes which should resolve the failing tests. We'll add these to next release once CI builds pass.

@shura-v shura-v force-pushed the reuse-audio-session branch from 7201e0b to 2237657 Compare May 1, 2026 21:07
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