shamik commited on
Commit
58e77db
1 Parent(s): c705c41

Modified the app.

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -52,6 +52,15 @@ The below diagram shows how the cascaded speech to speech translation works.
52
 
53
  demo = gr.Blocks()
54
 
 
 
 
 
 
 
 
 
 
55
  file_translate = gr.Interface(
56
  fn=speech_to_speech_translation,
57
  inputs=gr.Audio(sources="upload", label="Audio file", type="filepath"),
@@ -64,7 +73,7 @@ file_translate = gr.Interface(
64
  )
65
 
66
  with demo:
67
- gr.TabbedInterface([file_translate], ["Audio File"])
68
 
69
  demo.launch()
70
 
 
52
 
53
  demo = gr.Blocks()
54
 
55
+ mic_translate = gr.Interface(
56
+ fn=speech_to_speech_translation,
57
+ inputs=gr.Audio(source="microphone", type="filepath"),
58
+ outputs=gr.Audio(label="Generated Speech", type="numpy"),
59
+ title=title,
60
+ description=description,
61
+ )
62
+
63
+
64
  file_translate = gr.Interface(
65
  fn=speech_to_speech_translation,
66
  inputs=gr.Audio(sources="upload", label="Audio file", type="filepath"),
 
73
  )
74
 
75
  with demo:
76
+ gr.TabbedInterface([mic_translate,file_translate], ["Microphone","Audio File"])
77
 
78
  demo.launch()
79