Baghdad99 commited on
Commit
03b277d
1 Parent(s): 0622f39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -20,7 +20,7 @@ def translate_speech(audio):
20
  print(f"Type of audio: {type(audio)}, Value of audio: {audio}") # Debug line
21
 
22
  # audio is a tuple (np.ndarray, int), we need to save it as a file
23
- audio_data, sample_rate = audio
24
  if isinstance(audio_data, np.ndarray) and len(audio_data.shape) == 1: # if audio_data is 1D, reshape it to 2D
25
  audio_data = np.reshape(audio_data, (-1, 1))
26
  with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as f:
 
20
  print(f"Type of audio: {type(audio)}, Value of audio: {audio}") # Debug line
21
 
22
  # audio is a tuple (np.ndarray, int), we need to save it as a file
23
+ sample_rate, audio_data = audio
24
  if isinstance(audio_data, np.ndarray) and len(audio_data.shape) == 1: # if audio_data is 1D, reshape it to 2D
25
  audio_data = np.reshape(audio_data, (-1, 1))
26
  with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as f: