Spaces:
Building
Building
Update stt_google.py
Browse files- stt_google.py +8 -8
stt_google.py
CHANGED
@@ -100,6 +100,14 @@ class GoogleCloudSTT(STTInterface):
|
|
100 |
log_error(f"❌ Failed to start Google STT streaming", error=str(e))
|
101 |
self.is_streaming = False
|
102 |
raise
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
def _run_stream(self):
|
105 |
"""Run the streaming recognition in a separate thread"""
|
@@ -213,14 +221,6 @@ class GoogleCloudSTT(STTInterface):
|
|
213 |
finally:
|
214 |
log_info("🎤 Google STT stream thread ended")
|
215 |
|
216 |
-
def _put_result(self, result: TranscriptionResult):
|
217 |
-
"""Helper to put result in queue"""
|
218 |
-
try:
|
219 |
-
self.responses_queue.put(result)
|
220 |
-
# Debug log'u kaldırdık
|
221 |
-
except Exception as e:
|
222 |
-
log_error(f"❌ Error queuing result: {e}")
|
223 |
-
|
224 |
async def stream_audio(self, audio_chunk: bytes) -> AsyncIterator[TranscriptionResult]:
|
225 |
"""Stream audio chunk and get transcription results"""
|
226 |
if not self.is_streaming:
|
|
|
100 |
log_error(f"❌ Failed to start Google STT streaming", error=str(e))
|
101 |
self.is_streaming = False
|
102 |
raise
|
103 |
+
|
104 |
+
def _put_result(self, result: TranscriptionResult):
|
105 |
+
"""Helper to put result in queue"""
|
106 |
+
try:
|
107 |
+
self.responses_queue.put(result)
|
108 |
+
# Debug log'u kaldırdık
|
109 |
+
except Exception as e:
|
110 |
+
log_error(f"❌ Error queuing result: {e}")
|
111 |
|
112 |
def _run_stream(self):
|
113 |
"""Run the streaming recognition in a separate thread"""
|
|
|
221 |
finally:
|
222 |
log_info("🎤 Google STT stream thread ended")
|
223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
async def stream_audio(self, audio_chunk: bytes) -> AsyncIterator[TranscriptionResult]:
|
225 |
"""Stream audio chunk and get transcription results"""
|
226 |
if not self.is_streaming:
|