frogcho123 commited on
Commit
3a6f579
1 Parent(s): 6cfff67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -48,14 +48,15 @@ def translate_speech(audio, target_lang):
48
 
49
  def translate_speech_interface(audio, target_lang):
50
  translated_audio = translate_speech(audio, target_lang)
51
- translated_audio = open(translated_audio, "rb")
52
 
53
  return translated_audio
54
 
55
  # Define the Gradio interface
56
  audio_recording = gr.inputs.Audio(source="microphone", type="numpy", label="Record your speech")
57
  target_language = gr.inputs.Dropdown(["en", "ru", "fr"], label="Target Language")
58
- output_audio = gr.outputs.Audio(type="audio/mpeg", label="Translated Audio")
59
 
60
  gr.Interface(fn=translate_speech_interface, inputs=[audio_recording, target_language], outputs=output_audio, title="Speech Translator").launch()
61
 
 
 
48
 
49
  def translate_speech_interface(audio, target_lang):
50
  translated_audio = translate_speech(audio, target_lang)
51
+ translated_audio = open(translated_audio, "rb").read()
52
 
53
  return translated_audio
54
 
55
  # Define the Gradio interface
56
  audio_recording = gr.inputs.Audio(source="microphone", type="numpy", label="Record your speech")
57
  target_language = gr.inputs.Dropdown(["en", "ru", "fr"], label="Target Language")
58
+ output_audio = gr.outputs.Audio(type="file", label="Translated Audio")
59
 
60
  gr.Interface(fn=translate_speech_interface, inputs=[audio_recording, target_language], outputs=output_audio, title="Speech Translator").launch()
61
 
62
+