frogcho123 commited on
Commit
15e6fbb
·
1 Parent(s): cffc29a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -8,7 +8,8 @@ import os
8
  import numpy as np
9
 
10
  def translate_speech_to_speech(input_audio):
11
-
 
12
  # Save the input audio to a temporary file
13
  input_file = "input_audio.wav"
14
  sf.write(input_file, input_audio, 16000)
 
8
  import numpy as np
9
 
10
  def translate_speech_to_speech(input_audio):
11
+ if input_audio.ndim == 2:
12
+ input_audio = np.mean(input_audio, axis=1)
13
  # Save the input audio to a temporary file
14
  input_file = "input_audio.wav"
15
  sf.write(input_file, input_audio, 16000)