Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,8 +32,9 @@ def find_most_similar_command(statement, command_list):
|
|
32 |
def transcribe_the_command(audio):
|
33 |
import soundfile as sf
|
34 |
file_name = "recorded_audio.wav"
|
35 |
-
|
36 |
-
|
|
|
37 |
transcript = asr_pipe(file_name)["text"]
|
38 |
most_similar_command,reply = find_most_similar_command(transcript, commands)
|
39 |
print(f"Given Statement: {transcript}")
|
|
|
32 |
def transcribe_the_command(audio):
|
33 |
import soundfile as sf
|
34 |
file_name = "recorded_audio.wav"
|
35 |
+
mono_audio = (audio[:, 0] + audio[:, 1]) / 2
|
36 |
+
print(mono_audio)
|
37 |
+
sf.write(file_name, mono_audio, 48000)
|
38 |
transcript = asr_pipe(file_name)["text"]
|
39 |
most_similar_command,reply = find_most_similar_command(transcript, commands)
|
40 |
print(f"Given Statement: {transcript}")
|