speech - ActiveState ActiveGo 1.8
...

Package speech

import "google.golang.org/genproto/googleapis/cloud/speech/v1"
Overview
Index

Overview ▾

Package speech is a generated protocol buffer package.

It is generated from these files:

google/cloud/speech/v1/cloud_speech.proto

It has these top-level messages:

RecognizeRequest
LongRunningRecognizeRequest
StreamingRecognizeRequest
StreamingRecognitionConfig
RecognitionConfig
SpeechContext
RecognitionAudio
RecognizeResponse
LongRunningRecognizeResponse
LongRunningRecognizeMetadata
StreamingRecognizeResponse
StreamingRecognitionResult
SpeechRecognitionResult
SpeechRecognitionAlternative

Index ▾

Variables
func RegisterSpeechServer(s *grpc.Server, srv SpeechServer)
type LongRunningRecognizeMetadata
    func (*LongRunningRecognizeMetadata) Descriptor() ([]byte, []int)
    func (m *LongRunningRecognizeMetadata) GetLastUpdateTime() *google_protobuf4.Timestamp
    func (m *LongRunningRecognizeMetadata) GetProgressPercent() int32
    func (m *LongRunningRecognizeMetadata) GetStartTime() *google_protobuf4.Timestamp
    func (*LongRunningRecognizeMetadata) ProtoMessage()
    func (m *LongRunningRecognizeMetadata) Reset()
    func (m *LongRunningRecognizeMetadata) String() string
type LongRunningRecognizeRequest
    func (*LongRunningRecognizeRequest) Descriptor() ([]byte, []int)
    func (m *LongRunningRecognizeRequest) GetAudio() *RecognitionAudio
    func (m *LongRunningRecognizeRequest) GetConfig() *RecognitionConfig
    func (*LongRunningRecognizeRequest) ProtoMessage()
    func (m *LongRunningRecognizeRequest) Reset()
    func (m *LongRunningRecognizeRequest) String() string
type LongRunningRecognizeResponse
    func (*LongRunningRecognizeResponse) Descriptor() ([]byte, []int)
    func (m *LongRunningRecognizeResponse) GetResults() []*SpeechRecognitionResult
    func (*LongRunningRecognizeResponse) ProtoMessage()
    func (m *LongRunningRecognizeResponse) Reset()
    func (m *LongRunningRecognizeResponse) String() string
type RecognitionAudio
    func (*RecognitionAudio) Descriptor() ([]byte, []int)
    func (m *RecognitionAudio) GetAudioSource() isRecognitionAudio_AudioSource
    func (m *RecognitionAudio) GetContent() []byte
    func (m *RecognitionAudio) GetUri() string
    func (*RecognitionAudio) ProtoMessage()
    func (m *RecognitionAudio) Reset()
    func (m *RecognitionAudio) String() string
    func (*RecognitionAudio) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
type RecognitionAudio_Content
type RecognitionAudio_Uri
type RecognitionConfig
    func (*RecognitionConfig) Descriptor() ([]byte, []int)
    func (m *RecognitionConfig) GetEncoding() RecognitionConfig_AudioEncoding
    func (m *RecognitionConfig) GetLanguageCode() string
    func (m *RecognitionConfig) GetMaxAlternatives() int32
    func (m *RecognitionConfig) GetProfanityFilter() bool
    func (m *RecognitionConfig) GetSampleRateHertz() int32
    func (m *RecognitionConfig) GetSpeechContexts() []*SpeechContext
    func (*RecognitionConfig) ProtoMessage()
    func (m *RecognitionConfig) Reset()
    func (m *RecognitionConfig) String() string
type RecognitionConfig_AudioEncoding
    func (RecognitionConfig_AudioEncoding) EnumDescriptor() ([]byte, []int)
    func (x RecognitionConfig_AudioEncoding) String() string
type RecognizeRequest
    func (*RecognizeRequest) Descriptor() ([]byte, []int)
    func (m *RecognizeRequest) GetAudio() *RecognitionAudio
    func (m *RecognizeRequest) GetConfig() *RecognitionConfig
    func (*RecognizeRequest) ProtoMessage()
    func (m *RecognizeRequest) Reset()
    func (m *RecognizeRequest) String() string
type RecognizeResponse
    func (*RecognizeResponse) Descriptor() ([]byte, []int)
    func (m *RecognizeResponse) GetResults() []*SpeechRecognitionResult
    func (*RecognizeResponse) ProtoMessage()
    func (m *RecognizeResponse) Reset()
    func (m *RecognizeResponse) String() string
type SpeechClient
    func NewSpeechClient(cc *grpc.ClientConn) SpeechClient
type SpeechContext
    func (*SpeechContext) Descriptor() ([]byte, []int)
    func (m *SpeechContext) GetPhrases() []string
    func (*SpeechContext) ProtoMessage()
    func (m *SpeechContext) Reset()
    func (m *SpeechContext) String() string
