mitro99 commited on
Commit
0fddcfb
1 Parent(s): 80cb38e

Hopefully fixed bug

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -44,7 +44,7 @@ def speech_to_speech_translation(audio):
44
  print(translated_text)
45
  synthesised_speech = synthesise(translated_text)
46
  synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
47
- return 16000, synthesised_speech
48
 
49
 
50
  title = "Cascaded STST"
@@ -60,7 +60,10 @@ demo = gr.Blocks()
60
  mic_translate = gr.Interface(
61
  fn=speech_to_speech_translation,
62
  inputs=gr.Audio(source="microphone", type="filepath"),
63
- outputs=gr.Audio(label="Generated Speech", type="numpy"),
 
 
 
64
  title=title,
65
  description=description,
66
  )
@@ -68,7 +71,10 @@ mic_translate = gr.Interface(
68
  file_translate = gr.Interface(
69
  fn=speech_to_speech_translation,
70
  inputs=gr.Audio(source="upload", type="filepath"),
71
- outputs=gr.Audio(label="Generated Speech", type="numpy"),
 
 
 
72
  examples=[["./example.wav"]],
73
  title=title,
74
  description=description,
 
44
  print(translated_text)
45
  synthesised_speech = synthesise(translated_text)
46
  synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
47
+ return (16000, synthesised_speech.T), translated_text
48
 
49
 
50
  title = "Cascaded STST"
 
60
  mic_translate = gr.Interface(
61
  fn=speech_to_speech_translation,
62
  inputs=gr.Audio(source="microphone", type="filepath"),
63
+ outputs=[
64
+ gr.Audio(label="Generated Speech", type="numpy"),
65
+ gr.Text(label="Translation")
66
+ ]
67
  title=title,
68
  description=description,
69
  )
 
71
  file_translate = gr.Interface(
72
  fn=speech_to_speech_translation,
73
  inputs=gr.Audio(source="upload", type="filepath"),
74
+ outputs=[
75
+ gr.Audio(label="Generated Speech", type="numpy"),
76
+ gr.Text(label="Translation")
77
+ ]
78
  examples=[["./example.wav"]],
79
  title=title,
80
  description=description,