Sample Header Ad - 728x90

arecord until sound level drops low enough

2 votes
0 answers
559 views
I am trying to implement constant voice recognition on my Pi at the moment, I am achieving this by having two threads running, one constantly recording (with arecord in a bash script) for X amount of seconds, saving that information to a WAV and then restarting, each time this WAV is written the other thread performs the recognition on the WAV file. This is working pretty well, however if by chance the users sentence gets cut off and started again in the next loop of recording, the sentence becomes fragmented between two recognition results. My question is: Is there a way to ensure arecord will record until the sound level drops below a certain threshold, so that the entire sentence will be captured on the recording and then once the user has stopped speaking for a few seconds, the recording will stop? (I am using Python for all this btw) Also if there is a better way of solving this problem, I'm open to suggestions, I'm relatively new to Pi, so not very well versed in all the wonderful things it can achieve.
Asked by Aphire (131 rep)
Jan 21, 2015, 04:04 PM
Last activity: Jan 21, 2015, 10:51 PM