Skip to content

Conversation

@roryeckel
Copy link
Owner

  • Replace client_lock with semaphore (TTS_CONCURRENT_REQUESTS=3) for controlled concurrency
  • Implement task-based concurrent synthesis: create all tasks immediately, await in order
  • Add streaming coordination via _allow_streaming_task_id to minimize first-chunk latency
  • Update _get_tts_audio_stream to support direct streaming or buffering based on task_id
  • Add _stream_tts_audio_incremental helper for low-latency direct streaming
  • Optimize _stream_audio_to_wyoming by removing unnecessary chunking loop
  • Document pySBD sentence chunking and concurrent pipelining in README
  • Remove client_lock parameter from handler initialization across all tests

Resolves #32

- Replace client_lock with semaphore (TTS_CONCURRENT_REQUESTS=3) for controlled concurrency
- Implement task-based concurrent synthesis: create all tasks immediately, await in order
- Add streaming coordination via _allow_streaming_task_id to minimize first-chunk latency
- Update _get_tts_audio_stream to support direct streaming or buffering based on task_id
- Add _stream_tts_audio_incremental helper for low-latency direct streaming
- Optimize _stream_audio_to_wyoming by removing unnecessary chunking loop
- Document pySBD sentence chunking and concurrent pipelining in README
- Remove client_lock parameter from handler initialization across all tests
@roryeckel roryeckel linked an issue Oct 3, 2025 that may be closed by this pull request
@roryeckel
Copy link
Owner Author

ghcr.io/roryeckel/wyoming_openai:pr-33

Introduces TtsStreamResult dataclass and TtsStreamError exception to properly handle synthesis failures in both streaming and buffered modes. The _abort_synthesis method ensures clean state reset and appropriate Wyoming protocol events when synthesis fails. Includes comprehensive test coverage for various failure scenarios.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@roryeckel
Copy link
Owner Author

I've been testing this in my setup for the past week and it's solid

@roryeckel roryeckel merged commit 90aca0a into main Oct 11, 2025
5 checks passed
@roryeckel roryeckel deleted the 32-037-tts-streaming-regression---sentences-are-always-buffered branch October 11, 2025 01:59
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.

0.3.7 TTS Streaming regression - sentences are always buffered

2 participants