Repository navigation
fish-audio-sdk: v1.9.1
1.9.1 (2026-12-04)
Bug Fixes
- tts: give the realtime TTS connection one owner (#213) (2cdf163)
- websocket: accept the API's audio messages under httpx-ws 0.10 (#215) (05ea8be)
Upgrade notes
Realtime text to speech (tts.stream_websocket(), sync and async) now has one owner for its connection. Errors you caught on 1.9.0 are still caught: WebSocketError, httpx_ws.WebSocketNetworkError for a lost connection, httpx_ws.WebSocketUpgradeError for a refused handshake, and your own text source's exceptions. What can differ for your code:
- The server's
finishends the session. If your text source is still waiting for its next item when the server finishes, the SDK stops waiting: an async pull is cancelled and a generator source is closed, and work the source shares with something else (a task it awaits) is cancelled with it. Useasyncio.shield()for work that must finish. On 1.9.0 the stream waited for your source, for ever if it never ended. - After an error, audio you have not read yet is not delivered. If your text source fails or the connection breaks while audio is waiting to be read, the stream raises that error at once. A slow caller can get fewer chunks before the same error than on 1.9.0.
- A generator text source is closed when the stream ends, so its
finallyruns then; on 1.9.0 it ran at garbage collection. - An error while closing the connection after the stream ended is logged, not raised (logger
fishaudio.resources.realtime, debug level). - A lost connection raises
WebSocketError("WebSocket connection lost")with httpx-ws's exception as__cause__. It is also anhttpx_ws.WebSocketNetworkErrorwhen that is the cause, so bothexceptclauses catch it. - httpx-ws 0.10 (what
pip installgives on Python 3.11+) closed the connection on audio messages over 64 KiB. The SDK now sets a 64 MiB limit of its own;WebSocketOptions(max_message_size_bytes=...)still wins. - httpx-ws's in-process
ASGIWebSocketTransporton httpx-ws 0.7.2 and 0.8.0: leaving thehttpx.AsyncClientafter an async stream raises a cancel-scopeRuntimeError. Real network connections and httpx-ws 0.8.1+ are not affected.