lpa
Posts: 3
Joined: Sat Feb 15, 2014 3:59 pm
Location: UK

Speech recognition

Sat Feb 15, 2014 4:17 pm

As part of a larger project focusing on AI systems using the raspberry pi platform I have been working on a speech recognition system in which a user would speak into a microphone and what is said would be displayed on screen.

Unfortunately the program has been unresponsive with the webcam displaying no sign of activity and on
Invalid byte or field list being displayed on screen.

The code for the program is shown below

Code: Select all

#!/bin/bash

echo "Recording... Press Ctrl+C to Stop."
arecord -D "plughw:1,0" -q -f cd -t wav | ffmpeg -loglevel panic -y -i - -ar 16000 -acodec flac file.flac  > /dev/null 2>&1

echo "Processing..."
wget -q -U "Mozilla/5.0" --post-file file.flac --header "Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v1/recognize?lang=en-US&client=chromium"|cut -d\" -f12  >stt.txt

echo -n "You Said: "
cat stt.txt

rm file.flac  > /dev/null 2>&1

chmod +x speech2text.sh
And the webcam I am using for input is a logitech c270.

Any help on resolving this problem would be greatly appreciated

Return to “Python”