Removing audio sleep from FastAPI and WebSocket server when they are not connected.

This commit is contained in:
Filipi Fuchter
2025-08-06 14:02:51 -03:00
parent bbe01d10ef
commit 84fecabac5
2 changed files with 1 additions and 8 deletions

View File

@@ -419,12 +419,7 @@ class FastAPIWebsocketOutputTransport(BaseOutputTransport):
Args:
frame: The output audio frame to write.
"""
if self._client.is_closing:
return
if not self._client.is_connected:
# Simulate audio playback with a sleep.
await self._write_audio_sleep()
if self._client.is_closing or not self._client.is_connected:
return
frame = OutputAudioRawFrame(

View File

@@ -353,8 +353,6 @@ class WebsocketServerOutputTransport(BaseOutputTransport):
frame: The output audio frame to write.
"""
if not self._websocket:
# Simulate audio playback with a sleep.
await self._write_audio_sleep()
return
frame = OutputAudioRawFrame(