S0h9l commited on
Commit
b2fc1af
·
1 Parent(s): 653a5f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -12,7 +12,7 @@ model = whisper.load_model("tiny")
12
 
13
  LANGUAGES = list(gtts.lang.tts_langs())
14
 
15
- def transcribe(audio):
16
 
17
  #time.sleep(3)
18
  # load audio and pad/trim it to fit 30 seconds
@@ -45,7 +45,7 @@ def transcribe(audio):
45
  #result.text
46
  reptxt = response.generations[0].text.strip("--")
47
 
48
- tts = gTTS(text=text, lang='el')
49
  tts.save('result.mp3')
50
  filename = 'result.mp3'
51
  return filename
@@ -59,7 +59,5 @@ gr.Interface(
59
  gr.inputs.Audio(source="microphone", type="filepath"),
60
  gr.Radio(label="Language", choices=LANGUAGES, value="en")
61
  ],
62
- outputs=[
63
- "textbox"
64
- ],
65
  live=True).launch()
 
12
 
13
  LANGUAGES = list(gtts.lang.tts_langs())
14
 
15
+ def transcribe(audio,language):
16
 
17
  #time.sleep(3)
18
  # load audio and pad/trim it to fit 30 seconds
 
45
  #result.text
46
  reptxt = response.generations[0].text.strip("--")
47
 
48
+ tts = gTTS(text=reptxt, lang=language)
49
  tts.save('result.mp3')
50
  filename = 'result.mp3'
51
  return filename
 
59
  gr.inputs.Audio(source="microphone", type="filepath"),
60
  gr.Radio(label="Language", choices=LANGUAGES, value="en")
61
  ],
62
+ outputs=gr.Audio(label="Output"),
 
 
63
  live=True).launch()