mirror of
https://github.com/genuinetools/reg.git
synced 2024-08-21 06:10:23 -04:00
1484 lines
64 KiB
Go
1484 lines
64 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: google/cloud/speech/v1beta1/cloud_speech.proto
|
|
|
|
package speech // import "google.golang.org/genproto/googleapis/cloud/speech/v1beta1"
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import _ "github.com/golang/protobuf/ptypes/duration"
|
|
import timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
|
import _ "google.golang.org/genproto/googleapis/api/annotations"
|
|
import longrunning "google.golang.org/genproto/googleapis/longrunning"
|
|
import status "google.golang.org/genproto/googleapis/rpc/status"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
// 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 (such as AMR, AMR_WB and MULAW) 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][google.rpc.Code.INVALID_ARGUMENT].
|
|
RecognitionConfig_ENCODING_UNSPECIFIED RecognitionConfig_AudioEncoding = 0
|
|
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
|
|
// This is the only encoding that may be used by `AsyncRecognize`.
|
|
RecognitionConfig_LINEAR16 RecognitionConfig_AudioEncoding = 1
|
|
// This is the recommended encoding for `SyncRecognize` and
|
|
// `StreamingRecognize` because it uses lossless compression; therefore
|
|
// recognition accuracy is not compromised by a lossy codec.
|
|
//
|
|
// The stream FLAC (Free Lossless Audio Codec) encoding is specified at:
|
|
// http://flac.sourceforge.net/documentation.html.
|
|
// 16-bit and 24-bit samples are supported.
|
|
// 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` must be 8000 Hz.
|
|
RecognitionConfig_AMR RecognitionConfig_AudioEncoding = 4
|
|
// Adaptive Multi-Rate Wideband codec. `sample_rate` must be 16000 Hz.
|
|
RecognitionConfig_AMR_WB RecognitionConfig_AudioEncoding = 5
|
|
)
|
|
|
|
var RecognitionConfig_AudioEncoding_name = map[int32]string{
|
|
0: "ENCODING_UNSPECIFIED",
|
|
1: "LINEAR16",
|
|
2: "FLAC",
|
|
3: "MULAW",
|
|
4: "AMR",
|
|
5: "AMR_WB",
|
|
}
|
|
var RecognitionConfig_AudioEncoding_value = map[string]int32{
|
|
"ENCODING_UNSPECIFIED": 0,
|
|
"LINEAR16": 1,
|
|
"FLAC": 2,
|
|
"MULAW": 3,
|
|
"AMR": 4,
|
|
"AMR_WB": 5,
|
|
}
|
|
|
|
func (x RecognitionConfig_AudioEncoding) String() string {
|
|
return proto.EnumName(RecognitionConfig_AudioEncoding_name, int32(x))
|
|
}
|
|
func (RecognitionConfig_AudioEncoding) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{4, 0}
|
|
}
|
|
|
|
// Indicates the type of endpointer event.
|
|
type StreamingRecognizeResponse_EndpointerType int32
|
|
|
|
const (
|
|
// No endpointer event specified.
|
|
StreamingRecognizeResponse_ENDPOINTER_EVENT_UNSPECIFIED StreamingRecognizeResponse_EndpointerType = 0
|
|
// Speech has been detected in the audio stream, and the service is
|
|
// beginning to process it.
|
|
StreamingRecognizeResponse_START_OF_SPEECH StreamingRecognizeResponse_EndpointerType = 1
|
|
// Speech has ceased to be detected in the audio stream. (For example, the
|
|
// user may have paused after speaking.) If `single_utterance` is `false`,
|
|
// the service will continue to process audio, and if subsequent speech is
|
|
// detected, will send another START_OF_SPEECH event.
|
|
StreamingRecognizeResponse_END_OF_SPEECH StreamingRecognizeResponse_EndpointerType = 2
|
|
// This event is sent after the client has half-closed the input stream gRPC
|
|
// connection and the server has received all of the audio. (The server may
|
|
// still be processing the audio and may subsequently return additional
|
|
// results.)
|
|
StreamingRecognizeResponse_END_OF_AUDIO StreamingRecognizeResponse_EndpointerType = 3
|
|
// This event is only sent when `single_utterance` is `true`. It 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.
|
|
StreamingRecognizeResponse_END_OF_UTTERANCE StreamingRecognizeResponse_EndpointerType = 4
|
|
)
|
|
|
|
var StreamingRecognizeResponse_EndpointerType_name = map[int32]string{
|
|
0: "ENDPOINTER_EVENT_UNSPECIFIED",
|
|
1: "START_OF_SPEECH",
|
|
2: "END_OF_SPEECH",
|
|
3: "END_OF_AUDIO",
|
|
4: "END_OF_UTTERANCE",
|
|
}
|
|
var StreamingRecognizeResponse_EndpointerType_value = map[string]int32{
|
|
"ENDPOINTER_EVENT_UNSPECIFIED": 0,
|
|
"START_OF_SPEECH": 1,
|
|
"END_OF_SPEECH": 2,
|
|
"END_OF_AUDIO": 3,
|
|
"END_OF_UTTERANCE": 4,
|
|
}
|
|
|
|
func (x StreamingRecognizeResponse_EndpointerType) String() string {
|
|
return proto.EnumName(StreamingRecognizeResponse_EndpointerType_name, int32(x))
|
|
}
|
|
func (StreamingRecognizeResponse_EndpointerType) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{10, 0}
|
|
}
|
|
|
|
// The top-level message sent by the client for the `SyncRecognize` method.
|
|
type SyncRecognizeRequest struct {
|
|
// *Required* Provides information to the recognizer that specifies how to
|
|
// process the request.
|
|
Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
|
|
// *Required* The audio data to be recognized.
|
|
Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio,proto3" json:"audio,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *SyncRecognizeRequest) Reset() { *m = SyncRecognizeRequest{} }
|
|
func (m *SyncRecognizeRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*SyncRecognizeRequest) ProtoMessage() {}
|
|
func (*SyncRecognizeRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{0}
|
|
}
|
|
func (m *SyncRecognizeRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_SyncRecognizeRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *SyncRecognizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_SyncRecognizeRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *SyncRecognizeRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SyncRecognizeRequest.Merge(dst, src)
|
|
}
|
|
func (m *SyncRecognizeRequest) XXX_Size() int {
|
|
return xxx_messageInfo_SyncRecognizeRequest.Size(m)
|
|
}
|
|
func (m *SyncRecognizeRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SyncRecognizeRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SyncRecognizeRequest proto.InternalMessageInfo
|
|
|
|
func (m *SyncRecognizeRequest) GetConfig() *RecognitionConfig {
|
|
if m != nil {
|
|
return m.Config
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *SyncRecognizeRequest) GetAudio() *RecognitionAudio {
|
|
if m != nil {
|
|
return m.Audio
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// The top-level message sent by the client for the `AsyncRecognize` method.
|
|
type AsyncRecognizeRequest struct {
|
|
// *Required* Provides information to the recognizer that specifies how to
|
|
// process the request.
|
|
Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
|
|
// *Required* The audio data to be recognized.
|
|
Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio,proto3" json:"audio,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *AsyncRecognizeRequest) Reset() { *m = AsyncRecognizeRequest{} }
|
|
func (m *AsyncRecognizeRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*AsyncRecognizeRequest) ProtoMessage() {}
|
|
func (*AsyncRecognizeRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{1}
|
|
}
|
|
func (m *AsyncRecognizeRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_AsyncRecognizeRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *AsyncRecognizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_AsyncRecognizeRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *AsyncRecognizeRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_AsyncRecognizeRequest.Merge(dst, src)
|
|
}
|
|
func (m *AsyncRecognizeRequest) XXX_Size() int {
|
|
return xxx_messageInfo_AsyncRecognizeRequest.Size(m)
|
|
}
|
|
func (m *AsyncRecognizeRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_AsyncRecognizeRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_AsyncRecognizeRequest proto.InternalMessageInfo
|
|
|
|
func (m *AsyncRecognizeRequest) GetConfig() *RecognitionConfig {
|
|
if m != nil {
|
|
return m.Config
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *AsyncRecognizeRequest) GetAudio() *RecognitionAudio {
|
|
if m != nil {
|
|
return m.Audio
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// 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 {
|
|
// The streaming request, which is either a streaming config or audio content.
|
|
//
|
|
// Types that are valid to be assigned to StreamingRequest:
|
|
// *StreamingRecognizeRequest_StreamingConfig
|
|
// *StreamingRecognizeRequest_AudioContent
|
|
StreamingRequest isStreamingRecognizeRequest_StreamingRequest `protobuf_oneof:"streaming_request"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *StreamingRecognizeRequest) Reset() { *m = StreamingRecognizeRequest{} }
|
|
func (m *StreamingRecognizeRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*StreamingRecognizeRequest) ProtoMessage() {}
|
|
func (*StreamingRecognizeRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{2}
|
|
}
|
|
func (m *StreamingRecognizeRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_StreamingRecognizeRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *StreamingRecognizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_StreamingRecognizeRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *StreamingRecognizeRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_StreamingRecognizeRequest.Merge(dst, src)
|
|
}
|
|
func (m *StreamingRecognizeRequest) XXX_Size() int {
|
|
return xxx_messageInfo_StreamingRecognizeRequest.Size(m)
|
|
}
|
|
func (m *StreamingRecognizeRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_StreamingRecognizeRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_StreamingRecognizeRequest proto.InternalMessageInfo
|
|
|
|
type isStreamingRecognizeRequest_StreamingRequest interface {
|
|
isStreamingRecognizeRequest_StreamingRequest()
|
|
}
|
|
|
|
type StreamingRecognizeRequest_StreamingConfig struct {
|
|
StreamingConfig *StreamingRecognitionConfig `protobuf:"bytes,1,opt,name=streaming_config,json=streamingConfig,proto3,oneof"`
|
|
}
|
|
type StreamingRecognizeRequest_AudioContent struct {
|
|
AudioContent []byte `protobuf:"bytes,2,opt,name=audio_content,json=audioContent,proto3,oneof"`
|
|
}
|
|
|
|
func (*StreamingRecognizeRequest_StreamingConfig) isStreamingRecognizeRequest_StreamingRequest() {}
|
|
func (*StreamingRecognizeRequest_AudioContent) isStreamingRecognizeRequest_StreamingRequest() {}
|
|
|
|
func (m *StreamingRecognizeRequest) GetStreamingRequest() isStreamingRecognizeRequest_StreamingRequest {
|
|
if m != nil {
|
|
return m.StreamingRequest
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *StreamingRecognizeRequest) GetStreamingConfig() *StreamingRecognitionConfig {
|
|
if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_StreamingConfig); ok {
|
|
return x.StreamingConfig
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *StreamingRecognizeRequest) GetAudioContent() []byte {
|
|
if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_AudioContent); ok {
|
|
return x.AudioContent
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
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{}) {
|
|
return _StreamingRecognizeRequest_OneofMarshaler, _StreamingRecognizeRequest_OneofUnmarshaler, _StreamingRecognizeRequest_OneofSizer, []interface{}{
|
|
(*StreamingRecognizeRequest_StreamingConfig)(nil),
|
|
(*StreamingRecognizeRequest_AudioContent)(nil),
|
|
}
|
|
}
|
|
|
|
func _StreamingRecognizeRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*StreamingRecognizeRequest)
|
|
// streaming_request
|
|
switch x := m.StreamingRequest.(type) {
|
|
case *StreamingRecognizeRequest_StreamingConfig:
|
|
b.EncodeVarint(1<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.StreamingConfig); err != nil {
|
|
return err
|
|
}
|
|
case *StreamingRecognizeRequest_AudioContent:
|
|
b.EncodeVarint(2<<3 | proto.WireBytes)
|
|
b.EncodeRawBytes(x.AudioContent)
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("StreamingRecognizeRequest.StreamingRequest has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _StreamingRecognizeRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*StreamingRecognizeRequest)
|
|
switch tag {
|
|
case 1: // streaming_request.streaming_config
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(StreamingRecognitionConfig)
|
|
err := b.DecodeMessage(msg)
|
|
m.StreamingRequest = &StreamingRecognizeRequest_StreamingConfig{msg}
|
|
return true, err
|
|
case 2: // streaming_request.audio_content
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeRawBytes(true)
|
|
m.StreamingRequest = &StreamingRecognizeRequest_AudioContent{x}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _StreamingRecognizeRequest_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*StreamingRecognizeRequest)
|
|
// streaming_request
|
|
switch x := m.StreamingRequest.(type) {
|
|
case *StreamingRecognizeRequest_StreamingConfig:
|
|
s := proto.Size(x.StreamingConfig)
|
|
n += 1 // tag and wire
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *StreamingRecognizeRequest_AudioContent:
|
|
n += 1 // tag and wire
|
|
n += proto.SizeVarint(uint64(len(x.AudioContent)))
|
|
n += len(x.AudioContent)
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
// 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,proto3" 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_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,proto3" 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,proto3" json:"interim_results,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *StreamingRecognitionConfig) Reset() { *m = StreamingRecognitionConfig{} }
|
|
func (m *StreamingRecognitionConfig) String() string { return proto.CompactTextString(m) }
|
|
func (*StreamingRecognitionConfig) ProtoMessage() {}
|
|
func (*StreamingRecognitionConfig) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{3}
|
|
}
|
|
func (m *StreamingRecognitionConfig) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_StreamingRecognitionConfig.Unmarshal(m, b)
|
|
}
|
|
func (m *StreamingRecognitionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_StreamingRecognitionConfig.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *StreamingRecognitionConfig) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_StreamingRecognitionConfig.Merge(dst, src)
|
|
}
|
|
func (m *StreamingRecognitionConfig) XXX_Size() int {
|
|
return xxx_messageInfo_StreamingRecognitionConfig.Size(m)
|
|
}
|
|
func (m *StreamingRecognitionConfig) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_StreamingRecognitionConfig.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_StreamingRecognitionConfig proto.InternalMessageInfo
|
|
|
|
func (m *StreamingRecognitionConfig) GetConfig() *RecognitionConfig {
|
|
if m != nil {
|
|
return m.Config
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *StreamingRecognitionConfig) GetSingleUtterance() bool {
|
|
if m != nil {
|
|
return m.SingleUtterance
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *StreamingRecognitionConfig) GetInterimResults() bool {
|
|
if m != nil {
|
|
return m.InterimResults
|
|
}
|
|
return false
|
|
}
|
|
|
|
// 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,proto3,enum=google.cloud.speech.v1beta1.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).
|
|
SampleRate int32 `protobuf:"varint,2,opt,name=sample_rate,json=sampleRate,proto3" json:"sample_rate,omitempty"`
|
|
// *Optional* The language of the supplied audio as a BCP-47 language tag.
|
|
// Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt
|
|
// If omitted, defaults to "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,proto3" 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,proto3" 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,proto3" json:"profanity_filter,omitempty"`
|
|
// *Optional* A means to provide context to assist the speech recognition.
|
|
SpeechContext *SpeechContext `protobuf:"bytes,6,opt,name=speech_context,json=speechContext,proto3" json:"speech_context,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *RecognitionConfig) Reset() { *m = RecognitionConfig{} }
|
|
func (m *RecognitionConfig) String() string { return proto.CompactTextString(m) }
|
|
func (*RecognitionConfig) ProtoMessage() {}
|
|
func (*RecognitionConfig) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{4}
|
|
}
|
|
func (m *RecognitionConfig) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_RecognitionConfig.Unmarshal(m, b)
|
|
}
|
|
func (m *RecognitionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_RecognitionConfig.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *RecognitionConfig) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_RecognitionConfig.Merge(dst, src)
|
|
}
|
|
func (m *RecognitionConfig) XXX_Size() int {
|
|
return xxx_messageInfo_RecognitionConfig.Size(m)
|
|
}
|
|
func (m *RecognitionConfig) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_RecognitionConfig.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_RecognitionConfig proto.InternalMessageInfo
|
|
|
|
func (m *RecognitionConfig) GetEncoding() RecognitionConfig_AudioEncoding {
|
|
if m != nil {
|
|
return m.Encoding
|
|
}
|
|
return RecognitionConfig_ENCODING_UNSPECIFIED
|
|
}
|
|
|
|
func (m *RecognitionConfig) GetSampleRate() int32 {
|
|
if m != nil {
|
|
return m.SampleRate
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *RecognitionConfig) GetLanguageCode() string {
|
|
if m != nil {
|
|
return m.LanguageCode
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *RecognitionConfig) GetMaxAlternatives() int32 {
|
|
if m != nil {
|
|
return m.MaxAlternatives
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *RecognitionConfig) GetProfanityFilter() bool {
|
|
if m != nil {
|
|
return m.ProfanityFilter
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *RecognitionConfig) GetSpeechContext() *SpeechContext {
|
|
if m != nil {
|
|
return m.SpeechContext
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// 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,proto3" json:"phrases,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *SpeechContext) Reset() { *m = SpeechContext{} }
|
|
func (m *SpeechContext) String() string { return proto.CompactTextString(m) }
|
|
func (*SpeechContext) ProtoMessage() {}
|
|
func (*SpeechContext) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{5}
|
|
}
|
|
func (m *SpeechContext) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_SpeechContext.Unmarshal(m, b)
|
|
}
|
|
func (m *SpeechContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_SpeechContext.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *SpeechContext) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SpeechContext.Merge(dst, src)
|
|
}
|
|
func (m *SpeechContext) XXX_Size() int {
|
|
return xxx_messageInfo_SpeechContext.Size(m)
|
|
}
|
|
func (m *SpeechContext) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SpeechContext.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SpeechContext proto.InternalMessageInfo
|
|
|
|
func (m *SpeechContext) GetPhrases() []string {
|
|
if m != nil {
|
|
return m.Phrases
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// 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][google.rpc.Code.INVALID_ARGUMENT]. See
|
|
// [audio limits](https://cloud.google.com/speech/limits#content).
|
|
type RecognitionAudio struct {
|
|
// The audio source, which is either inline content or a GCS uri.
|
|
//
|
|
// Types that are valid to be assigned to AudioSource:
|
|
// *RecognitionAudio_Content
|
|
// *RecognitionAudio_Uri
|
|
AudioSource isRecognitionAudio_AudioSource `protobuf_oneof:"audio_source"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *RecognitionAudio) Reset() { *m = RecognitionAudio{} }
|
|
func (m *RecognitionAudio) String() string { return proto.CompactTextString(m) }
|
|
func (*RecognitionAudio) ProtoMessage() {}
|
|
func (*RecognitionAudio) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{6}
|
|
}
|
|
func (m *RecognitionAudio) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_RecognitionAudio.Unmarshal(m, b)
|
|
}
|
|
func (m *RecognitionAudio) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_RecognitionAudio.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *RecognitionAudio) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_RecognitionAudio.Merge(dst, src)
|
|
}
|
|
func (m *RecognitionAudio) XXX_Size() int {
|
|
return xxx_messageInfo_RecognitionAudio.Size(m)
|
|
}
|
|
func (m *RecognitionAudio) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_RecognitionAudio.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_RecognitionAudio proto.InternalMessageInfo
|
|
|
|
type isRecognitionAudio_AudioSource interface {
|
|
isRecognitionAudio_AudioSource()
|
|
}
|
|
|
|
type RecognitionAudio_Content struct {
|
|
Content []byte `protobuf:"bytes,1,opt,name=content,proto3,oneof"`
|
|
}
|
|
type RecognitionAudio_Uri struct {
|
|
Uri string `protobuf:"bytes,2,opt,name=uri,proto3,oneof"`
|
|
}
|
|
|
|
func (*RecognitionAudio_Content) isRecognitionAudio_AudioSource() {}
|
|
func (*RecognitionAudio_Uri) isRecognitionAudio_AudioSource() {}
|
|
|
|
func (m *RecognitionAudio) GetAudioSource() isRecognitionAudio_AudioSource {
|
|
if m != nil {
|
|
return m.AudioSource
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RecognitionAudio) GetContent() []byte {
|
|
if x, ok := m.GetAudioSource().(*RecognitionAudio_Content); ok {
|
|
return x.Content
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RecognitionAudio) GetUri() string {
|
|
if x, ok := m.GetAudioSource().(*RecognitionAudio_Uri); ok {
|
|
return x.Uri
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
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{}) {
|
|
return _RecognitionAudio_OneofMarshaler, _RecognitionAudio_OneofUnmarshaler, _RecognitionAudio_OneofSizer, []interface{}{
|
|
(*RecognitionAudio_Content)(nil),
|
|
(*RecognitionAudio_Uri)(nil),
|
|
}
|
|
}
|
|
|
|
func _RecognitionAudio_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*RecognitionAudio)
|
|
// audio_source
|
|
switch x := m.AudioSource.(type) {
|
|
case *RecognitionAudio_Content:
|
|
b.EncodeVarint(1<<3 | proto.WireBytes)
|
|
b.EncodeRawBytes(x.Content)
|
|
case *RecognitionAudio_Uri:
|
|
b.EncodeVarint(2<<3 | proto.WireBytes)
|
|
b.EncodeStringBytes(x.Uri)
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("RecognitionAudio.AudioSource has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _RecognitionAudio_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*RecognitionAudio)
|
|
switch tag {
|
|
case 1: // audio_source.content
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeRawBytes(true)
|
|
m.AudioSource = &RecognitionAudio_Content{x}
|
|
return true, err
|
|
case 2: // audio_source.uri
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeStringBytes()
|
|
m.AudioSource = &RecognitionAudio_Uri{x}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _RecognitionAudio_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*RecognitionAudio)
|
|
// audio_source
|
|
switch x := m.AudioSource.(type) {
|
|
case *RecognitionAudio_Content:
|
|
n += 1 // tag and wire
|
|
n += proto.SizeVarint(uint64(len(x.Content)))
|
|
n += len(x.Content)
|
|
case *RecognitionAudio_Uri:
|
|
n += 1 // tag and wire
|
|
n += proto.SizeVarint(uint64(len(x.Uri)))
|
|
n += len(x.Uri)
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
// The only message returned to the client by `SyncRecognize`. method. It
|
|
// contains the result as zero or more sequential `SpeechRecognitionResult`
|
|
// messages.
|
|
type SyncRecognizeResponse struct {
|
|
// *Output-only* Sequential list of transcription results corresponding to
|
|
// sequential portions of audio.
|
|
Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *SyncRecognizeResponse) Reset() { *m = SyncRecognizeResponse{} }
|
|
func (m *SyncRecognizeResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*SyncRecognizeResponse) ProtoMessage() {}
|
|
func (*SyncRecognizeResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{7}
|
|
}
|
|
func (m *SyncRecognizeResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_SyncRecognizeResponse.Unmarshal(m, b)
|
|
}
|
|
func (m *SyncRecognizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_SyncRecognizeResponse.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *SyncRecognizeResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SyncRecognizeResponse.Merge(dst, src)
|
|
}
|
|
func (m *SyncRecognizeResponse) XXX_Size() int {
|
|
return xxx_messageInfo_SyncRecognizeResponse.Size(m)
|
|
}
|
|
func (m *SyncRecognizeResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SyncRecognizeResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SyncRecognizeResponse proto.InternalMessageInfo
|
|
|
|
func (m *SyncRecognizeResponse) GetResults() []*SpeechRecognitionResult {
|
|
if m != nil {
|
|
return m.Results
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// The only message returned to the client by `AsyncRecognize`. 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 AsyncRecognizeResponse struct {
|
|
// *Output-only* Sequential list of transcription results corresponding to
|
|
// sequential portions of audio.
|
|
Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *AsyncRecognizeResponse) Reset() { *m = AsyncRecognizeResponse{} }
|
|
func (m *AsyncRecognizeResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*AsyncRecognizeResponse) ProtoMessage() {}
|
|
func (*AsyncRecognizeResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{8}
|
|
}
|
|
func (m *AsyncRecognizeResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_AsyncRecognizeResponse.Unmarshal(m, b)
|
|
}
|
|
func (m *AsyncRecognizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_AsyncRecognizeResponse.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *AsyncRecognizeResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_AsyncRecognizeResponse.Merge(dst, src)
|
|
}
|
|
func (m *AsyncRecognizeResponse) XXX_Size() int {
|
|
return xxx_messageInfo_AsyncRecognizeResponse.Size(m)
|
|
}
|
|
func (m *AsyncRecognizeResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_AsyncRecognizeResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_AsyncRecognizeResponse proto.InternalMessageInfo
|
|
|
|
func (m *AsyncRecognizeResponse) GetResults() []*SpeechRecognitionResult {
|
|
if m != nil {
|
|
return m.Results
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Describes the progress of a long-running `AsyncRecognize` call. It is
|
|
// included in the `metadata` field of the `Operation` returned by the
|
|
// `GetOperation` call of the `google::longrunning::Operations` service.
|
|
type AsyncRecognizeMetadata 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,proto3" json:"progress_percent,omitempty"`
|
|
// Time when the request was received.
|
|
StartTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
|
|
// Time of the most recent processing update.
|
|
LastUpdateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime,proto3" json:"last_update_time,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *AsyncRecognizeMetadata) Reset() { *m = AsyncRecognizeMetadata{} }
|
|
func (m *AsyncRecognizeMetadata) String() string { return proto.CompactTextString(m) }
|
|
func (*AsyncRecognizeMetadata) ProtoMessage() {}
|
|
func (*AsyncRecognizeMetadata) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{9}
|
|
}
|
|
func (m *AsyncRecognizeMetadata) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_AsyncRecognizeMetadata.Unmarshal(m, b)
|
|
}
|
|
func (m *AsyncRecognizeMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_AsyncRecognizeMetadata.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *AsyncRecognizeMetadata) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_AsyncRecognizeMetadata.Merge(dst, src)
|
|
}
|
|
func (m *AsyncRecognizeMetadata) XXX_Size() int {
|
|
return xxx_messageInfo_AsyncRecognizeMetadata.Size(m)
|
|
}
|
|
func (m *AsyncRecognizeMetadata) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_AsyncRecognizeMetadata.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_AsyncRecognizeMetadata proto.InternalMessageInfo
|
|
|
|
func (m *AsyncRecognizeMetadata) GetProgressPercent() int32 {
|
|
if m != nil {
|
|
return m.ProgressPercent
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *AsyncRecognizeMetadata) GetStartTime() *timestamp.Timestamp {
|
|
if m != nil {
|
|
return m.StartTime
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *AsyncRecognizeMetadata) GetLastUpdateTime() *timestamp.Timestamp {
|
|
if m != nil {
|
|
return m.LastUpdateTime
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// `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. endpointer_type: START_OF_SPEECH
|
|
//
|
|
// 2. results { alternatives { transcript: "tube" } stability: 0.01 }
|
|
// result_index: 0
|
|
//
|
|
// 3. results { alternatives { transcript: "to be a" } stability: 0.01 }
|
|
// result_index: 0
|
|
//
|
|
// 4. results { alternatives { transcript: "to be" } stability: 0.9 }
|
|
// results { alternatives { transcript: " or not to be" } stability: 0.01 }
|
|
// result_index: 0
|
|
//
|
|
// 5. results { alternatives { transcript: "to be or not to be"
|
|
// confidence: 0.92 }
|
|
// alternatives { transcript: "to bee or not to bee" }
|
|
// is_final: true }
|
|
// result_index: 0
|
|
//
|
|
// 6. results { alternatives { transcript: " that's" } stability: 0.01 }
|
|
// result_index: 1
|
|
//
|
|
// 7. results { alternatives { transcript: " that is" } stability: 0.9 }
|
|
// results { alternatives { transcript: " the question" } stability: 0.01 }
|
|
// result_index: 1
|
|
//
|
|
// 8. endpointer_type: END_OF_SPEECH
|
|
//
|
|
// 9. results { alternatives { transcript: " that is the question"
|
|
// confidence: 0.98 }
|
|
// alternatives { transcript: " that was the question" }
|
|
// is_final: true }
|
|
// result_index: 1
|
|
//
|
|
// 10. endpointer_type: END_OF_AUDIO
|
|
//
|
|
// Notes:
|
|
//
|
|
// - Only two of the above responses #5 and #9 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`. #4 and #7 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.
|
|
//
|
|
// - The `result_index` indicates the portion of audio that has had final
|
|
// results returned, and is no longer being processed. For example, the
|
|
// `results` in #6 and later correspond to the portion of audio after
|
|
// "to be or not to be".
|
|
type StreamingRecognizeResponse struct {
|
|
// *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
|
|
// specifies the error for the operation.
|
|
Error *status.Status `protobuf:"bytes,1,opt,name=error,proto3" 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,proto3" json:"results,omitempty"`
|
|
// *Output-only* Indicates the lowest index in the `results` array that has
|
|
// changed. The repeated `StreamingRecognitionResult` results overwrite past
|
|
// results at this index and higher.
|
|
ResultIndex int32 `protobuf:"varint,3,opt,name=result_index,json=resultIndex,proto3" json:"result_index,omitempty"`
|
|
// *Output-only* Indicates the type of endpointer event.
|
|
EndpointerType StreamingRecognizeResponse_EndpointerType `protobuf:"varint,4,opt,name=endpointer_type,json=endpointerType,proto3,enum=google.cloud.speech.v1beta1.StreamingRecognizeResponse_EndpointerType" json:"endpointer_type,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *StreamingRecognizeResponse) Reset() { *m = StreamingRecognizeResponse{} }
|
|
func (m *StreamingRecognizeResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*StreamingRecognizeResponse) ProtoMessage() {}
|
|
func (*StreamingRecognizeResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{10}
|
|
}
|
|
func (m *StreamingRecognizeResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_StreamingRecognizeResponse.Unmarshal(m, b)
|
|
}
|
|
func (m *StreamingRecognizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_StreamingRecognizeResponse.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *StreamingRecognizeResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_StreamingRecognizeResponse.Merge(dst, src)
|
|
}
|
|
func (m *StreamingRecognizeResponse) XXX_Size() int {
|
|
return xxx_messageInfo_StreamingRecognizeResponse.Size(m)
|
|
}
|
|
func (m *StreamingRecognizeResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_StreamingRecognizeResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_StreamingRecognizeResponse proto.InternalMessageInfo
|
|
|
|
func (m *StreamingRecognizeResponse) GetError() *status.Status {
|
|
if m != nil {
|
|
return m.Error
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *StreamingRecognizeResponse) GetResults() []*StreamingRecognitionResult {
|
|
if m != nil {
|
|
return m.Results
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *StreamingRecognizeResponse) GetResultIndex() int32 {
|
|
if m != nil {
|
|
return m.ResultIndex
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *StreamingRecognizeResponse) GetEndpointerType() StreamingRecognizeResponse_EndpointerType {
|
|
if m != nil {
|
|
return m.EndpointerType
|
|
}
|
|
return StreamingRecognizeResponse_ENDPOINTER_EVENT_UNSPECIFIED
|
|
}
|
|
|
|
// 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,proto3" 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,proto3" 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,proto3" json:"stability,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *StreamingRecognitionResult) Reset() { *m = StreamingRecognitionResult{} }
|
|
func (m *StreamingRecognitionResult) String() string { return proto.CompactTextString(m) }
|
|
func (*StreamingRecognitionResult) ProtoMessage() {}
|
|
func (*StreamingRecognitionResult) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{11}
|
|
}
|
|
func (m *StreamingRecognitionResult) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_StreamingRecognitionResult.Unmarshal(m, b)
|
|
}
|
|
func (m *StreamingRecognitionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_StreamingRecognitionResult.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *StreamingRecognitionResult) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_StreamingRecognitionResult.Merge(dst, src)
|
|
}
|
|
func (m *StreamingRecognitionResult) XXX_Size() int {
|
|
return xxx_messageInfo_StreamingRecognitionResult.Size(m)
|
|
}
|
|
func (m *StreamingRecognitionResult) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_StreamingRecognitionResult.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_StreamingRecognitionResult proto.InternalMessageInfo
|
|
|
|
func (m *StreamingRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative {
|
|
if m != nil {
|
|
return m.Alternatives
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *StreamingRecognitionResult) GetIsFinal() bool {
|
|
if m != nil {
|
|
return m.IsFinal
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *StreamingRecognitionResult) GetStability() float32 {
|
|
if m != nil {
|
|
return m.Stability
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// 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,proto3" json:"alternatives,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *SpeechRecognitionResult) Reset() { *m = SpeechRecognitionResult{} }
|
|
func (m *SpeechRecognitionResult) String() string { return proto.CompactTextString(m) }
|
|
func (*SpeechRecognitionResult) ProtoMessage() {}
|
|
func (*SpeechRecognitionResult) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{12}
|
|
}
|
|
func (m *SpeechRecognitionResult) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_SpeechRecognitionResult.Unmarshal(m, b)
|
|
}
|
|
func (m *SpeechRecognitionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_SpeechRecognitionResult.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *SpeechRecognitionResult) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SpeechRecognitionResult.Merge(dst, src)
|
|
}
|
|
func (m *SpeechRecognitionResult) XXX_Size() int {
|
|
return xxx_messageInfo_SpeechRecognitionResult.Size(m)
|
|
}
|
|
func (m *SpeechRecognitionResult) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SpeechRecognitionResult.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SpeechRecognitionResult proto.InternalMessageInfo
|
|
|
|
func (m *SpeechRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative {
|
|
if m != nil {
|
|
return m.Alternatives
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// 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,proto3" 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,proto3" json:"confidence,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *SpeechRecognitionAlternative) Reset() { *m = SpeechRecognitionAlternative{} }
|
|
func (m *SpeechRecognitionAlternative) String() string { return proto.CompactTextString(m) }
|
|
func (*SpeechRecognitionAlternative) ProtoMessage() {}
|
|
func (*SpeechRecognitionAlternative) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_cloud_speech_8234301300f3be52, []int{13}
|
|
}
|
|
func (m *SpeechRecognitionAlternative) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_SpeechRecognitionAlternative.Unmarshal(m, b)
|
|
}
|
|
func (m *SpeechRecognitionAlternative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_SpeechRecognitionAlternative.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *SpeechRecognitionAlternative) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SpeechRecognitionAlternative.Merge(dst, src)
|
|
}
|
|
func (m *SpeechRecognitionAlternative) XXX_Size() int {
|
|
return xxx_messageInfo_SpeechRecognitionAlternative.Size(m)
|
|
}
|
|
func (m *SpeechRecognitionAlternative) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SpeechRecognitionAlternative.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SpeechRecognitionAlternative proto.InternalMessageInfo
|
|
|
|
func (m *SpeechRecognitionAlternative) GetTranscript() string {
|
|
if m != nil {
|
|
return m.Transcript
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *SpeechRecognitionAlternative) GetConfidence() float32 {
|
|
if m != nil {
|
|
return m.Confidence
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*SyncRecognizeRequest)(nil), "google.cloud.speech.v1beta1.SyncRecognizeRequest")
|
|
proto.RegisterType((*AsyncRecognizeRequest)(nil), "google.cloud.speech.v1beta1.AsyncRecognizeRequest")
|
|
proto.RegisterType((*StreamingRecognizeRequest)(nil), "google.cloud.speech.v1beta1.StreamingRecognizeRequest")
|
|
proto.RegisterType((*StreamingRecognitionConfig)(nil), "google.cloud.speech.v1beta1.StreamingRecognitionConfig")
|
|
proto.RegisterType((*RecognitionConfig)(nil), "google.cloud.speech.v1beta1.RecognitionConfig")
|
|
proto.RegisterType((*SpeechContext)(nil), "google.cloud.speech.v1beta1.SpeechContext")
|
|
proto.RegisterType((*RecognitionAudio)(nil), "google.cloud.speech.v1beta1.RecognitionAudio")
|
|
proto.RegisterType((*SyncRecognizeResponse)(nil), "google.cloud.speech.v1beta1.SyncRecognizeResponse")
|
|
proto.RegisterType((*AsyncRecognizeResponse)(nil), "google.cloud.speech.v1beta1.AsyncRecognizeResponse")
|
|
proto.RegisterType((*AsyncRecognizeMetadata)(nil), "google.cloud.speech.v1beta1.AsyncRecognizeMetadata")
|
|
proto.RegisterType((*StreamingRecognizeResponse)(nil), "google.cloud.speech.v1beta1.StreamingRecognizeResponse")
|
|
proto.RegisterType((*StreamingRecognitionResult)(nil), "google.cloud.speech.v1beta1.StreamingRecognitionResult")
|
|
proto.RegisterType((*SpeechRecognitionResult)(nil), "google.cloud.speech.v1beta1.SpeechRecognitionResult")
|
|
proto.RegisterType((*SpeechRecognitionAlternative)(nil), "google.cloud.speech.v1beta1.SpeechRecognitionAlternative")
|
|
proto.RegisterEnum("google.cloud.speech.v1beta1.RecognitionConfig_AudioEncoding", RecognitionConfig_AudioEncoding_name, RecognitionConfig_AudioEncoding_value)
|
|
proto.RegisterEnum("google.cloud.speech.v1beta1.StreamingRecognizeResponse_EndpointerType", StreamingRecognizeResponse_EndpointerType_name, StreamingRecognizeResponse_EndpointerType_value)
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// SpeechClient is the client API for Speech service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type SpeechClient interface {
|
|
// Performs synchronous speech recognition: receive results after all audio
|
|
// has been sent and processed.
|
|
SyncRecognize(ctx context.Context, in *SyncRecognizeRequest, opts ...grpc.CallOption) (*SyncRecognizeResponse, error)
|
|
// Performs asynchronous speech recognition: receive results via the
|
|
// [google.longrunning.Operations]
|
|
// (/speech/reference/rest/v1beta1/operations#Operation)
|
|
// interface. Returns either an
|
|
// `Operation.error` or an `Operation.response` which contains
|
|
// an `AsyncRecognizeResponse` message.
|
|
AsyncRecognize(ctx context.Context, in *AsyncRecognizeRequest, opts ...grpc.CallOption) (*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)
|
|
}
|
|
|
|
type speechClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewSpeechClient(cc *grpc.ClientConn) SpeechClient {
|
|
return &speechClient{cc}
|
|
}
|
|
|
|
func (c *speechClient) SyncRecognize(ctx context.Context, in *SyncRecognizeRequest, opts ...grpc.CallOption) (*SyncRecognizeResponse, error) {
|
|
out := new(SyncRecognizeResponse)
|
|
err := c.cc.Invoke(ctx, "/google.cloud.speech.v1beta1.Speech/SyncRecognize", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *speechClient) AsyncRecognize(ctx context.Context, in *AsyncRecognizeRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) {
|
|
out := new(longrunning.Operation)
|
|
err := c.cc.Invoke(ctx, "/google.cloud.speech.v1beta1.Speech/AsyncRecognize", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *speechClient) StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_Speech_serviceDesc.Streams[0], "/google.cloud.speech.v1beta1.Speech/StreamingRecognize", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &speechStreamingRecognizeClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type Speech_StreamingRecognizeClient interface {
|
|
Send(*StreamingRecognizeRequest) error
|
|
Recv() (*StreamingRecognizeResponse, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type speechStreamingRecognizeClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *speechStreamingRecognizeClient) Send(m *StreamingRecognizeRequest) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *speechStreamingRecognizeClient) Recv() (*StreamingRecognizeResponse, error) {
|
|
m := new(StreamingRecognizeResponse)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// SpeechServer is the server API for Speech service.
|
|
type SpeechServer interface {
|
|
// Performs synchronous speech recognition: receive results after all audio
|
|
// has been sent and processed.
|
|
SyncRecognize(context.Context, *SyncRecognizeRequest) (*SyncRecognizeResponse, error)
|
|
// Performs asynchronous speech recognition: receive results via the
|
|
// [google.longrunning.Operations]
|
|
// (/speech/reference/rest/v1beta1/operations#Operation)
|
|
// interface. Returns either an
|
|
// `Operation.error` or an `Operation.response` which contains
|
|
// an `AsyncRecognizeResponse` message.
|
|
AsyncRecognize(context.Context, *AsyncRecognizeRequest) (*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
|
|
}
|
|
|
|
func RegisterSpeechServer(s *grpc.Server, srv SpeechServer) {
|
|
s.RegisterService(&_Speech_serviceDesc, srv)
|
|
}
|
|
|
|
func _Speech_SyncRecognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SyncRecognizeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SpeechServer).SyncRecognize(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/google.cloud.speech.v1beta1.Speech/SyncRecognize",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SpeechServer).SyncRecognize(ctx, req.(*SyncRecognizeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Speech_AsyncRecognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AsyncRecognizeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SpeechServer).AsyncRecognize(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/google.cloud.speech.v1beta1.Speech/AsyncRecognize",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SpeechServer).AsyncRecognize(ctx, req.(*AsyncRecognizeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Speech_StreamingRecognize_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(SpeechServer).StreamingRecognize(&speechStreamingRecognizeServer{stream})
|
|
}
|
|
|
|
type Speech_StreamingRecognizeServer interface {
|
|
Send(*StreamingRecognizeResponse) error
|
|
Recv() (*StreamingRecognizeRequest, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type speechStreamingRecognizeServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *speechStreamingRecognizeServer) Send(m *StreamingRecognizeResponse) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *speechStreamingRecognizeServer) Recv() (*StreamingRecognizeRequest, error) {
|
|
m := new(StreamingRecognizeRequest)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
var _Speech_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "google.cloud.speech.v1beta1.Speech",
|
|
HandlerType: (*SpeechServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "SyncRecognize",
|
|
Handler: _Speech_SyncRecognize_Handler,
|
|
},
|
|
{
|
|
MethodName: "AsyncRecognize",
|
|
Handler: _Speech_AsyncRecognize_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "StreamingRecognize",
|
|
Handler: _Speech_StreamingRecognize_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "google/cloud/speech/v1beta1/cloud_speech.proto",
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("google/cloud/speech/v1beta1/cloud_speech.proto", fileDescriptor_cloud_speech_8234301300f3be52)
|
|
}
|
|
|
|
var fileDescriptor_cloud_speech_8234301300f3be52 = []byte{
|
|
// 1214 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4d, 0x6f, 0x1b, 0xc5,
|
|
0x1b, 0xcf, 0xda, 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