Spaces:
Running
Running
Update stt_lifecycle_manager.py
Browse files- stt_lifecycle_manager.py +12 -2
stt_lifecycle_manager.py
CHANGED
@@ -109,15 +109,25 @@ class STTLifecycleManager:
|
|
109 |
stt_config = STTConfig(
|
110 |
language=self._get_language_code(locale),
|
111 |
sample_rate=config_data.get("sample_rate", 16000),
|
112 |
-
encoding=config_data.get("encoding", "WEBM_OPUS"),
|
113 |
enable_punctuation=config_data.get("enable_punctuation", True),
|
114 |
enable_word_timestamps=False,
|
115 |
model=config_data.get("model", "latest_long"),
|
116 |
use_enhanced=config_data.get("use_enhanced", True),
|
117 |
single_utterance=False, # ✅ Continuous listening için FALSE olmalı
|
118 |
-
interim_results=True
|
|
|
|
|
|
|
|
|
119 |
)
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
stt_session.config = stt_config
|
122 |
|
123 |
# Start streaming
|
|
|
109 |
stt_config = STTConfig(
|
110 |
language=self._get_language_code(locale),
|
111 |
sample_rate=config_data.get("sample_rate", 16000),
|
112 |
+
encoding=config_data.get("encoding", "WEBM_OPUS"), # Try "LINEAR16" if WEBM fails
|
113 |
enable_punctuation=config_data.get("enable_punctuation", True),
|
114 |
enable_word_timestamps=False,
|
115 |
model=config_data.get("model", "latest_long"),
|
116 |
use_enhanced=config_data.get("use_enhanced", True),
|
117 |
single_utterance=False, # ✅ Continuous listening için FALSE olmalı
|
118 |
+
interim_results=True, # ✅ Interim results'ı AÇ
|
119 |
+
# Additional debug parameters
|
120 |
+
enable_automatic_punctuation=True,
|
121 |
+
enable_speaker_diarization=False,
|
122 |
+
max_alternatives=1
|
123 |
)
|
124 |
|
125 |
+
# Log the exact config being used
|
126 |
+
log_info(f"📋 STT Config: encoding={stt_config.encoding}, "
|
127 |
+
f"sample_rate={stt_config.sample_rate}, "
|
128 |
+
f"single_utterance={stt_config.single_utterance}, "
|
129 |
+
f"interim_results={stt_config.interim_results}")
|
130 |
+
|
131 |
stt_session.config = stt_config
|
132 |
|
133 |
# Start streaming
|