Skip to content

Not able to import in React.js | Not sure if browser support is available as no documentation about it #280

@gajendra93

Description

@gajendra93

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚨This issue needs some love.triage meI really want to be triaged.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions