swan387 commited on
Commit
5583619
1 Parent(s): c3cd78e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -37,7 +37,9 @@ def synthesise(text):
37
  def speech_to_speech_translation(audio):
38
  translated_text = translate(audio)
39
  synthesised_speech = synthesise(translated_text)
40
- synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
 
 
41
  return 16000, synthesised_speech
42
 
43
 
 
37
  def speech_to_speech_translation(audio):
38
  translated_text = translate(audio)
39
  synthesised_speech = synthesise(translated_text)
40
+ synthesised_speech = synthesised_speech.numpy()
41
+ synthesised_speech = np.clip(synthesised_speech, -1.0, 1.0)
42
+ synthesised_speech = (synthesised_speech * 32767).astype(np.int16)
43
  return 16000, synthesised_speech
44
 
45