Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -135,7 +135,7 @@ def generate_sample_audio(sample_text, selected_speaker):
|
|
135 |
raise gr.Error("Sample text cannot be empty.")
|
136 |
sid = selected_speaker.split(" ")[0] # Extract speaker ID
|
137 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp_wav:
|
138 |
-
tts.tts_to_file(text=sample_text, speaker=sid, file_path=tmp_wav.name)
|
139 |
return tmp_wav.name
|
140 |
|
141 |
# Main conversion function
|
@@ -148,7 +148,7 @@ def docx_to_zipped_wavs(doc_file, selected_speaker):
|
|
148 |
if not para:
|
149 |
continue
|
150 |
with tempfile.NamedTemporaryFile(suffix=f"_{i}.wav", delete=False) as tmp_wav:
|
151 |
-
tts.tts_to_file(text=para, speaker=sid, file_path=tmp_wav.name)
|
152 |
audio_files.append(tmp_wav.name)
|
153 |
except Exception as e:
|
154 |
print("Connection interrupted, returning partial result.", str(e))
|
|
|
135 |
raise gr.Error("Sample text cannot be empty.")
|
136 |
sid = selected_speaker.split(" ")[0] # Extract speaker ID
|
137 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp_wav:
|
138 |
+
tts.tts_to_file(text=sample_text, speaker="p"+sid, file_path=tmp_wav.name)
|
139 |
return tmp_wav.name
|
140 |
|
141 |
# Main conversion function
|
|
|
148 |
if not para:
|
149 |
continue
|
150 |
with tempfile.NamedTemporaryFile(suffix=f"_{i}.wav", delete=False) as tmp_wav:
|
151 |
+
tts.tts_to_file(text=para, speaker="p"+sid, file_path=tmp_wav.name)
|
152 |
audio_files.append(tmp_wav.name)
|
153 |
except Exception as e:
|
154 |
print("Connection interrupted, returning partial result.", str(e))
|