Hunzla commited on
Commit
6d3db2d
1 Parent(s): c87f12a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- print(audio)
36
- sf.write(file_name, audio, 48000)
 
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}")