Spaces:
Running
Running
Upload app.py
Browse filestrying to get autoplay to work
app.py
CHANGED
@@ -96,7 +96,7 @@ def chat_and_speak(user_input, language_choice):
|
|
96 |
print("⚠️ No audio data received from Speechify or audio_data is not a string.")
|
97 |
return f"{gpt_response}\n\n⚠️ No audio data received from Speechify.", None
|
98 |
|
99 |
-
return
|
100 |
|
101 |
except Exception as e:
|
102 |
print(f"🔥 An unexpected error occurred: {e}")
|
@@ -113,8 +113,8 @@ iface = gr.Interface(
|
|
113 |
gr.Dropdown(choices=["Portuguese", "French", "Spanish"], value="Portuguese", label="Language"),
|
114 |
],
|
115 |
outputs=[
|
116 |
-
gr.
|
117 |
-
gr.
|
118 |
],
|
119 |
title="Language Tutor with GPT and Speechify",
|
120 |
allow_flagging="never"
|
|
|
96 |
print("⚠️ No audio data received from Speechify or audio_data is not a string.")
|
97 |
return f"{gpt_response}\n\n⚠️ No audio data received from Speechify.", None
|
98 |
|
99 |
+
return audio_output_path, gpt_response
|
100 |
|
101 |
except Exception as e:
|
102 |
print(f"🔥 An unexpected error occurred: {e}")
|
|
|
113 |
gr.Dropdown(choices=["Portuguese", "French", "Spanish"], value="Portuguese", label="Language"),
|
114 |
],
|
115 |
outputs=[
|
116 |
+
gr.Audio(label="TTS Playback", type="filepath", autoplay=True),
|
117 |
+
gr.Textbox(label="GPT Response")
|
118 |
],
|
119 |
title="Language Tutor with GPT and Speechify",
|
120 |
allow_flagging="never"
|