Update voice_processing.py
Browse files- voice_processing.py +5 -4
voice_processing.py
CHANGED
@@ -213,10 +213,11 @@ async def tts(
|
|
213 |
|
214 |
audio_data_uri = f"data:audio/mp3;base64,{audio_base64}"
|
215 |
|
216 |
-
return
|
217 |
info,
|
218 |
-
audio_data_uri
|
219 |
-
|
|
|
220 |
|
221 |
except Exception as e:
|
222 |
print(f"Error in TTS task: {str(e)}")
|
@@ -224,7 +225,7 @@ async def tts(
|
|
224 |
traceback.print_exc()
|
225 |
if os.path.exists(edge_output_filename):
|
226 |
os.remove(edge_output_filename)
|
227 |
-
return
|
228 |
|
229 |
voice_mapping = {
|
230 |
"Mongolian Male": "mn-MN-BataaNeural",
|
|
|
213 |
|
214 |
audio_data_uri = f"data:audio/mp3;base64,{audio_base64}"
|
215 |
|
216 |
+
return (
|
217 |
info,
|
218 |
+
audio_data_uri,
|
219 |
+
(tgt_sr, audio_opt) # Return the target sample rate and audio output
|
220 |
+
)
|
221 |
|
222 |
except Exception as e:
|
223 |
print(f"Error in TTS task: {str(e)}")
|
|
|
225 |
traceback.print_exc()
|
226 |
if os.path.exists(edge_output_filename):
|
227 |
os.remove(edge_output_filename)
|
228 |
+
return (str(e), None, None)
|
229 |
|
230 |
voice_mapping = {
|
231 |
"Mongolian Male": "mn-MN-BataaNeural",
|