Baghdad99 commited on
Commit
b175466
1 Parent(s): e27f289

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,8 +21,8 @@ def translate_speech(audio_data_tuple):
21
  # Print the shape and type of the audio data
22
  print(f"Audio data type: {type(audio_data)}, Audio data shape: {audio_data.shape}")
23
 
24
- # Normalize the audio data to the range [-1, 1]
25
- audio_data_normalized = audio_data / np.iinfo(audio_data.dtype).max
26
 
27
  # Convert the normalized audio data to float64
28
  audio_data_float64 = audio_data_normalized.astype(np.float64)
 
21
  # Print the shape and type of the audio data
22
  print(f"Audio data type: {type(audio_data)}, Audio data shape: {audio_data.shape}")
23
 
24
+ # Normalize the audio data to the range [0, 1]
25
+ audio_data_normalized = (audio_data - np.iinfo(audio_data.dtype).min) / (np.iinfo(audio_data.dtype).max - np.iinfo(audio_data.dtype).min)
26
 
27
  # Convert the normalized audio data to float64
28
  audio_data_float64 = audio_data_normalized.astype(np.float64)