Method: speech.syncrecognize

Performs synchronous speech recognition: receive results after all audio has been sent and processed.

HTTP request

POST https://speech-to-text.googleapis.com/v1beta1/speech-to-text:syncrecognize

The URL uses Google API HTTP annotation syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "config": {
    object(RecognitionConfig)
  },
  "audio": {
    object(RecognitionAudio)
  },
}
Fields
config

object(RecognitionConfig)

[Required] The config message provides information to the recognizer that specifies how to process the request.

audio

object(RecognitionAudio)

[Required] The audio data to be recognized.

Response body

If successful, the response body contains data with the following structure:

SyncRecognizeResponse is the only message returned to the client by speech.syncrecognize. It contains the result as zero or more sequential SpeechRecognitionResult messages.

JSON representation
{
  "results": [
    {
      object(SpeechRecognitionResult)
    }
  ],
}
Fields
results[]

object(SpeechRecognitionResult)

[Output-only] Sequential list of transcription results corresponding to sequential portions of audio.

Authorization

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

SpeechRecognitionResult

A speech recognition result corresponding to a portion of the audio.

JSON representation
{
  "alternatives": [
    {
      object(SpeechRecognitionAlternative)
    }
  ],
}
Fields
alternatives[]

object(SpeechRecognitionAlternative)

[Output-only] May contain one or more recognition hypotheses (up to the maximum specified in maxAlternatives).

SpeechRecognitionAlternative

Alternative hypotheses (a.k.a. n-best list).

JSON representation
{
  "transcript": string,
  "confidence": number,
}
Fields
transcript

string

[Output-only] Transcript text representing the words that the user spoke.

confidence

number

[Output-only] The confidence estimate between 0.0 and 1.0. A higher number means the system is more confident that the recognition is correct. This field is typically provided only for the top hypothesis, and only for isFinal=true results. The default of 0.0 is a sentinel value indicating confidence was not set.

Try it!

このページは役立ちましたか?評価をお願いいたします。

フィードバックを送信...