Update app.py
Browse files
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 =
|
|
|
|
|
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 |
|