Skip to content

Google Speach API- @google-cloud/[email protected] failing on specifying the SpeechContext in the speech request config #2231

Closed

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
})

Activity

  1. stephenplusplus commented on Apr 18, 2017

    @stephenplusplus
    Contributor

    Try speechContexts. Did you find this sample code somewhere?

  2. stephenplusplus commented on Apr 18, 2017

    @stephenplusplus
    Contributor
  3. stephenplusplus commented on Apr 18, 2017

    @stephenplusplus
    Contributor

    Going to close because of the other issue, but let me know if you're still having problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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