Spaces:
Building
Building
Update stt/stt_google.py
Browse files- stt/stt_google.py +15 -15
stt/stt_google.py
CHANGED
@@ -340,10 +340,11 @@ class GoogleCloudSTT(STTInterface):
|
|
340 |
# Stop event'i temizle
|
341 |
self.stop_event.clear()
|
342 |
|
343 |
-
# Yeni client oluştur (TEK SEFER)
|
344 |
self.client = speech.SpeechClient()
|
345 |
log_info("✅ Created new Google Speech client")
|
346 |
-
|
|
|
347 |
recognition_config = speech.RecognitionConfig(
|
348 |
encoding=self._get_encoding(config.encoding),
|
349 |
sample_rate_hertz=config.sample_rate,
|
@@ -358,23 +359,22 @@ class GoogleCloudSTT(STTInterface):
|
|
358 |
microphone_distance=speech.RecognitionMetadata.MicrophoneDistance.NEARFIELD,
|
359 |
recording_device_type=speech.RecognitionMetadata.RecordingDeviceType.PC,
|
360 |
)
|
361 |
-
)
|
362 |
-
|
363 |
-
|
364 |
-
enable_voice_activity_events=True, # ✅ VAD events'leri de açalım
|
365 |
-
|
366 |
-
log_info(f"📋 Streaming config created: interim_results={config.interim_results}, "
|
367 |
-
f"single_utterance={config.single_utterance}, "
|
368 |
-
f"VAD_events=True")
|
369 |
-
|
370 |
self.streaming_config = speech.StreamingRecognitionConfig(
|
371 |
config=recognition_config,
|
372 |
-
interim_results=config.interim_results,
|
373 |
-
single_utterance=config.single_utterance
|
|
|
374 |
)
|
375 |
-
|
|
|
|
|
|
|
|
|
376 |
self.is_streaming = True
|
377 |
-
|
378 |
# Start streaming thread with unique name
|
379 |
self.stream_thread = threading.Thread(
|
380 |
target=self._run_stream,
|
|
|
340 |
# Stop event'i temizle
|
341 |
self.stop_event.clear()
|
342 |
|
343 |
+
python# Yeni client oluştur (TEK SEFER)
|
344 |
self.client = speech.SpeechClient()
|
345 |
log_info("✅ Created new Google Speech client")
|
346 |
+
|
347 |
+
# Create recognition config
|
348 |
recognition_config = speech.RecognitionConfig(
|
349 |
encoding=self._get_encoding(config.encoding),
|
350 |
sample_rate_hertz=config.sample_rate,
|
|
|
359 |
microphone_distance=speech.RecognitionMetadata.MicrophoneDistance.NEARFIELD,
|
360 |
recording_device_type=speech.RecognitionMetadata.RecordingDeviceType.PC,
|
361 |
)
|
362 |
+
) # ✅ Parantez burada kapanmalı
|
363 |
+
|
364 |
+
# Create streaming config with VAD
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
self.streaming_config = speech.StreamingRecognitionConfig(
|
366 |
config=recognition_config,
|
367 |
+
interim_results=config.interim_results, # ✅ Bu zaten True
|
368 |
+
single_utterance=config.single_utterance, # ✅ Bu False
|
369 |
+
enable_voice_activity_events=True # ✅ VAD events'leri açıyoruz
|
370 |
)
|
371 |
+
|
372 |
+
log_info(f"📋 Streaming config created: interim_results={config.interim_results}, "
|
373 |
+
f"single_utterance={config.single_utterance}, "
|
374 |
+
f"VAD_events=True")
|
375 |
+
|
376 |
self.is_streaming = True
|
377 |
+
|
378 |
# Start streaming thread with unique name
|
379 |
self.stream_thread = threading.Thread(
|
380 |
target=self._run_stream,
|