Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,10 @@ def find_most_similar_command(statement, command_list):
|
|
30 |
reply="unknown.wav"
|
31 |
return best_match,reply
|
32 |
def transcribe_the_command(audio_path):
|
33 |
-
|
|
|
|
|
|
|
34 |
most_similar_command,reply = find_most_similar_command(transcript, commands)
|
35 |
print(f"Given Statement: {transcript}")
|
36 |
print(f"Most Similar Command: {most_similar_command}\n")
|
|
|
30 |
reply="unknown.wav"
|
31 |
return best_match,reply
|
32 |
def transcribe_the_command(audio_path):
|
33 |
+
import soundfile as sf
|
34 |
+
file_name = "recorded_audio.wav"
|
35 |
+
sf.write(file_name, audio_path.squeeze(), samplerate=44100)
|
36 |
+
transcript = asr_pipe(file_name)["text"]
|
37 |
most_similar_command,reply = find_most_similar_command(transcript, commands)
|
38 |
print(f"Given Statement: {transcript}")
|
39 |
print(f"Most Similar Command: {most_similar_command}\n")
|