Skip to content

Google Speach API- @google-cloud/speech@0.9.0 failing on specifying the SpeechContext in the speech request config #2231

@nandums

Description

@nandums

Speech API is failing on specifying the SpeechContext in the speech request config, see the below error

Error: .google.cloud.speech.v1.RecognitionConfig#speechContext is not a field: undefined
at Error (native)
at MessagePrototype.set (C:\test-google-asr\node_modules\protobufjs\dist\protobuf.js:2490:35)
at MessagePrototype.set (C:\test-google-asr\node_modules\protobufjs\dist\protobuf.js:2483:38)
at Message (C:\test-google-asr\node_modules\protobufjs\dist\protobuf.js:2411:34)
at Element.ProtoBuf.Reflect.ElementPrototype.verifyValue (C:\test-google-asr\node_modules\protobufjs\dist\protobuf.js:1925:28)
at T.ProtoBuf.Reflect.FieldPrototype.verifyValue (C:\test-google-asr\node_modules\protobufjs\dist\protobuf.js:3499:33)
at MessagePrototype.set (C:\test-google-asr\node_modules\protobufjs\dist\protobuf.js:2493:59)
at MessagePrototype.set (C:\test-google-asr\node_modules\protobufjs\dist\protobuf.js:2483:38)
at Message (C:\test-google-asr\node_modules\protobufjs\dist\protobuf.js:2411:34)
at Element.ProtoBuf.Reflect.ElementPrototype.verifyValue (C:\test-google-asr\node_modules\protobufjs\dist\protobuf.js:1925:28)

Environment details

  • OS: Windows 7
  • Node.js version: v6.7.0
  • npm version: 3.10.3
  • google-cloud/speech: 0.9.0

Steps to reproduce

Run the example code with the below configuration

speechClient.createRecognizeStream({
	config: {
		encoding: 'LINEAR16',
		//sampleRate: 16000,
		sampleRateHertz: 16000,
		maxAlternatives: 2,
		languageCode:"en-US",
		speechContext: {
			phrases: [
				"testing"
			]
		}
	},
	singleUtterance: false,
	interimResults: false
})

Metadata

Metadata

Labels

api: speechIssues related to the Speech-to-Text API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions