Add WebSocket broadcast to stt-server.py

Every connection receives the full event stream (vad_start, vad_end,
transcript, error) from the moment it connects — no subscription
handshake required. The asyncio WebSocket server runs in a daemon thread
alongside the VAD loop and transcription thread. Events still go to
stdout unchanged.

Port is configurable via STT_PORT env var (default: 11501).
Add websockets to both setup scripts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 08:53:54 +00:00
parent a4fe95b24a
commit 18404708e3
3 changed files with 77 additions and 23 deletions

View File

@@ -25,7 +25,7 @@ fi
echo "==> installing torch and faster-whisper"
"${VENV}/bin/pip" install --upgrade pip --quiet
"${VENV}/bin/pip" install torch faster-whisper silero-vad
"${VENV}/bin/pip" install torch faster-whisper silero-vad websockets
echo ""
echo "==> done. Venv ready at ${VENV}"