Closed
Description
Hi
I am referring this sample to use the Speech APIs in my React.js application
below is what i am trying to do
import Speech from '@google-cloud/speech';
import record from 'node-record-lpcm16';
const speech = Speech();
const options = {
config: {
// Configure these settings based on the audio you're transcribing
encoding: 'LINEAR16',
sampleRate: 16000
}
};
// Create a recognize stream
const recognizeStream = speech.createRecognizeStream(options)
.on('error', console.error)
.on('data', (data) => process.stdout.write(data.results));
// Start recording and send the microphone input to the Speech API
record.start({ sampleRate: 16000 }).pipe(recognizeStream);
But this fails to instantiate the Speech object
Am i missing something or there is something which is not documented for use in React.js/Angular.js?