Fixed an issue with GoogleSTTService where it was constantly reconnecting before starting to receive audio from the user.

This commit is contained in:
Filipi Fuchter
2025-06-12 12:07:33 -03:00
parent 228afe01ed
commit c1db13ceeb
2 changed files with 12 additions and 0 deletions

View File

@@ -747,6 +747,11 @@ class GoogleSTTService(STTService):
try:
while True:
try:
if self._request_queue.empty():
# wait for 10ms in case we don't have audio
await asyncio.sleep(0.01)
continue
# Start bi-directional streaming
streaming_recognize = await self._client.streaming_recognize(
requests=self._request_generator()