-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
Description
Hi All,
I am trying the run the streamingMicRecognize function in recognize.js.
Whenever I run this on my raspberry pi (with a usb mic (that works with arecord)) the recording stream end immediately.
Here is my code (modified slightly)
const streamingMicRecognize = () => {
console.log("Stream");
// console.dir(recognizeStream);
const recognizeStream = speech.createRecognizeStream(config).on('error', console.error).on('data', data => {
console.log('recongizeStream > data');
// record.stop();
playback(data);
process.stdout.write(data.results);
}).on('end', () => {
console.log("end stream")
});
// console.dir(recognizeStream);
record.start({
sampleRateHertz: 16000, threshold: 0,
// Other options, see https://www.npmjs.com/package/node-record-lpcm16#options
verbose: true,
recordProgram: 'rec', // Try also "arecord" or "sox"
silence: '10.0'
}).on('error', console.error).pipe(recognizeStream);
console.log('Listening, press Ctrl+C to stop.');
// [END speech_streaming_mic_recognize]
}
When I run this with verbose mode set to true, I get this
Stream
Recording with sample rate 16000...
Listening, press Ctrl+C to stop.
Recording 5526 bytes
End Recording 91.384ms
end stream
The recording ends before I get a chance to speak. Not sure what could be causing that. If you need any more information, please let me know.
I should also note, that this works perfectly on my mac. Seems to be specific to the pi.
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.