Speech

google.cloud.speech.v2. Speech

Represents a Speech

Constructor

new Speech(rpcImpl, requestDelimitedopt, responseDelimitedopt)

Constructs a new Speech service.

Parameters:
Name Type Attributes Default Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean <optional>
false

Whether requests are length-delimited

responseDelimited boolean <optional>
false

Whether responses are length-delimited

Extends

  • $protobuf.rpc.Service

Methods

batchRecognize(request, callback) → {undefined}

Calls BatchRecognize.

Parameters:
Name Type Description
request google.cloud.speech.v2.IBatchRecognizeRequest

BatchRecognizeRequest message or plain object

callback google.cloud.speech.v2.Speech.BatchRecognizeCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

batchRecognize(request) → {Promise.<google.longrunning.Operation>}

Calls BatchRecognize.

Parameters:
Name Type Description
request google.cloud.speech.v2.IBatchRecognizeRequest

BatchRecognizeRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

createCustomClass(request, callback) → {undefined}

Calls CreateCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.ICreateCustomClassRequest

CreateCustomClassRequest message or plain object

callback google.cloud.speech.v2.Speech.CreateCustomClassCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

createCustomClass(request) → {Promise.<google.longrunning.Operation>}

Calls CreateCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.ICreateCustomClassRequest

CreateCustomClassRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

createPhraseSet(request, callback) → {undefined}

Calls CreatePhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.ICreatePhraseSetRequest

CreatePhraseSetRequest message or plain object

callback google.cloud.speech.v2.Speech.CreatePhraseSetCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

createPhraseSet(request) → {Promise.<google.longrunning.Operation>}

Calls CreatePhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.ICreatePhraseSetRequest

CreatePhraseSetRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

createRecognizer(request, callback) → {undefined}

Calls CreateRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.ICreateRecognizerRequest

CreateRecognizerRequest message or plain object

callback google.cloud.speech.v2.Speech.CreateRecognizerCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

createRecognizer(request) → {Promise.<google.longrunning.Operation>}

Calls CreateRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.ICreateRecognizerRequest

CreateRecognizerRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

deleteCustomClass(request, callback) → {undefined}

Calls DeleteCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.IDeleteCustomClassRequest

DeleteCustomClassRequest message or plain object

callback google.cloud.speech.v2.Speech.DeleteCustomClassCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

deleteCustomClass(request) → {Promise.<google.longrunning.Operation>}

Calls DeleteCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.IDeleteCustomClassRequest

DeleteCustomClassRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

deletePhraseSet(request, callback) → {undefined}

Calls DeletePhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.IDeletePhraseSetRequest

DeletePhraseSetRequest message or plain object

callback google.cloud.speech.v2.Speech.DeletePhraseSetCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

deletePhraseSet(request) → {Promise.<google.longrunning.Operation>}

Calls DeletePhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.IDeletePhraseSetRequest

DeletePhraseSetRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

deleteRecognizer(request, callback) → {undefined}

Calls DeleteRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.IDeleteRecognizerRequest

DeleteRecognizerRequest message or plain object

callback google.cloud.speech.v2.Speech.DeleteRecognizerCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

deleteRecognizer(request) → {Promise.<google.longrunning.Operation>}

Calls DeleteRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.IDeleteRecognizerRequest

DeleteRecognizerRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

getConfig(request, callback) → {undefined}

Calls GetConfig.

Parameters:
Name Type Description
request google.cloud.speech.v2.IGetConfigRequest

GetConfigRequest message or plain object

callback google.cloud.speech.v2.Speech.GetConfigCallback

Node-style callback called with the error, if any, and Config

Returns:
Type Description
undefined

getConfig(request) → {Promise.<google.cloud.speech.v2.Config>}

Calls GetConfig.

Parameters:
Name Type Description
request google.cloud.speech.v2.IGetConfigRequest

GetConfigRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.Config>

Promise

getCustomClass(request, callback) → {undefined}

Calls GetCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.IGetCustomClassRequest

GetCustomClassRequest message or plain object

callback google.cloud.speech.v2.Speech.GetCustomClassCallback

Node-style callback called with the error, if any, and CustomClass

Returns:
Type Description
undefined

getCustomClass(request) → {Promise.<google.cloud.speech.v2.CustomClass>}

Calls GetCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.IGetCustomClassRequest

GetCustomClassRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.CustomClass>

Promise

getPhraseSet(request, callback) → {undefined}

Calls GetPhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.IGetPhraseSetRequest

GetPhraseSetRequest message or plain object

callback google.cloud.speech.v2.Speech.GetPhraseSetCallback

Node-style callback called with the error, if any, and PhraseSet

Returns:
Type Description
undefined

getPhraseSet(request) → {Promise.<google.cloud.speech.v2.PhraseSet>}

Calls GetPhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.IGetPhraseSetRequest

GetPhraseSetRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.PhraseSet>

Promise

getRecognizer(request, callback) → {undefined}

Calls GetRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.IGetRecognizerRequest

GetRecognizerRequest message or plain object

