Skip to content

Feat/speak module#15

Merged
74th merged 6 commits intomainfrom
feat/speak-module
Mar 9, 2026
Merged

Feat/speak module#15
74th merged 6 commits intomainfrom
feat/speak-module

Conversation

@74th
Copy link
Owner

@74th 74th commented Mar 9, 2026

This pull request adds support for speech synthesis (text-to-speech, TTS) to the StackChan server, enabling both VoiceVox and Google Gemini (Vertex AI) TTS backends. It introduces a new SpeakHandler for managing TTS streaming over WebSockets, updates the application and type system to support speech synthesizers, and improves logging and dependency management.

Speech Synthesis Integration:

  • Added the SpeakHandler class in stackchan_server/speak.py to handle text-to-speech streaming, segmenting, and playback over WebSockets, supporting both standard and streaming synthesizers.
  • Introduced SpeechSynthesizer and StreamingSpeechSynthesizer protocols, along with the AudioFormat dataclass, to standardize TTS interfaces in stackchan_server/types.py. [1] [2]

TTS Backend Implementations:

  • Added VoiceVoxSpeechSynthesizer for VoiceVox-based TTS in stackchan_server/speech_synthesis/voicevox.py, and GoogleCloudTextToSpeech for Google Gemini TTS in stackchan_server/speech_synthesis/google_cloud.py. [1] [2]
  • Created a factory function create_speech_synthesizer in stackchan_server/speech_synthesis/__init__.py to instantiate the default TTS backend.

Application and WebSocket Proxy Updates:

  • Updated StackChanApp and WsProxy to accept and use a SpeechSynthesizer for TTS, passing it through the WebSocket handler for use in sessions. [1] [2] [3]

Dependency and Logging Improvements:

  • Added google-genai as a required dependency and cleaned up extras in pyproject.toml. [1] [2]
  • Improved logging configuration in example_apps/echo.py for better debugging and observability.

@74th 74th merged commit 4008987 into main Mar 9, 2026
1 check passed
@74th 74th deleted the feat/speak-module branch March 9, 2026 12:52
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.

1 participant