Spaces:
Building
Building
Update stt_google.py
Browse files- stt_google.py +9 -1
stt_google.py
CHANGED
@@ -131,7 +131,15 @@ class GoogleCloudSTT(STTInterface):
|
|
131 |
log_debug(f"π STT result: {result.alternatives[0].transcript}, final: {result.is_final}")
|
132 |
|
133 |
except Exception as e:
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
finally:
|
136 |
log_info("π€ Google STT stream thread ended")
|
137 |
|
|
|
131 |
log_debug(f"π STT result: {result.alternatives[0].transcript}, final: {result.is_final}")
|
132 |
|
133 |
except Exception as e:
|
134 |
+
error_msg = str(e)
|
135 |
+
log_error(f"β Google STT stream error", error=error_msg)
|
136 |
+
|
137 |
+
# Send error to responses queue
|
138 |
+
if "Bad language code" in error_msg:
|
139 |
+
log_error(f"β Invalid language code in STT config. Check locale settings.")
|
140 |
+
elif "invalid_argument" in error_msg:
|
141 |
+
log_error(f"β Invalid STT configuration. Check encoding and sample rate.")
|
142 |
+
|
143 |
finally:
|
144 |
log_info("π€ Google STT stream thread ended")
|
145 |
|