Baghdad99 commited on
Commit
e3a6dbd
1 Parent(s): 7ae6fbc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -27,8 +27,10 @@ def synthesise(translated_text):
27
  return audio
28
 
29
  def translate_speech(audio, sampling_rate):
30
- translated_text = translate(audio, sampling_rate)
31
  synthesised_speech = synthesise(translated_text)
 
 
32
  synthesised_speech = (synthesised_speech.numpy() * max_range).astype(np.int16)
33
  return 16000, synthesised_speech
34
 
 
27
  return audio
28
 
29
  def translate_speech(audio, sampling_rate):
30
+ translated_text = translate(audio, sampling_rate=sampling_rate)
31
  synthesised_speech = synthesise(translated_text)
32
+ # Define the max_range variable
33
+ max_range = 32767 # You can adjust this value based on your requirements
34
  synthesised_speech = (synthesised_speech.numpy() * max_range).astype(np.int16)
35
  return 16000, synthesised_speech
36