Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ import gradio as gr
|
|
3 |
def text_to_speech(text, voice):
|
4 |
import subprocess
|
5 |
import audiosegment
|
6 |
-
from IPython.display import Audio, display
|
7 |
|
8 |
command = ['edge-tts', '--voice', voice, '--text', text,
|
9 |
'--write-media', 'edge.mp3', '--write-subtitles', 'edge.vtt']
|
@@ -11,11 +10,6 @@ def text_to_speech(text, voice):
|
|
11 |
result = subprocess.run(command, stdout=subprocess.PIPE, text=True)
|
12 |
print(result.stdout)
|
13 |
|
14 |
-
try:
|
15 |
-
display(Audio("edge.mp3", autoplay=True))
|
16 |
-
except Exception as e:
|
17 |
-
print("Error:", str(e))
|
18 |
-
|
19 |
|
20 |
voice_options = ["en-US-JennyNeural", "en-US-GuyNeural"]
|
21 |
|
|
|
3 |
def text_to_speech(text, voice):
|
4 |
import subprocess
|
5 |
import audiosegment
|
|
|
6 |
|
7 |
command = ['edge-tts', '--voice', voice, '--text', text,
|
8 |
'--write-media', 'edge.mp3', '--write-subtitles', 'edge.vtt']
|
|
|
10 |
result = subprocess.run(command, stdout=subprocess.PIPE, text=True)
|
11 |
print(result.stdout)
|
12 |
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
voice_options = ["en-US-JennyNeural", "en-US-GuyNeural"]
|
15 |
|