Spaces:
Sleeping
Sleeping
JerryYen
commited on
Commit
•
ad84686
1
Parent(s):
6fad6b2
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import edge_tts
|
|
4 |
import gradio as gr
|
5 |
import tempfile
|
6 |
import anyio
|
|
|
7 |
|
8 |
language_dict = tts_order_voice
|
9 |
|
@@ -15,7 +16,10 @@ async def text_to_speech_edge(text, language_code):
|
|
15 |
|
16 |
await communicate.save(tmp_path)
|
17 |
|
18 |
-
|
|
|
|
|
|
|
19 |
|
20 |
|
21 |
|
|
|
4 |
import gradio as gr
|
5 |
import tempfile
|
6 |
import anyio
|
7 |
+
import ffmpeg
|
8 |
|
9 |
language_dict = tts_order_voice
|
10 |
|
|
|
16 |
|
17 |
await communicate.save(tmp_path)
|
18 |
|
19 |
+
new_temp_path = tmp_path.replace(".mp3", ".wav")
|
20 |
+
await ffmpeg.input(tmp_path).output(new_temp_path).run()
|
21 |
+
|
22 |
+
return new_temp_path
|
23 |
|
24 |
|
25 |
|