callback google.cloud.speech.v2.Speech.GetRecognizerCallback

Node-style callback called with the error, if any, and Recognizer

Returns:
Type Description
undefined

getRecognizer(request) → {Promise.<google.cloud.speech.v2.Recognizer>}

Calls GetRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.IGetRecognizerRequest

GetRecognizerRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.Recognizer>

Promise

listCustomClasses(request, callback) → {undefined}

Calls ListCustomClasses.

Parameters:
Name Type Description
request google.cloud.speech.v2.IListCustomClassesRequest

ListCustomClassesRequest message or plain object

callback google.cloud.speech.v2.Speech.ListCustomClassesCallback

Node-style callback called with the error, if any, and ListCustomClassesResponse

Returns:
Type Description
undefined

listCustomClasses(request) → {Promise.<google.cloud.speech.v2.ListCustomClassesResponse>}

Calls ListCustomClasses.

Parameters:
Name Type Description
request google.cloud.speech.v2.IListCustomClassesRequest

ListCustomClassesRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.ListCustomClassesResponse>

Promise

listPhraseSets(request, callback) → {undefined}

Calls ListPhraseSets.

Parameters:
Name Type Description
request google.cloud.speech.v2.IListPhraseSetsRequest

ListPhraseSetsRequest message or plain object

callback google.cloud.speech.v2.Speech.ListPhraseSetsCallback

Node-style callback called with the error, if any, and ListPhraseSetsResponse

Returns:
Type Description
undefined

listPhraseSets(request) → {Promise.<google.cloud.speech.v2.ListPhraseSetsResponse>}

Calls ListPhraseSets.

Parameters:
Name Type Description
request google.cloud.speech.v2.IListPhraseSetsRequest

ListPhraseSetsRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.ListPhraseSetsResponse>

Promise

listRecognizers(request, callback) → {undefined}

Calls ListRecognizers.

Parameters:
Name Type Description
request google.cloud.speech.v2.IListRecognizersRequest

ListRecognizersRequest message or plain object

callback google.cloud.speech.v2.Speech.ListRecognizersCallback

Node-style callback called with the error, if any, and ListRecognizersResponse

Returns:
Type Description
undefined

listRecognizers(request) → {Promise.<google.cloud.speech.v2.ListRecognizersResponse>}

Calls ListRecognizers.

Parameters:
Name Type Description
request google.cloud.speech.v2.IListRecognizersRequest

ListRecognizersRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.ListRecognizersResponse>

Promise

recognize(request, callback) → {undefined}

Calls Recognize.

Parameters:
Name Type Description
request google.cloud.speech.v2.IRecognizeRequest

RecognizeRequest message or plain object

callback google.cloud.speech.v2.Speech.RecognizeCallback

Node-style callback called with the error, if any, and RecognizeResponse

Returns:
Type Description
undefined

recognize(request) → {Promise.<google.cloud.speech.v2.RecognizeResponse>}

Calls Recognize.

Parameters:
Name Type Description
request google.cloud.speech.v2.IRecognizeRequest

RecognizeRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.RecognizeResponse>

Promise

streamingRecognize(request, callback) → {undefined}

Calls StreamingRecognize.

Parameters:
Name Type Description
request google.cloud.speech.v2.IStreamingRecognizeRequest

StreamingRecognizeRequest message or plain object

callback google.cloud.speech.v2.Speech.StreamingRecognizeCallback

Node-style callback called with the error, if any, and StreamingRecognizeResponse

Returns:
Type Description
undefined

streamingRecognize(request) → {Promise.<google.cloud.speech.v2.StreamingRecognizeResponse>}

Calls StreamingRecognize.

Parameters:
Name Type Description
request google.cloud.speech.v2.IStreamingRecognizeRequest

StreamingRecognizeRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.StreamingRecognizeResponse>

Promise

undeleteCustomClass(request, callback) → {undefined}

Calls UndeleteCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUndeleteCustomClassRequest

UndeleteCustomClassRequest message or plain object

callback google.cloud.speech.v2.Speech.UndeleteCustomClassCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

undeleteCustomClass(request) → {Promise.<google.longrunning.Operation>}

Calls UndeleteCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUndeleteCustomClassRequest

UndeleteCustomClassRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

undeletePhraseSet(request, callback) → {undefined}

Calls UndeletePhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUndeletePhraseSetRequest

UndeletePhraseSetRequest message or plain object

callback google.cloud.speech.v2.Speech.UndeletePhraseSetCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

undeletePhraseSet(request) → {Promise.<google.longrunning.Operation>}

Calls UndeletePhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUndeletePhraseSetRequest

UndeletePhraseSetRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

undeleteRecognizer(request, callback) → {undefined}

Calls UndeleteRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUndeleteRecognizerRequest

UndeleteRecognizerRequest message or plain object

callback google.cloud.speech.v2.Speech.UndeleteRecognizerCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

undeleteRecognizer(request) → {Promise.<google.longrunning.Operation>}

Calls UndeleteRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUndeleteRecognizerRequest

UndeleteRecognizerRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

updateConfig(request, callback) → {undefined}

