Skip to content

Commit d0e4bb0

Browse files
committed
updated recording method
1 parent b3de399 commit d0e4bb0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: speech_in.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def listen():
1010
inputWords = ""
1111
while (re.search('[a-zA-Z]', inputWords) is None):
1212
#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
13-
subprocess.call(['rec rec.wav rate 32k silence 1 0.1 2% 1 1.0 2%'], shell=True)
13+
#subprocess.call(['rec rec.wav rate 32k silence 1 0.1 2% 1 1.0 2%'], shell=True)
14+
subprocess.call(['arecord --device=plughw:1,0 -d 6 -f cd -t wav rec.wav'], shell=True)
1415
resp = None
1516
#use the wit.ai class to interface with the API and send off the wav file from above for STT functions
1617
with open('rec.wav', 'rb') as f:

0 commit comments

Comments
 (0)