type SpeechRecognitionAlternative
    func (*SpeechRecognitionAlternative) Descriptor() ([]byte, []int)
    func (m *SpeechRecognitionAlternative) GetConfidence() float32
    func (m *SpeechRecognitionAlternative) GetTranscript() string
    func (*SpeechRecognitionAlternative) ProtoMessage()
    func (m *SpeechRecognitionAlternative) Reset()
    func (m *SpeechRecognitionAlternative) String() string
type SpeechRecognitionResult
    func (*SpeechRecognitionResult) Descriptor() ([]byte, []int)
    func (m *SpeechRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative
    func (*SpeechRecognitionResult) ProtoMessage()
    func (m *SpeechRecognitionResult) Reset()
    func (m *SpeechRecognitionResult) String() string
type SpeechServer
type Speech_StreamingRecognizeClient
type Speech_StreamingRecognizeServer
type StreamingRecognitionConfig
    func (*StreamingRecognitionConfig) Descriptor() ([]byte, []int)
    func (m *StreamingRecognitionConfig) GetConfig() *RecognitionConfig
    func (m *StreamingRecognitionConfig) GetInterimResults() bool
    func (m *StreamingRecognitionConfig) GetSingleUtterance() bool
    func (*StreamingRecognitionConfig) ProtoMessage()
    func (m *StreamingRecognitionConfig) Reset()
    func (m *StreamingRecognitionConfig) String() string
type StreamingRecognitionResult
    func (*StreamingRecognitionResult) Descriptor() ([]byte, []int)
    func (m *StreamingRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative
    func (m *StreamingRecognitionResult) GetIsFinal() bool
    func (m *StreamingRecognitionResult) GetStability() float32
    func (*StreamingRecognitionResult) ProtoMessage()
    func (m *StreamingRecognitionResult) Reset()
    func (m *StreamingRecognitionResult) String() string
type StreamingRecognizeRequest
    func (*StreamingRecognizeRequest) Descriptor() ([]byte, []int)
    func (m *StreamingRecognizeRequest) GetAudioContent() []byte
    func (m *StreamingRecognizeRequest) GetStreamingConfig() *StreamingRecognitionConfig
    func (m *StreamingRecognizeRequest) GetStreamingRequest() isStreamingRecognizeRequest_StreamingRequest
    func (*StreamingRecognizeRequest) ProtoMessage()
    func (m *StreamingRecognizeRequest) Reset()
    func (m *StreamingRecognizeRequest) String() string
    func (*StreamingRecognizeRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
type StreamingRecognizeRequest_AudioContent
type StreamingRecognizeRequest_StreamingConfig
type StreamingRecognizeResponse
    func (*StreamingRecognizeResponse) Descriptor() ([]byte, []int)
    func (m *StreamingRecognizeResponse) GetError() *google_rpc.Status
    func (m *StreamingRecognizeResponse) GetResults() []*StreamingRecognitionResult
    func (m *StreamingRecognizeResponse) GetSpeechEventType() StreamingRecognizeResponse_SpeechEventType
    func (*StreamingRecognizeResponse) ProtoMessage()
    func (m *StreamingRecognizeResponse) Reset()
    func (m *StreamingRecognizeResponse) String() string
type StreamingRecognizeResponse_SpeechEventType
    func (StreamingRecognizeResponse_SpeechEventType) EnumDescriptor() ([]byte, []int)
    func (x StreamingRecognizeResponse_SpeechEventType) String() string

Package files

cloud_speech.pb.go

Variables

var RecognitionConfig_AudioEncoding_name = map[int32]string{
    0: "ENCODING_UNSPECIFIED",
    1: "LINEAR16",
    2: "FLAC",
    3: "MULAW",
    4: "AMR",
    5: "AMR_WB",
    6: "OGG_OPUS",
    7: "SPEEX_WITH_HEADER_BYTE",
}
var RecognitionConfig_AudioEncoding_value = map[string]int32{
    "ENCODING_UNSPECIFIED":   0,
    "LINEAR16":               1,
    "FLAC":                   2,
    "MULAW":                  3,
    "AMR":                    4,
    "AMR_WB":                 5,
    "OGG_OPUS":               6,
    "SPEEX_WITH_HEADER_BYTE": 7,
}
var StreamingRecognizeResponse_SpeechEventType_name = map[int32]string{
    0: "SPEECH_EVENT_UNSPECIFIED",
    1: "END_OF_SINGLE_UTTERANCE",
}
var StreamingRecognizeResponse_SpeechEventType_value = map[string]int32{
    "SPEECH_EVENT_UNSPECIFIED": 0,
    "END_OF_SINGLE_UTTERANCE":  1,
}

func RegisterSpeechServer

func RegisterSpeechServer(s *grpc.Server, srv SpeechServer)

type LongRunningRecognizeMetadata

Describes the progress of a long-running `LongRunningRecognize` call. It is included in the `metadata` field of the `Operation` returned by the `GetOperation` call of the `google::longrunning::Operations` service.

type LongRunningRecognizeMetadata struct {
    // Approximate percentage of audio processed thus far. Guaranteed to be 100
    // when the audio is fully processed and the results are available.
    ProgressPercent int32 `protobuf:"varint,1,opt,name=progress_percent,json=progressPercent" json:"progress_percent,omitempty"`
    // Time when the request was received.
    StartTime *google_protobuf4.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"`
    // Time of the most recent processing update.
    LastUpdateTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"`
}

func (*LongRunningRecognizeMetadata) Descriptor

func (*LongRunningRecognizeMetadata) Descriptor() ([]byte, []int)

func (*LongRunningRecognizeMetadata) GetLastUpdateTime

func (m *LongRunningRecognizeMetadata) GetLastUpdateTime() *google_protobuf4.Timestamp

func (*LongRunningRecognizeMetadata) GetProgressPercent

func (m *LongRunningRecognizeMetadata) GetProgressPercent() int32

func (*LongRunningRecognizeMetadata) GetStartTime

func (m *LongRunningRecognizeMetadata) GetStartTime() *google_protobuf4.Timestamp

func (*LongRunningRecognizeMetadata) ProtoMessage

func (*LongRunningRecognizeMetadata) ProtoMessage()

func (*LongRunningRecognizeMetadata) Reset

func (m *LongRunningRecognizeMetadata) Reset()

func (*LongRunningRecognizeMetadata) String

func (m *LongRunningRecognizeMetadata) String() string

type LongRunningRecognizeRequest

The top-level message sent by the client for the `LongRunningRecognize` method.

type LongRunningRecognizeRequest struct {
    // *Required* Provides information to the recognizer that specifies how to
    // process the request.
    Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"`
    // *Required* The audio data to be recognized.
    Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"`
}

func (*LongRunningRecognizeRequest) Descriptor

func (*LongRunningRecognizeRequest) Descriptor() ([]byte, []int)

func (*LongRunningRecognizeRequest) GetAudio

func (m *LongRunningRecognizeRequest) GetAudio() *RecognitionAudio

func (*LongRunningRecognizeRequest) GetConfig

func (m *LongRunningRecognizeRequest) GetConfig() *RecognitionConfig

func (*LongRunningRecognizeRequest) ProtoMessage

func (*LongRunningRecognizeRequest) ProtoMessage()

func (*LongRunningRecognizeRequest) Reset

func (m *LongRunningRecognizeRequest) Reset()

func (*LongRunningRecognizeRequest) String

func (m *LongRunningRecognizeRequest) String() string

type LongRunningRecognizeResponse

The only message returned to the client by the `LongRunningRecognize` method. It contains the result as zero or more sequential `SpeechRecognitionResult` messages. It is included in the `result.response` field of the `Operation` returned by the `GetOperation` call of the `google::longrunning::Operations` service.

type LongRunningRecognizeResponse struct {
    // *Output-only* Sequential list of transcription results corresponding to
    // sequential portions of audio.
    Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"`
}

func (*LongRunningRecognizeResponse) Descriptor

func (*LongRunningRecognizeResponse) Descriptor() ([]byte, []int)

func (*LongRunningRecognizeResponse) GetResults

func (m *LongRunningRecognizeResponse) GetResults() []*SpeechRecognitionResult

func (*LongRunningRecognizeResponse) ProtoMessage

func (*LongRunningRecognizeResponse) ProtoMessage()

func (*LongRunningRecognizeResponse) Reset

func (m *LongRunningRecognizeResponse) Reset()

func (*LongRunningRecognizeResponse) String

func (m *LongRunningRecognizeResponse) String() string

type RecognitionAudio

Contains audio data in the encoding specified in the `RecognitionConfig`. Either `content` or `uri` must be supplied. Supplying both or neither returns [google.rpc.Code.INVALID_ARGUMENT][]. See [audio limits](https://cloud.google.com/speech/limits#content).

type RecognitionAudio struct {
    // Types that are valid to be assigned to AudioSource:
    //	*RecognitionAudio_Content
    //	*RecognitionAudio_Uri
    AudioSource isRecognitionAudio_AudioSource `protobuf_oneof:"audio_source"`
}

func (*RecognitionAudio) Descriptor

func (*RecognitionAudio) Descriptor() ([]byte, []int)

func (*RecognitionAudio) GetAudioSource

func (m *RecognitionAudio) GetAudioSource() isRecognitionAudio_AudioSource

func (*RecognitionAudio) GetContent

func (m *RecognitionAudio) GetContent() []byte

func (*RecognitionAudio) GetUri

func (m *RecognitionAudio) GetUri() string

func (*RecognitionAudio) ProtoMessage

func (*RecognitionAudio) ProtoMessage()

func (*RecognitionAudio) Reset

func (m *RecognitionAudio) Reset()

func (*RecognitionAudio) String

func (m *RecognitionAudio) String() string

func (*RecognitionAudio) XXX_OneofFuncs

func (*RecognitionAudio) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type RecognitionAudio_Content

type RecognitionAudio_Content struct {
    Content []byte `protobuf:"bytes,1,opt,name=content,proto3,oneof"`
}

type RecognitionAudio_Uri

type RecognitionAudio_Uri struct {
    Uri string `protobuf:"bytes,2,opt,name=uri,oneof"`
}

type RecognitionConfig

Provides information to the recognizer that specifies how to process the request.

type RecognitionConfig struct {
    // *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
    Encoding RecognitionConfig_AudioEncoding `protobuf:"varint,1,opt,name=encoding,enum=google.cloud.speech.v1.RecognitionConfig_AudioEncoding" json:"encoding,omitempty"`
    // *Required* Sample rate in Hertz of the audio data sent in all
    // `RecognitionAudio` messages. Valid values are: 8000-48000.
    // 16000 is optimal. For best results, set the sampling rate of the audio
    // source to 16000 Hz. If that's not possible, use the native sample rate of
    // the audio source (instead of re-sampling).
    SampleRateHertz int32 `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz" json:"sample_rate_hertz,omitempty"`
    // *Required* The language of the supplied audio as a
    // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
    // Example: "en-US".
    // See [Language Support](https://cloud.google.com/speech/docs/languages)
    // for a list of the currently supported language codes.
    LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"`
    // *Optional* Maximum number of recognition hypotheses to be returned.
    // Specifically, the maximum number of `SpeechRecognitionAlternative` messages
    // within each `SpeechRecognitionResult`.
    // The server may return fewer than `max_alternatives`.
    // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
    // one. If omitted, will return a maximum of one.
    MaxAlternatives int32 `protobuf:"varint,4,opt,name=max_alternatives,json=maxAlternatives" json:"max_alternatives,omitempty"`
    // *Optional* If set to `true`, the server will attempt to filter out
    // profanities, replacing all but the initial character in each filtered word
    // with asterisks, e.g. "f***". If set to `false` or omitted, profanities
    // won't be filtered out.
    ProfanityFilter bool `protobuf:"varint,5,opt,name=profanity_filter,json=profanityFilter" json:"profanity_filter,omitempty"`
    // *Optional* A means to provide context to assist the speech recognition.
    SpeechContexts []*SpeechContext `protobuf:"bytes,6,rep,name=speech_contexts,json=speechContexts" json:"speech_contexts,omitempty"`
}

func (*RecognitionConfig) Descriptor

func (*RecognitionConfig) Descriptor() ([]byte, []int)

func (*RecognitionConfig) GetEncoding

func (m *RecognitionConfig) GetEncoding() RecognitionConfig_AudioEncoding

func (*RecognitionConfig) GetLanguageCode

func (m *RecognitionConfig) GetLanguageCode() string

func (*RecognitionConfig) GetMaxAlternatives

func (m *RecognitionConfig) GetMaxAlternatives() int32

func (*RecognitionConfig) GetProfanityFilter

func (m *RecognitionConfig) GetProfanityFilter() bool

func (*RecognitionConfig) GetSampleRateHertz

func (m *RecognitionConfig) GetSampleRateHertz() int32

func (*RecognitionConfig) GetSpeechContexts

func (m *RecognitionConfig) GetSpeechContexts() []*SpeechContext

func (*RecognitionConfig) ProtoMessage

func (*RecognitionConfig) ProtoMessage()

func (*RecognitionConfig) Reset

func (m *RecognitionConfig) Reset()

func (*RecognitionConfig) String

func (m *RecognitionConfig) String() string

type RecognitionConfig_AudioEncoding

Audio encoding of the data sent in the audio message. All encodings support only 1 channel (mono) audio. Only `FLAC` includes a header that describes the bytes of audio that follow the header. The other encodings are raw audio bytes with no header.

For best results, the audio source should be captured and transmitted using a lossless encoding (`FLAC` or `LINEAR16`). Recognition accuracy may be reduced if lossy codecs, which include the other codecs listed in this section, are used to capture or transmit the audio, particularly if background noise is present.

type RecognitionConfig_AudioEncoding int32
const (
    // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
    RecognitionConfig_ENCODING_UNSPECIFIED RecognitionConfig_AudioEncoding = 0
    // Uncompressed 16-bit signed little-endian samples (Linear PCM).
    RecognitionConfig_LINEAR16 RecognitionConfig_AudioEncoding = 1
    // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
    // Codec) is the recommended encoding because it is
    // lossless--therefore recognition is not compromised--and
    // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
    // encoding supports 16-bit and 24-bit samples, however, not all fields in
    // `STREAMINFO` are supported.
    RecognitionConfig_FLAC RecognitionConfig_AudioEncoding = 2
    // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
    RecognitionConfig_MULAW RecognitionConfig_AudioEncoding = 3
    // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
    RecognitionConfig_AMR RecognitionConfig_AudioEncoding = 4
    // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
    RecognitionConfig_AMR_WB RecognitionConfig_AudioEncoding = 5
    // Opus encoded audio frames in Ogg container
    // ([OggOpus](https://wiki.xiph.org/OggOpus)).
    // `sample_rate_hertz` must be 16000.
    RecognitionConfig_OGG_OPUS RecognitionConfig_AudioEncoding = 6
    // Although the use of lossy encodings is not recommended, if a very low
    // bitrate encoding is required, `OGG_OPUS` is highly preferred over
    // Speex encoding. The [Speex](https://speex.org/)  encoding supported by
    // Cloud Speech API has a header byte in each block, as in MIME type
    // `audio/x-speex-with-header-byte`.
    // It is a variant of the RTP Speex encoding defined in
    // [RFC 5574](https://tools.ietf.org/html/rfc5574).
    // The stream is a sequence of blocks, one block per RTP packet. Each block
    // starts with a byte containing the length of the block, in bytes, followed
    // by one or more frames of Speex data, padded to an integral number of
    // bytes (octets) as specified in RFC 5574. In other words, each RTP header
    // is replaced with a single byte containing the block length. Only Speex
    // wideband is supported. `sample_rate_hertz` must be 16000.
    RecognitionConfig_SPEEX_WITH_HEADER_BYTE RecognitionConfig_AudioEncoding = 7
)

func (RecognitionConfig_AudioEncoding) EnumDescriptor

func (RecognitionConfig_AudioEncoding) EnumDescriptor() ([]byte, []int)

func (RecognitionConfig_AudioEncoding) String

func (x RecognitionConfig_AudioEncoding) String() string

type RecognizeRequest

The top-level message sent by the client for the `Recognize` method.

type RecognizeRequest struct {
    // *Required* Provides information to the recognizer that specifies how to
    // process the request.
    Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"`
    // *Required* The audio data to be recognized.
    Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"`
}

func (*RecognizeRequest) Descriptor

func (*RecognizeRequest) Descriptor() ([]byte, []int)

func (*RecognizeRequest) GetAudio

func (m *RecognizeRequest) GetAudio() *RecognitionAudio

func (*RecognizeRequest) GetConfig

func (m *RecognizeRequest) GetConfig() *RecognitionConfig

func (*RecognizeRequest) ProtoMessage

func (*RecognizeRequest) ProtoMessage()

func (*RecognizeRequest) Reset

func (m *RecognizeRequest) Reset()

func (*RecognizeRequest) String

func (m *RecognizeRequest) String() string

type RecognizeResponse

The only message returned to the client by the `Recognize` method. It contains the result as zero or more sequential `SpeechRecognitionResult` messages.

type RecognizeResponse struct {
    // *Output-only* Sequential list of transcription results corresponding to
    // sequential portions of audio.
    Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"`
}

func (*RecognizeResponse) Descriptor

func (*RecognizeResponse) Descriptor() ([]byte, []int)

func (*RecognizeResponse) GetResults

func (m *RecognizeResponse) GetResults() []*SpeechRecognitionResult

func (*RecognizeResponse) ProtoMessage

func (*RecognizeResponse) ProtoMessage()

func (*RecognizeResponse) Reset

func (m *RecognizeResponse) Reset()

func (*RecognizeResponse) String

func (m *RecognizeResponse) String() string

type SpeechClient

type SpeechClient interface {
    // Performs synchronous speech recognition: receive results after all audio
    // has been sent and processed.
    Recognize(ctx context.Context, in *RecognizeRequest, opts ...grpc.CallOption) (*RecognizeResponse, error)
    // Performs asynchronous speech recognition: receive results via the
    // google.longrunning.Operations interface. Returns either an
    // `Operation.error` or an `Operation.response` which contains
    // a `LongRunningRecognizeResponse` message.
    LongRunningRecognize(ctx context.Context, in *LongRunningRecognizeRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error)
    // Performs bidirectional streaming speech recognition: receive results while
    // sending audio. This method is only available via the gRPC API (not REST).
    StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error)
}

func NewSpeechClient

func NewSpeechClient(cc *grpc.ClientConn) SpeechClient

type SpeechContext

Provides "hints" to the speech recognizer to favor specific words and phrases in the results.

type SpeechContext struct {
    // *Optional* A list of strings containing words and phrases "hints" so that
    // the speech recognition is more likely to recognize them. This can be used
    // to improve the accuracy for specific words and phrases, for example, if
    // specific commands are typically spoken by the user. This can also be used
    // to add additional words to the vocabulary of the recognizer. See
    // [usage limits](https://cloud.google.com/speech/limits#content).
    Phrases []string `protobuf:"bytes,1,rep,name=phrases" json:"phrases,omitempty"`
}

func (*SpeechContext) Descriptor

func (*SpeechContext) Descriptor() ([]byte, []int)

func (*SpeechContext) GetPhrases

func (m *SpeechContext) GetPhrases() []string

func (*SpeechContext) ProtoMessage

func (*SpeechContext) ProtoMessage()

func (*SpeechContext) Reset

func (m *SpeechContext) Reset()

func (*SpeechContext) String

func (m *SpeechContext) String() string

type SpeechRecognitionAlternative

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

type SpeechRecognitionAlternative struct {
    // *Output-only* Transcript text representing the words that the user spoke.
    Transcript string `protobuf:"bytes,1,opt,name=transcript" json:"transcript,omitempty"`
    // *Output-only* The confidence estimate between 0.0 and 1.0. A higher number
    // indicates an estimated greater likelihood that the recognized words are
    // correct. This field is typically provided only for the top hypothesis, and
    // only for `is_final=true` results. Clients should not rely on the
    // `confidence` field as it is not guaranteed to be accurate, or even set, in
    // any of the results.
    // The default of 0.0 is a sentinel value indicating `confidence` was not set.
    Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"`
}

func (*SpeechRecognitionAlternative) Descriptor

func (*SpeechRecognitionAlternative) Descriptor() ([]byte, []int)

func (*SpeechRecognitionAlternative) GetConfidence

func (m *SpeechRecognitionAlternative) GetConfidence() float32

func (*SpeechRecognitionAlternative) GetTranscript

func (m *SpeechRecognitionAlternative) GetTranscript() string

func (*SpeechRecognitionAlternative) ProtoMessage

func (*SpeechRecognitionAlternative) ProtoMessage()

func (*SpeechRecognitionAlternative) Reset

func (m *SpeechRecognitionAlternative) Reset()

func (*SpeechRecognitionAlternative) String

func (m *SpeechRecognitionAlternative) String() string

type SpeechRecognitionResult

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

type SpeechRecognitionResult struct {
    // *Output-only* May contain one or more recognition hypotheses (up to the
    // maximum specified in `max_alternatives`).
    Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"`
}

func (*SpeechRecognitionResult) Descriptor

func (*SpeechRecognitionResult) Descriptor() ([]byte, []int)

func (*SpeechRecognitionResult) GetAlternatives

func (m *SpeechRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative

func (*SpeechRecognitionResult) ProtoMessage

func (*SpeechRecognitionResult) ProtoMessage()

func (*SpeechRecognitionResult) Reset

func (m *SpeechRecognitionResult) Reset()

func (*SpeechRecognitionResult) String

func (m *SpeechRecognitionResult) String() string

type SpeechServer

type SpeechServer interface {
    // Performs synchronous speech recognition: receive results after all audio
    // has been sent and processed.
    Recognize(context.Context, *RecognizeRequest) (*RecognizeResponse, error)
    // Performs asynchronous speech recognition: receive results via the
    // google.longrunning.Operations interface. Returns either an
    // `Operation.error` or an `Operation.response` which contains
    // a `LongRunningRecognizeResponse` message.
    LongRunningRecognize(context.Context, *LongRunningRecognizeRequest) (*google_longrunning.Operation, error)
    // Performs bidirectional streaming speech recognition: receive results while
    // sending audio. This method is only available via the gRPC API (not REST).
    StreamingRecognize(Speech_StreamingRecognizeServer) error
}

type Speech_StreamingRecognizeClient

type Speech_StreamingRecognizeClient interface {
    Send(*StreamingRecognizeRequest) error
    Recv() (*StreamingRecognizeResponse, error)
    grpc.ClientStream
}

type Speech_StreamingRecognizeServer

type Speech_StreamingRecognizeServer interface {
    Send(*StreamingRecognizeResponse) error
    Recv() (*StreamingRecognizeRequest, error)
    grpc.ServerStream
}

type StreamingRecognitionConfig

Provides information to the recognizer that specifies how to process the request.

type StreamingRecognitionConfig struct {
    // *Required* Provides information to the recognizer that specifies how to
    // process the request.
    Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"`
    // *Optional* If `false` or omitted, the recognizer will perform continuous
    // recognition (continuing to wait for and process audio even if the user
    // pauses speaking) until the client closes the input stream (gRPC API) or
    // until the maximum time limit has been reached. May return multiple
    // `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
    //
    // If `true`, the recognizer will detect a single spoken utterance. When it
    // detects that the user has paused or stopped speaking, it will return an
    // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
    // more than one `StreamingRecognitionResult` with the `is_final` flag set to
    // `true`.
    SingleUtterance bool `protobuf:"varint,2,opt,name=single_utterance,json=singleUtterance" json:"single_utterance,omitempty"`
    // *Optional* If `true`, interim results (tentative hypotheses) may be
    // returned as they become available (these interim results are indicated with
    // the `is_final=false` flag).
    // If `false` or omitted, only `is_final=true` result(s) are returned.
    InterimResults bool `protobuf:"varint,3,opt,name=interim_results,json=interimResults" json:"interim_results,omitempty"`
}

func (*StreamingRecognitionConfig) Descriptor

func (*StreamingRecognitionConfig) Descriptor() ([]byte, []int)

func (*StreamingRecognitionConfig) GetConfig

func (m *StreamingRecognitionConfig) GetConfig() *RecognitionConfig

func (*StreamingRecognitionConfig) GetInterimResults

func (m *StreamingRecognitionConfig) GetInterimResults() bool

func (*StreamingRecognitionConfig) GetSingleUtterance

func (m *StreamingRecognitionConfig) GetSingleUtterance() bool

func (*StreamingRecognitionConfig) ProtoMessage

func (*StreamingRecognitionConfig) ProtoMessage()

func (*StreamingRecognitionConfig) Reset

func (m *StreamingRecognitionConfig) Reset()

func (*StreamingRecognitionConfig) String

func (m *StreamingRecognitionConfig) String() string

type StreamingRecognitionResult

A streaming speech recognition result corresponding to a portion of the audio that is currently being processed.

type StreamingRecognitionResult struct {
    // *Output-only* May contain one or more recognition hypotheses (up to the
    // maximum specified in `max_alternatives`).
    Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"`
    // *Output-only* If `false`, this `StreamingRecognitionResult` represents an
    // interim result that may change. If `true`, this is the final time the
    // speech service will return this particular `StreamingRecognitionResult`,
    // the recognizer will not return any further hypotheses for this portion of
    // the transcript and corresponding audio.
    IsFinal bool `protobuf:"varint,2,opt,name=is_final,json=isFinal" json:"is_final,omitempty"`
    // *Output-only* An estimate of the likelihood that the recognizer will not
    // change its guess about this interim result. Values range from 0.0
    // (completely unstable) to 1.0 (completely stable).
    // This field is only provided for interim results (`is_final=false`).
    // The default of 0.0 is a sentinel value indicating `stability` was not set.
    Stability float32 `protobuf:"fixed32,3,opt,name=stability" json:"stability,omitempty"`
}

func (*StreamingRecognitionResult) Descriptor

func (*StreamingRecognitionResult) Descriptor() ([]byte, []int)

func (*StreamingRecognitionResult) GetAlternatives

func (m *StreamingRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative

func (*StreamingRecognitionResult) GetIsFinal

func (m *StreamingRecognitionResult) GetIsFinal() bool

func (*StreamingRecognitionResult) GetStability

func (m *StreamingRecognitionResult) GetStability() float32

func (*StreamingRecognitionResult) ProtoMessage

func (*StreamingRecognitionResult) ProtoMessage()

func (*StreamingRecognitionResult) Reset

func (m *StreamingRecognitionResult) Reset()

func (*StreamingRecognitionResult) String

func (m *StreamingRecognitionResult) String() string

type StreamingRecognizeRequest

The top-level message sent by the client for the `StreamingRecognize` method. Multiple `StreamingRecognizeRequest` messages are sent. The first message must contain a `streaming_config` message and must not contain `audio` data. All subsequent messages must contain `audio` data and must not contain a `streaming_config` message.

type StreamingRecognizeRequest struct {
    // Types that are valid to be assigned to StreamingRequest:
    //	*StreamingRecognizeRequest_StreamingConfig
    //	*StreamingRecognizeRequest_AudioContent
    StreamingRequest isStreamingRecognizeRequest_StreamingRequest `protobuf_oneof:"streaming_request"`
}

func (*StreamingRecognizeRequest) Descriptor

func (*StreamingRecognizeRequest) Descriptor() ([]byte, []int)

func (*StreamingRecognizeRequest) GetAudioContent

func (m *StreamingRecognizeRequest) GetAudioContent() []byte

func (*StreamingRecognizeRequest) GetStreamingConfig

func (m *StreamingRecognizeRequest) GetStreamingConfig() *StreamingRecognitionConfig

func (*StreamingRecognizeRequest) GetStreamingRequest

func (m *StreamingRecognizeRequest) GetStreamingRequest() isStreamingRecognizeRequest_StreamingRequest

func (*StreamingRecognizeRequest) ProtoMessage

func (*StreamingRecognizeRequest) ProtoMessage()

func (*StreamingRecognizeRequest) Reset

func (m *StreamingRecognizeRequest) Reset()

func (*StreamingRecognizeRequest) String

func (m *StreamingRecognizeRequest) String() string

func (*StreamingRecognizeRequest) XXX_OneofFuncs

func (*StreamingRecognizeRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type StreamingRecognizeRequest_AudioContent

type StreamingRecognizeRequest_AudioContent struct {
    AudioContent []byte `protobuf:"bytes,2,opt,name=audio_content,json=audioContent,proto3,oneof"`
}

type StreamingRecognizeRequest_StreamingConfig

type StreamingRecognizeRequest_StreamingConfig struct {
    StreamingConfig *StreamingRecognitionConfig `protobuf:"bytes,1,opt,name=streaming_config,json=streamingConfig,oneof"`
}

type StreamingRecognizeResponse

`StreamingRecognizeResponse` is the only message returned to the client by `StreamingRecognize`. A series of one or more `StreamingRecognizeResponse` messages are streamed back to the client.

Here's an example of a series of ten `StreamingRecognizeResponse`s that might be returned while processing audio:

1. results { alternatives { transcript: "tube" } stability: 0.01 }

2. results { alternatives { transcript: "to be a" } stability: 0.01 }

3. results { alternatives { transcript: "to be" } stability: 0.9 }

results { alternatives { transcript: " or not to be" } stability: 0.01 }

4. results { alternatives { transcript: "to be or not to be"

               confidence: 0.92 }
alternatives { transcript: "to bee or not to bee" }
is_final: true }

5. results { alternatives { transcript: " that's" } stability: 0.01 }

6. results { alternatives { transcript: " that is" } stability: 0.9 }

results { alternatives { transcript: " the question" } stability: 0.01 }

7. speech_event_type: END_OF_SINGLE_UTTERANCE

8. results { alternatives { transcript: " that is the question"

               confidence: 0.98 }
alternatives { transcript: " that was the question" }
is_final: true }

Notes:

- Only two of the above responses #4 and #8 contain final results; they are

indicated by `is_final: true`. Concatenating these together generates the
full transcript: "to be or not to be that is the question".

- The others contain interim `results`. #3 and #6 contain two interim

`results`: the first portion has a high stability and is less likely to
change; the second portion has a low stability and is very likely to
change. A UI designer might choose to show only high stability `results`.

- The specific `stability` and `confidence` values shown above are only for

illustrative purposes. Actual values may vary.

- In each response, only one of these fields will be set:

`error`,
`speech_event_type`, or
one or more (repeated) `results`.
type StreamingRecognizeResponse struct {
    // *Output-only* If set, returns a [google.rpc.Status][] message that
    // specifies the error for the operation.
    Error *google_rpc.Status `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
    // *Output-only* This repeated list contains zero or more results that
    // correspond to consecutive portions of the audio currently being processed.
    // It contains zero or one `is_final=true` result (the newly settled portion),
    // followed by zero or more `is_final=false` results.
    Results []*StreamingRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"`
    // *Output-only* Indicates the type of speech event.
    SpeechEventType StreamingRecognizeResponse_SpeechEventType `protobuf:"varint,4,opt,name=speech_event_type,json=speechEventType,enum=google.cloud.speech.v1.StreamingRecognizeResponse_SpeechEventType" json:"speech_event_type,omitempty"`
}

func (*StreamingRecognizeResponse) Descriptor

func (*StreamingRecognizeResponse) Descriptor() ([]byte, []int)

func (*StreamingRecognizeResponse) GetError

func (m *StreamingRecognizeResponse) GetError() *google_rpc.Status

func (*StreamingRecognizeResponse) GetResults

func (m *StreamingRecognizeResponse) GetResults() []*StreamingRecognitionResult

func (*StreamingRecognizeResponse) GetSpeechEventType

func (m *StreamingRecognizeResponse) GetSpeechEventType() StreamingRecognizeResponse_SpeechEventType

func (*StreamingRecognizeResponse) ProtoMessage

func (*StreamingRecognizeResponse) ProtoMessage()

func (*StreamingRecognizeResponse) Reset

func (m *StreamingRecognizeResponse) Reset()

func (*StreamingRecognizeResponse) String

func (m *StreamingRecognizeResponse) String() string

type StreamingRecognizeResponse_SpeechEventType

Indicates the type of speech event.

type StreamingRecognizeResponse_SpeechEventType int32
const (
    // No speech event specified.
    StreamingRecognizeResponse_SPEECH_EVENT_UNSPECIFIED StreamingRecognizeResponse_SpeechEventType = 0
    // This event indicates that the server has detected the end of the user's
    // speech utterance and expects no additional speech. Therefore, the server
    // will not process additional audio (although it may subsequently return
    // additional results). The client should stop sending additional audio
    // data, half-close the gRPC connection, and wait for any additional results
    // until the server closes the gRPC connection. This event is only sent if
    // `single_utterance` was set to `true`, and is not used otherwise.
    StreamingRecognizeResponse_END_OF_SINGLE_UTTERANCE StreamingRecognizeResponse_SpeechEventType = 1
)

func (StreamingRecognizeResponse_SpeechEventType) EnumDescriptor

func (StreamingRecognizeResponse_SpeechEventType) EnumDescriptor() ([]byte, []int)

func (StreamingRecognizeResponse_SpeechEventType) String

func (x StreamingRecognizeResponse_SpeechEventType) String() string