Calls UpdateConfig.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUpdateConfigRequest

UpdateConfigRequest message or plain object

callback google.cloud.speech.v2.Speech.UpdateConfigCallback

Node-style callback called with the error, if any, and Config

Returns:
Type Description
undefined

updateConfig(request) → {Promise.<google.cloud.speech.v2.Config>}

Calls UpdateConfig.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUpdateConfigRequest

UpdateConfigRequest message or plain object

Returns:
Type Description
Promise.<google.cloud.speech.v2.Config>

Promise

updateCustomClass(request, callback) → {undefined}

Calls UpdateCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUpdateCustomClassRequest

UpdateCustomClassRequest message or plain object

callback google.cloud.speech.v2.Speech.UpdateCustomClassCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

updateCustomClass(request) → {Promise.<google.longrunning.Operation>}

Calls UpdateCustomClass.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUpdateCustomClassRequest

UpdateCustomClassRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

updatePhraseSet(request, callback) → {undefined}

Calls UpdatePhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUpdatePhraseSetRequest

UpdatePhraseSetRequest message or plain object

callback google.cloud.speech.v2.Speech.UpdatePhraseSetCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

updatePhraseSet(request) → {Promise.<google.longrunning.Operation>}

Calls UpdatePhraseSet.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUpdatePhraseSetRequest

UpdatePhraseSetRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

updateRecognizer(request, callback) → {undefined}

Calls UpdateRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUpdateRecognizerRequest

UpdateRecognizerRequest message or plain object

callback google.cloud.speech.v2.Speech.UpdateRecognizerCallback

Node-style callback called with the error, if any, and Operation

Returns:
Type Description
undefined

updateRecognizer(request) → {Promise.<google.longrunning.Operation>}

Calls UpdateRecognizer.

Parameters:
Name Type Description
request google.cloud.speech.v2.IUpdateRecognizerRequest

UpdateRecognizerRequest message or plain object

Returns:
Type Description
Promise.<google.longrunning.Operation>

Promise

(static) create(rpcImpl, requestDelimitedopt, responseDelimitedopt) → {Speech}

Creates new Speech service using the specified rpc implementation.

Parameters:
Name Type Attributes Default Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean <optional>
false

Whether requests are length-delimited

responseDelimited boolean <optional>
false

Whether responses are length-delimited

Returns:
Type Description
Speech

RPC service. Useful where requests and/or responses are streamed.

Type Definitions

BatchRecognizeCallback(error, responseopt)

Callback as used by batchRecognize.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

CreateCustomClassCallback(error, responseopt)

Callback as used by createCustomClass.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

CreatePhraseSetCallback(error, responseopt)

Callback as used by createPhraseSet.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

CreateRecognizerCallback(error, responseopt)

Callback as used by createRecognizer.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

DeleteCustomClassCallback(error, responseopt)

Callback as used by deleteCustomClass.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

DeletePhraseSetCallback(error, responseopt)

Callback as used by deletePhraseSet.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

DeleteRecognizerCallback(error, responseopt)

Callback as used by deleteRecognizer.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

GetConfigCallback(error, responseopt)

Callback as used by getConfig.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.Config <optional>

Config

GetCustomClassCallback(error, responseopt)

Callback as used by getCustomClass.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.CustomClass <optional>

CustomClass

GetPhraseSetCallback(error, responseopt)

Callback as used by getPhraseSet.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.PhraseSet <optional>

PhraseSet

GetRecognizerCallback(error, responseopt)

Callback as used by getRecognizer.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.Recognizer <optional>

Recognizer

ListCustomClassesCallback(error, responseopt)

Callback as used by listCustomClasses.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.ListCustomClassesResponse <optional>

ListCustomClassesResponse

ListPhraseSetsCallback(error, responseopt)

Callback as used by listPhraseSets.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.ListPhraseSetsResponse <optional>

ListPhraseSetsResponse

ListRecognizersCallback(error, responseopt)

Callback as used by listRecognizers.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.ListRecognizersResponse <optional>

ListRecognizersResponse

RecognizeCallback(error, responseopt)

Callback as used by recognize.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.RecognizeResponse <optional>

RecognizeResponse

StreamingRecognizeCallback(error, responseopt)

Callback as used by streamingRecognize.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.StreamingRecognizeResponse <optional>

StreamingRecognizeResponse

UndeleteCustomClassCallback(error, responseopt)

Callback as used by undeleteCustomClass.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

UndeletePhraseSetCallback(error, responseopt)

Callback as used by undeletePhraseSet.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

UndeleteRecognizerCallback(error, responseopt)

Callback as used by undeleteRecognizer.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

UpdateConfigCallback(error, responseopt)

Callback as used by updateConfig.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.speech.v2.Config <optional>

Config

UpdateCustomClassCallback(error, responseopt)

Callback as used by updateCustomClass.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

UpdatePhraseSetCallback(error, responseopt)

Callback as used by updatePhraseSet.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

UpdateRecognizerCallback(error, responseopt)

Callback as used by updateRecognizer.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation