frogcho123 commited on
Commit
589e047
·
1 Parent(s): 949a693

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -17,7 +17,7 @@ def translate_speech(audio, target_lang):
17
  # Save audio as a temporary file
18
  audio_path = "recorded_audio.wav"
19
  with open(audio_path, "wb") as f:
20
- f.write(audio[0].tobytes())
21
 
22
  # Load audio
23
  audio = whisper.load_audio(audio_path)
@@ -58,4 +58,3 @@ target_language = gr.inputs.Dropdown(["en", "ru", "fr"], label="Target Language"
58
  output_audio = gr.outputs.Audio(type="numpy", label="Translated Audio")
59
 
60
  gr.Interface(fn=translate_speech_interface, inputs=[audio_recording, target_language], outputs=output_audio, title="Speech Translator").launch()
61
-
 
17
  # Save audio as a temporary file
18
  audio_path = "recorded_audio.wav"
19
  with open(audio_path, "wb") as f:
20
+ f.write(audio.tobytes())
21
 
22
  # Load audio
23
  audio = whisper.load_audio(audio_path)
 
58
  output_audio = gr.outputs.Audio(type="numpy", label="Translated Audio")
59
 
60
  gr.Interface(fn=translate_speech_interface, inputs=[audio_recording, target_language], outputs=output_audio, title="Speech Translator").launch()