Skip to content

Commit

Permalink
updated recording method
Browse files Browse the repository at this point in the history
  • Loading branch information
LordofBone committed Aug 6, 2019
1 parent b3de399 commit d0e4bb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion speech_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ def listen():
inputWords = ""
while (re.search('[a-zA-Z]', inputWords) is None):
#using subprocess to call the sox recording software with a configuration to trim silence from the recording and stop recording when the speaker has finished
subprocess.call(['rec rec.wav rate 32k silence 1 0.1 2% 1 1.0 2%'], shell=True)
#subprocess.call(['rec rec.wav rate 32k silence 1 0.1 2% 1 1.0 2%'], shell=True)
subprocess.call(['arecord --device=plughw:1,0 -d 6 -f cd -t wav rec.wav'], shell=True)
resp = None
#use the wit.ai class to interface with the API and send off the wav file from above for STT functions
with open('rec.wav', 'rb') as f:
Expand Down

0 comments on commit d0e4bb0

Please sign in to comment.