frogcho123 commited on
Commit
53c1f5b
·
1 Parent(s): 7e0b303

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -43,12 +43,12 @@ def translate_speech_to_speech(input_audio):
43
  translated_audio, sr = sf.read(output_file, dtype="float32")
44
  translated_audio = (translated_audio * 32767).astype("int16")
45
 
46
- return translated_audio, sr
47
 
48
  title = "Speech-to-Speech Translator"
49
 
50
- input_audio = gr.inputs.Audio(source="microphone", type="numpy", dtype="float32", sample_rate=44100)
51
- output_audio = gr.outputs.Audio(type="numpy", dtype="int16", sample_rate=44100)
52
 
53
  stt_demo = gr.Interface(
54
  fn=translate_speech_to_speech,
@@ -62,5 +62,3 @@ if __name__ == "__main__":
62
  stt_demo.launch()
63
 
64
 
65
-
66
-
 
43
  translated_audio, sr = sf.read(output_file, dtype="float32")
44
  translated_audio = (translated_audio * 32767).astype("int16")
45
 
46
+ return translated_audio
47
 
48
  title = "Speech-to-Speech Translator"
49
 
50
+ input_audio = gr.inputs.Audio(source="microphone", type="numpy", sample_rate=44100)
51
+ output_audio = gr.outputs.Audio(type="numpy", sample_rate=44100)
52
 
53
  stt_demo = gr.Interface(
54
  fn=translate_speech_to_speech,
 
62
  stt_demo.launch()
63
 
64