jdbolter commited on
Commit
96e3d85
·
verified ·
1 Parent(s): 8280347

Upload app.py

Browse files

trying to get autoplay to work

Files changed (1) hide show
  1. app.py +3 -3
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 gpt_response, audio_output_path
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.Textbox(label="GPT Response"),
117
- gr.Audio(label="TTS Playback", type="filepath")
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"