Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ def generate_speech(api_token, answer):
|
|
| 38 |
try:
|
| 39 |
response.raise_for_status() # Raise an error for bad responses
|
| 40 |
audio = response.content
|
| 41 |
-
audio_segment = AudioSegment.from_file(BytesIO(audio), format="
|
| 42 |
audio_file_path = "/tmp/answer.wav"
|
| 43 |
audio_segment.export(audio_file_path, format="wav")
|
| 44 |
return audio_file_path
|
|
@@ -76,4 +76,4 @@ iface = gr.Interface(
|
|
| 76 |
|
| 77 |
# Launch the Gradio app
|
| 78 |
if __name__ == "__main__":
|
| 79 |
-
iface.launch()
|
|
|
|
| 38 |
try:
|
| 39 |
response.raise_for_status() # Raise an error for bad responses
|
| 40 |
audio = response.content
|
| 41 |
+
audio_segment = AudioSegment.from_file(BytesIO(audio), format="flac")
|
| 42 |
audio_file_path = "/tmp/answer.wav"
|
| 43 |
audio_segment.export(audio_file_path, format="wav")
|
| 44 |
return audio_file_path
|
|
|
|
| 76 |
|
| 77 |
# Launch the Gradio app
|
| 78 |
if __name__ == "__main__":
|
| 79 |
+
iface.launch(share=True)
|