Spaces:
Build error
Build error
Commit
•
a96b473
1
Parent(s):
93f702e
Update app.py
Browse files
app.py
CHANGED
@@ -8,11 +8,12 @@ import os
|
|
8 |
import numpy as np
|
9 |
|
10 |
def translate_speech_to_speech(input_audio):
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
input_file = "input_audio.wav"
|
15 |
-
sf.write(input_file, input_audio,
|
|
|
16 |
|
17 |
# Language detection and translation code from the first code snippet
|
18 |
model = whisper.load_model("base")
|
|
|
8 |
import numpy as np
|
9 |
|
10 |
def translate_speech_to_speech(input_audio):
|
11 |
+
input_audio, sample_rate = input_tuple
|
12 |
+
|
13 |
+
# Save the input audio to a temporary file
|
14 |
input_file = "input_audio.wav"
|
15 |
+
sf.write(input_file, input_audio, sample_rate) # use the sample rate from Gradio
|
16 |
+
|
17 |
|
18 |
# Language detection and translation code from the first code snippet
|
19 |
model = whisper.load_model("base")
|