Hunzla commited on
Commit
963f3fd
1 Parent(s): 1e41085

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- transcript = asr_pipe(audio_path)["text"]
 
 
 
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")