Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
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:
|