Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,14 +31,12 @@ def find_most_similar_command(statement, command_list):
|
|
31 |
return best_match,reply
|
32 |
def transcribe_the_command(audio):
|
33 |
import soundfile as sf
|
34 |
-
|
35 |
file_name = "recorded_audio.wav"
|
36 |
-
audio_data
|
37 |
-
|
38 |
# Convert stereo to mono by averaging the two channels
|
39 |
-
|
40 |
-
|
41 |
-
sf.write(file_name, mono_audio, 48000)
|
42 |
transcript = asr_pipe(file_name)["text"]
|
43 |
most_similar_command,reply = find_most_similar_command(transcript, commands)
|
44 |
print(f"Given Statement: {transcript}")
|
|
|
31 |
return best_match,reply
|
32 |
def transcribe_the_command(audio):
|
33 |
import soundfile as sf
|
34 |
+
sample_rate, audio_data = audio
|
35 |
file_name = "recorded_audio.wav"
|
36 |
+
sf.write(file_name, audio_data, sample_rate)
|
|
|
37 |
# Convert stereo to mono by averaging the two channels
|
38 |
+
print(file_name)
|
39 |
+
|
|
|
40 |
transcript = asr_pipe(file_name)["text"]
|
41 |
most_similar_command,reply = find_most_similar_command(transcript, commands)
|
42 |
print(f"Given Statement: {transcript}")
|