OSDN Git Service

new repo
[bytom/vapor.git] / vendor / google.golang.org / genproto / googleapis / cloud / speech / v1 / cloud_speech.pb.go
1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: google/cloud/speech/v1/cloud_speech.proto
3
4 /*
5 Package speech is a generated protocol buffer package.
6
7 It is generated from these files:
8         google/cloud/speech/v1/cloud_speech.proto
9
10 It has these top-level messages:
11         RecognizeRequest
12         LongRunningRecognizeRequest
13         StreamingRecognizeRequest
14         StreamingRecognitionConfig
15         RecognitionConfig
16         SpeechContext
17         RecognitionAudio
18         RecognizeResponse
19         LongRunningRecognizeResponse
20         LongRunningRecognizeMetadata
21         StreamingRecognizeResponse
22         StreamingRecognitionResult
23         SpeechRecognitionResult
24         SpeechRecognitionAlternative
25         WordInfo
26 */
27 package speech
28
29 import proto "github.com/golang/protobuf/proto"
30 import fmt "fmt"
31 import math "math"
32 import _ "google.golang.org/genproto/googleapis/api/annotations"
33 import google_longrunning "google.golang.org/genproto/googleapis/longrunning"
34 import _ "github.com/golang/protobuf/ptypes/any"
35 import google_protobuf3 "github.com/golang/protobuf/ptypes/duration"
36 import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp"
37 import google_rpc "google.golang.org/genproto/googleapis/rpc/status"
38
39 import (
40         context "golang.org/x/net/context"
41         grpc "google.golang.org/grpc"
42 )
43
44 // Reference imports to suppress errors if they are not otherwise used.
45 var _ = proto.Marshal
46 var _ = fmt.Errorf
47 var _ = math.Inf
48
49 // This is a compile-time assertion to ensure that this generated file
50 // is compatible with the proto package it is being compiled against.
51 // A compilation error at this line likely means your copy of the
52 // proto package needs to be updated.
53 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
54
55 // Audio encoding of the data sent in the audio message. All encodings support
56 // only 1 channel (mono) audio. Only `FLAC` and `WAV` include a header that
57 // describes the bytes of audio that follow the header. The other encodings
58 // are raw audio bytes with no header.
59 //
60 // For best results, the audio source should be captured and transmitted using
61 // a lossless encoding (`FLAC` or `LINEAR16`). Recognition accuracy may be
62 // reduced if lossy codecs, which include the other codecs listed in
63 // this section, are used to capture or transmit the audio, particularly if
64 // background noise is present.
65 type RecognitionConfig_AudioEncoding int32
66
67 const (
68         // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
69         RecognitionConfig_ENCODING_UNSPECIFIED RecognitionConfig_AudioEncoding = 0
70         // Uncompressed 16-bit signed little-endian samples (Linear PCM).
71         RecognitionConfig_LINEAR16 RecognitionConfig_AudioEncoding = 1
72         // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
73         // Codec) is the recommended encoding because it is
74         // lossless--therefore recognition is not compromised--and
75         // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
76         // encoding supports 16-bit and 24-bit samples, however, not all fields in
77         // `STREAMINFO` are supported.
78         RecognitionConfig_FLAC RecognitionConfig_AudioEncoding = 2
79         // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
80         RecognitionConfig_MULAW RecognitionConfig_AudioEncoding = 3
81         // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
82         RecognitionConfig_AMR RecognitionConfig_AudioEncoding = 4
83         // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
84         RecognitionConfig_AMR_WB RecognitionConfig_AudioEncoding = 5
85         // Opus encoded audio frames in Ogg container
86         // ([OggOpus](https://wiki.xiph.org/OggOpus)).
87         // `sample_rate_hertz` must be 16000.
88         RecognitionConfig_OGG_OPUS RecognitionConfig_AudioEncoding = 6
89         // Although the use of lossy encodings is not recommended, if a very low
90         // bitrate encoding is required, `OGG_OPUS` is highly preferred over
91         // Speex encoding. The [Speex](https://speex.org/)  encoding supported by
92         // Cloud Speech API has a header byte in each block, as in MIME type
93         // `audio/x-speex-with-header-byte`.
94         // It is a variant of the RTP Speex encoding defined in
95         // [RFC 5574](https://tools.ietf.org/html/rfc5574).
96         // The stream is a sequence of blocks, one block per RTP packet. Each block
97         // starts with a byte containing the length of the block, in bytes, followed
98         // by one or more frames of Speex data, padded to an integral number of
99         // bytes (octets) as specified in RFC 5574. In other words, each RTP header
100         // is replaced with a single byte containing the block length. Only Speex
101         // wideband is supported. `sample_rate_hertz` must be 16000.
102         RecognitionConfig_SPEEX_WITH_HEADER_BYTE RecognitionConfig_AudioEncoding = 7
103 )
104
105 var RecognitionConfig_AudioEncoding_name = map[int32]string{
106         0: "ENCODING_UNSPECIFIED",
107         1: "LINEAR16",
108         2: "FLAC",
109         3: "MULAW",
110         4: "AMR",
111         5: "AMR_WB",
112         6: "OGG_OPUS",
113         7: "SPEEX_WITH_HEADER_BYTE",
114 }
115 var RecognitionConfig_AudioEncoding_value = map[string]int32{
116         "ENCODING_UNSPECIFIED":   0,
117         "LINEAR16":               1,
118         "FLAC":                   2,
119         "MULAW":                  3,
120         "AMR":                    4,
121         "AMR_WB":                 5,
122         "OGG_OPUS":               6,
123         "SPEEX_WITH_HEADER_BYTE": 7,
124 }
125
126 func (x RecognitionConfig_AudioEncoding) String() string {
127         return proto.EnumName(RecognitionConfig_AudioEncoding_name, int32(x))
128 }
129 func (RecognitionConfig_AudioEncoding) EnumDescriptor() ([]byte, []int) {
130         return fileDescriptor0, []int{4, 0}
131 }
132
133 // Indicates the type of speech event.
134 type StreamingRecognizeResponse_SpeechEventType int32
135
136 const (
137         // No speech event specified.
138         StreamingRecognizeResponse_SPEECH_EVENT_UNSPECIFIED StreamingRecognizeResponse_SpeechEventType = 0
139         // This event indicates that the server has detected the end of the user's
140         // speech utterance and expects no additional speech. Therefore, the server
141         // will not process additional audio (although it may subsequently return
142         // additional results). The client should stop sending additional audio
143         // data, half-close the gRPC connection, and wait for any additional results
144         // until the server closes the gRPC connection. This event is only sent if
145         // `single_utterance` was set to `true`, and is not used otherwise.
146         StreamingRecognizeResponse_END_OF_SINGLE_UTTERANCE StreamingRecognizeResponse_SpeechEventType = 1
147 )
148
149 var StreamingRecognizeResponse_SpeechEventType_name = map[int32]string{
150         0: "SPEECH_EVENT_UNSPECIFIED",
151         1: "END_OF_SINGLE_UTTERANCE",
152 }
153 var StreamingRecognizeResponse_SpeechEventType_value = map[string]int32{
154         "SPEECH_EVENT_UNSPECIFIED": 0,
155         "END_OF_SINGLE_UTTERANCE":  1,
156 }
157
158 func (x StreamingRecognizeResponse_SpeechEventType) String() string {
159         return proto.EnumName(StreamingRecognizeResponse_SpeechEventType_name, int32(x))
160 }
161 func (StreamingRecognizeResponse_SpeechEventType) EnumDescriptor() ([]byte, []int) {
162         return fileDescriptor0, []int{10, 0}
163 }
164
165 // The top-level message sent by the client for the `Recognize` method.
166 type RecognizeRequest struct {
167         // *Required* Provides information to the recognizer that specifies how to
168         // process the request.
169         Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"`
170         // *Required* The audio data to be recognized.
171         Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"`
172 }
173
174 func (m *RecognizeRequest) Reset()                    { *m = RecognizeRequest{} }
175 func (m *RecognizeRequest) String() string            { return proto.CompactTextString(m) }
176 func (*RecognizeRequest) ProtoMessage()               {}
177 func (*RecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
178
179 func (m *RecognizeRequest) GetConfig() *RecognitionConfig {
180         if m != nil {
181                 return m.Config
182         }
183         return nil
184 }
185
186 func (m *RecognizeRequest) GetAudio() *RecognitionAudio {
187         if m != nil {
188                 return m.Audio
189         }
190         return nil
191 }
192
193 // The top-level message sent by the client for the `LongRunningRecognize`
194 // method.
195 type LongRunningRecognizeRequest struct {
196         // *Required* Provides information to the recognizer that specifies how to
197         // process the request.
198         Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"`
199         // *Required* The audio data to be recognized.
200         Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"`
201 }
202
203 func (m *LongRunningRecognizeRequest) Reset()                    { *m = LongRunningRecognizeRequest{} }
204 func (m *LongRunningRecognizeRequest) String() string            { return proto.CompactTextString(m) }
205 func (*LongRunningRecognizeRequest) ProtoMessage()               {}
206 func (*LongRunningRecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
207
208 func (m *LongRunningRecognizeRequest) GetConfig() *RecognitionConfig {
209         if m != nil {
210                 return m.Config
211         }
212         return nil
213 }
214
215 func (m *LongRunningRecognizeRequest) GetAudio() *RecognitionAudio {
216         if m != nil {
217                 return m.Audio
218         }
219         return nil
220 }
221
222 // The top-level message sent by the client for the `StreamingRecognize` method.
223 // Multiple `StreamingRecognizeRequest` messages are sent. The first message
224 // must contain a `streaming_config` message and must not contain `audio` data.
225 // All subsequent messages must contain `audio` data and must not contain a
226 // `streaming_config` message.
227 type StreamingRecognizeRequest struct {
228         // The streaming request, which is either a streaming config or audio content.
229         //
230         // Types that are valid to be assigned to StreamingRequest:
231         //      *StreamingRecognizeRequest_StreamingConfig
232         //      *StreamingRecognizeRequest_AudioContent
233         StreamingRequest isStreamingRecognizeRequest_StreamingRequest `protobuf_oneof:"streaming_request"`
234 }
235
236 func (m *StreamingRecognizeRequest) Reset()                    { *m = StreamingRecognizeRequest{} }
237 func (m *StreamingRecognizeRequest) String() string            { return proto.CompactTextString(m) }
238 func (*StreamingRecognizeRequest) ProtoMessage()               {}
239 func (*StreamingRecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
240
241 type isStreamingRecognizeRequest_StreamingRequest interface {
242         isStreamingRecognizeRequest_StreamingRequest()
243 }
244
245 type StreamingRecognizeRequest_StreamingConfig struct {
246         StreamingConfig *StreamingRecognitionConfig `protobuf:"bytes,1,opt,name=streaming_config,json=streamingConfig,oneof"`
247 }
248 type StreamingRecognizeRequest_AudioContent struct {
249         AudioContent []byte `protobuf:"bytes,2,opt,name=audio_content,json=audioContent,proto3,oneof"`
250 }
251
252 func (*StreamingRecognizeRequest_StreamingConfig) isStreamingRecognizeRequest_StreamingRequest() {}
253 func (*StreamingRecognizeRequest_AudioContent) isStreamingRecognizeRequest_StreamingRequest()    {}
254
255 func (m *StreamingRecognizeRequest) GetStreamingRequest() isStreamingRecognizeRequest_StreamingRequest {
256         if m != nil {
257                 return m.StreamingRequest
258         }
259         return nil
260 }
261
262 func (m *StreamingRecognizeRequest) GetStreamingConfig() *StreamingRecognitionConfig {
263         if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_StreamingConfig); ok {
264                 return x.StreamingConfig
265         }
266         return nil
267 }
268
269 func (m *StreamingRecognizeRequest) GetAudioContent() []byte {
270         if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_AudioContent); ok {
271                 return x.AudioContent
272         }
273         return nil
274 }
275
276 // XXX_OneofFuncs is for the internal use of the proto package.
277 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{}) {
278         return _StreamingRecognizeRequest_OneofMarshaler, _StreamingRecognizeRequest_OneofUnmarshaler, _StreamingRecognizeRequest_OneofSizer, []interface{}{
279                 (*StreamingRecognizeRequest_StreamingConfig)(nil),
280                 (*StreamingRecognizeRequest_AudioContent)(nil),
281         }
282 }
283
284 func _StreamingRecognizeRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
285         m := msg.(*StreamingRecognizeRequest)
286         // streaming_request
287         switch x := m.StreamingRequest.(type) {
288         case *StreamingRecognizeRequest_StreamingConfig:
289                 b.EncodeVarint(1<<3 | proto.WireBytes)
290                 if err := b.EncodeMessage(x.StreamingConfig); err != nil {
291                         return err
292                 }
293         case *StreamingRecognizeRequest_AudioContent:
294                 b.EncodeVarint(2<<3 | proto.WireBytes)
295                 b.EncodeRawBytes(x.AudioContent)
296         case nil:
297         default:
298                 return fmt.Errorf("StreamingRecognizeRequest.StreamingRequest has unexpected type %T", x)
299         }
300         return nil
301 }
302
303 func _StreamingRecognizeRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
304         m := msg.(*StreamingRecognizeRequest)
305         switch tag {
306         case 1: // streaming_request.streaming_config
307                 if wire != proto.WireBytes {
308                         return true, proto.ErrInternalBadWireType
309                 }
310                 msg := new(StreamingRecognitionConfig)
311                 err := b.DecodeMessage(msg)
312                 m.StreamingRequest = &StreamingRecognizeRequest_StreamingConfig{msg}
313                 return true, err
314         case 2: // streaming_request.audio_content
315                 if wire != proto.WireBytes {
316                         return true, proto.ErrInternalBadWireType
317                 }
318                 x, err := b.DecodeRawBytes(true)
319                 m.StreamingRequest = &StreamingRecognizeRequest_AudioContent{x}
320                 return true, err
321         default:
322                 return false, nil
323         }
324 }
325
326 func _StreamingRecognizeRequest_OneofSizer(msg proto.Message) (n int) {
327         m := msg.(*StreamingRecognizeRequest)
328         // streaming_request
329         switch x := m.StreamingRequest.(type) {
330         case *StreamingRecognizeRequest_StreamingConfig:
331                 s := proto.Size(x.StreamingConfig)
332                 n += proto.SizeVarint(1<<3 | proto.WireBytes)
333                 n += proto.SizeVarint(uint64(s))
334                 n += s
335         case *StreamingRecognizeRequest_AudioContent:
336                 n += proto.SizeVarint(2<<3 | proto.WireBytes)
337                 n += proto.SizeVarint(uint64(len(x.AudioContent)))
338                 n += len(x.AudioContent)
339         case nil:
340         default:
341                 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
342         }
343         return n
344 }
345
346 // Provides information to the recognizer that specifies how to process the
347 // request.
348 type StreamingRecognitionConfig struct {
349         // *Required* Provides information to the recognizer that specifies how to
350         // process the request.
351         Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"`
352         // *Optional* If `false` or omitted, the recognizer will perform continuous
353         // recognition (continuing to wait for and process audio even if the user
354         // pauses speaking) until the client closes the input stream (gRPC API) or
355         // until the maximum time limit has been reached. May return multiple
356         // `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
357         //
358         // If `true`, the recognizer will detect a single spoken utterance. When it
359         // detects that the user has paused or stopped speaking, it will return an
360         // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
361         // more than one `StreamingRecognitionResult` with the `is_final` flag set to
362         // `true`.
363         SingleUtterance bool `protobuf:"varint,2,opt,name=single_utterance,json=singleUtterance" json:"single_utterance,omitempty"`
364         // *Optional* If `true`, interim results (tentative hypotheses) may be
365         // returned as they become available (these interim results are indicated with
366         // the `is_final=false` flag).
367         // If `false` or omitted, only `is_final=true` result(s) are returned.
368         InterimResults bool `protobuf:"varint,3,opt,name=interim_results,json=interimResults" json:"interim_results,omitempty"`
369 }
370
371 func (m *StreamingRecognitionConfig) Reset()                    { *m = StreamingRecognitionConfig{} }
372 func (m *StreamingRecognitionConfig) String() string            { return proto.CompactTextString(m) }
373 func (*StreamingRecognitionConfig) ProtoMessage()               {}
374 func (*StreamingRecognitionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
375
376 func (m *StreamingRecognitionConfig) GetConfig() *RecognitionConfig {
377         if m != nil {
378                 return m.Config
379         }
380         return nil
381 }
382
383 func (m *StreamingRecognitionConfig) GetSingleUtterance() bool {
384         if m != nil {
385                 return m.SingleUtterance
386         }
387         return false
388 }
389
390 func (m *StreamingRecognitionConfig) GetInterimResults() bool {
391         if m != nil {
392                 return m.InterimResults
393         }
394         return false
395 }
396
397 // Provides information to the recognizer that specifies how to process the
398 // request.
399 type RecognitionConfig struct {
400         // *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
401         Encoding RecognitionConfig_AudioEncoding `protobuf:"varint,1,opt,name=encoding,enum=google.cloud.speech.v1.RecognitionConfig_AudioEncoding" json:"encoding,omitempty"`
402         // *Required* Sample rate in Hertz of the audio data sent in all
403         // `RecognitionAudio` messages. Valid values are: 8000-48000.
404         // 16000 is optimal. For best results, set the sampling rate of the audio
405         // source to 16000 Hz. If that's not possible, use the native sample rate of
406         // the audio source (instead of re-sampling).
407         SampleRateHertz int32 `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz" json:"sample_rate_hertz,omitempty"`
408         // *Required* The language of the supplied audio as a
409         // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
410         // Example: "en-US".
411         // See [Language Support](https://cloud.google.com/speech/docs/languages)
412         // for a list of the currently supported language codes.
413         LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"`
414         // *Optional* Maximum number of recognition hypotheses to be returned.
415         // Specifically, the maximum number of `SpeechRecognitionAlternative` messages
416         // within each `SpeechRecognitionResult`.
417         // The server may return fewer than `max_alternatives`.
418         // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
419         // one. If omitted, will return a maximum of one.
420         MaxAlternatives int32 `protobuf:"varint,4,opt,name=max_alternatives,json=maxAlternatives" json:"max_alternatives,omitempty"`
421         // *Optional* If set to `true`, the server will attempt to filter out
422         // profanities, replacing all but the initial character in each filtered word
423         // with asterisks, e.g. "f***". If set to `false` or omitted, profanities
424         // won't be filtered out.
425         ProfanityFilter bool `protobuf:"varint,5,opt,name=profanity_filter,json=profanityFilter" json:"profanity_filter,omitempty"`
426         // *Optional* A means to provide context to assist the speech recognition.
427         SpeechContexts []*SpeechContext `protobuf:"bytes,6,rep,name=speech_contexts,json=speechContexts" json:"speech_contexts,omitempty"`
428         // *Optional* If `true`, the top result includes a list of words and
429         // the start and end time offsets (timestamps) for those words. If
430         // `false`, no word-level time offset information is returned. The default is
431         // `false`.
432         EnableWordTimeOffsets bool `protobuf:"varint,8,opt,name=enable_word_time_offsets,json=enableWordTimeOffsets" json:"enable_word_time_offsets,omitempty"`
433 }
434
435 func (m *RecognitionConfig) Reset()                    { *m = RecognitionConfig{} }
436 func (m *RecognitionConfig) String() string            { return proto.CompactTextString(m) }
437 func (*RecognitionConfig) ProtoMessage()               {}
438 func (*RecognitionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
439
440 func (m *RecognitionConfig) GetEncoding() RecognitionConfig_AudioEncoding {
441         if m != nil {
442                 return m.Encoding
443         }
444         return RecognitionConfig_ENCODING_UNSPECIFIED
445 }
446
447 func (m *RecognitionConfig) GetSampleRateHertz() int32 {
448         if m != nil {
449                 return m.SampleRateHertz
450         }
451         return 0
452 }
453
454 func (m *RecognitionConfig) GetLanguageCode() string {
455         if m != nil {
456                 return m.LanguageCode
457         }
458         return ""
459 }
460
461 func (m *RecognitionConfig) GetMaxAlternatives() int32 {
462         if m != nil {
463                 return m.MaxAlternatives
464         }
465         return 0
466 }
467
468 func (m *RecognitionConfig) GetProfanityFilter() bool {
469         if m != nil {
470                 return m.ProfanityFilter
471         }
472         return false
473 }
474
475 func (m *RecognitionConfig) GetSpeechContexts() []*SpeechContext {
476         if m != nil {
477                 return m.SpeechContexts
478         }
479         return nil
480 }
481
482 func (m *RecognitionConfig) GetEnableWordTimeOffsets() bool {
483         if m != nil {
484                 return m.EnableWordTimeOffsets
485         }
486         return false
487 }
488
489 // Provides "hints" to the speech recognizer to favor specific words and phrases
490 // in the results.
491 type SpeechContext struct {
492         // *Optional* A list of strings containing words and phrases "hints" so that
493         // the speech recognition is more likely to recognize them. This can be used
494         // to improve the accuracy for specific words and phrases, for example, if
495         // specific commands are typically spoken by the user. This can also be used
496         // to add additional words to the vocabulary of the recognizer. See
497         // [usage limits](https://cloud.google.com/speech/limits#content).
498         Phrases []string `protobuf:"bytes,1,rep,name=phrases" json:"phrases,omitempty"`
499 }
500
501 func (m *SpeechContext) Reset()                    { *m = SpeechContext{} }
502 func (m *SpeechContext) String() string            { return proto.CompactTextString(m) }
503 func (*SpeechContext) ProtoMessage()               {}
504 func (*SpeechContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
505
506 func (m *SpeechContext) GetPhrases() []string {
507         if m != nil {
508                 return m.Phrases
509         }
510         return nil
511 }
512
513 // Contains audio data in the encoding specified in the `RecognitionConfig`.
514 // Either `content` or `uri` must be supplied. Supplying both or neither
515 // returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
516 // [audio limits](https://cloud.google.com/speech/limits#content).
517 type RecognitionAudio struct {
518         // The audio source, which is either inline content or a Google Cloud
519         // Storage uri.
520         //
521         // Types that are valid to be assigned to AudioSource:
522         //      *RecognitionAudio_Content
523         //      *RecognitionAudio_Uri
524         AudioSource isRecognitionAudio_AudioSource `protobuf_oneof:"audio_source"`
525 }
526
527 func (m *RecognitionAudio) Reset()                    { *m = RecognitionAudio{} }
528 func (m *RecognitionAudio) String() string            { return proto.CompactTextString(m) }
529 func (*RecognitionAudio) ProtoMessage()               {}
530 func (*RecognitionAudio) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
531
532 type isRecognitionAudio_AudioSource interface {
533         isRecognitionAudio_AudioSource()
534 }
535
536 type RecognitionAudio_Content struct {
537         Content []byte `protobuf:"bytes,1,opt,name=content,proto3,oneof"`
538 }
539 type RecognitionAudio_Uri struct {
540         Uri string `protobuf:"bytes,2,opt,name=uri,oneof"`
541 }
542
543 func (*RecognitionAudio_Content) isRecognitionAudio_AudioSource() {}
544 func (*RecognitionAudio_Uri) isRecognitionAudio_AudioSource()     {}
545
546 func (m *RecognitionAudio) GetAudioSource() isRecognitionAudio_AudioSource {
547         if m != nil {
548                 return m.AudioSource
549         }
550         return nil
551 }
552
553 func (m *RecognitionAudio) GetContent() []byte {
554         if x, ok := m.GetAudioSource().(*RecognitionAudio_Content); ok {
555                 return x.Content
556         }
557         return nil
558 }
559
560 func (m *RecognitionAudio) GetUri() string {
561         if x, ok := m.GetAudioSource().(*RecognitionAudio_Uri); ok {
562                 return x.Uri
563         }
564         return ""
565 }
566
567 // XXX_OneofFuncs is for the internal use of the proto package.
568 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{}) {
569         return _RecognitionAudio_OneofMarshaler, _RecognitionAudio_OneofUnmarshaler, _RecognitionAudio_OneofSizer, []interface{}{
570                 (*RecognitionAudio_Content)(nil),
571                 (*RecognitionAudio_Uri)(nil),
572         }
573 }
574
575 func _RecognitionAudio_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
576         m := msg.(*RecognitionAudio)
577         // audio_source
578         switch x := m.AudioSource.(type) {
579         case *RecognitionAudio_Content:
580                 b.EncodeVarint(1<<3 | proto.WireBytes)
581                 b.EncodeRawBytes(x.Content)
582         case *RecognitionAudio_Uri:
583                 b.EncodeVarint(2<<3 | proto.WireBytes)
584                 b.EncodeStringBytes(x.Uri)
585         case nil:
586         default:
587                 return fmt.Errorf("RecognitionAudio.AudioSource has unexpected type %T", x)
588         }
589         return nil
590 }
591
592 func _RecognitionAudio_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
593         m := msg.(*RecognitionAudio)
594         switch tag {
595         case 1: // audio_source.content
596                 if wire != proto.WireBytes {
597                         return true, proto.ErrInternalBadWireType
598                 }
599                 x, err := b.DecodeRawBytes(true)
600                 m.AudioSource = &RecognitionAudio_Content{x}
601                 return true, err
602         case 2: // audio_source.uri
603                 if wire != proto.WireBytes {
604                         return true, proto.ErrInternalBadWireType
605                 }
606                 x, err := b.DecodeStringBytes()
607                 m.AudioSource = &RecognitionAudio_Uri{x}
608                 return true, err
609         default:
610                 return false, nil
611         }
612 }
613
614 func _RecognitionAudio_OneofSizer(msg proto.Message) (n int) {
615         m := msg.(*RecognitionAudio)
616         // audio_source
617         switch x := m.AudioSource.(type) {
618         case *RecognitionAudio_Content:
619                 n += proto.SizeVarint(1<<3 | proto.WireBytes)
620                 n += proto.SizeVarint(uint64(len(x.Content)))
621                 n += len(x.Content)
622         case *RecognitionAudio_Uri:
623                 n += proto.SizeVarint(2<<3 | proto.WireBytes)
624                 n += proto.SizeVarint(uint64(len(x.Uri)))
625                 n += len(x.Uri)
626         case nil:
627         default:
628                 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
629         }
630         return n
631 }
632
633 // The only message returned to the client by the `Recognize` method. It
634 // contains the result as zero or more sequential `SpeechRecognitionResult`
635 // messages.
636 type RecognizeResponse struct {
637         // *Output-only* Sequential list of transcription results corresponding to
638         // sequential portions of audio.
639         Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"`
640 }
641
642 func (m *RecognizeResponse) Reset()                    { *m = RecognizeResponse{} }
643 func (m *RecognizeResponse) String() string            { return proto.CompactTextString(m) }
644 func (*RecognizeResponse) ProtoMessage()               {}
645 func (*RecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
646
647 func (m *RecognizeResponse) GetResults() []*SpeechRecognitionResult {
648         if m != nil {
649                 return m.Results
650         }
651         return nil
652 }
653
654 // The only message returned to the client by the `LongRunningRecognize` method.
655 // It contains the result as zero or more sequential `SpeechRecognitionResult`
656 // messages. It is included in the `result.response` field of the `Operation`
657 // returned by the `GetOperation` call of the `google::longrunning::Operations`
658 // service.
659 type LongRunningRecognizeResponse struct {
660         // *Output-only* Sequential list of transcription results corresponding to
661         // sequential portions of audio.
662         Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"`
663 }
664
665 func (m *LongRunningRecognizeResponse) Reset()                    { *m = LongRunningRecognizeResponse{} }
666 func (m *LongRunningRecognizeResponse) String() string            { return proto.CompactTextString(m) }
667 func (*LongRunningRecognizeResponse) ProtoMessage()               {}
668 func (*LongRunningRecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
669
670 func (m *LongRunningRecognizeResponse) GetResults() []*SpeechRecognitionResult {
671         if m != nil {
672                 return m.Results
673         }
674         return nil
675 }
676
677 // Describes the progress of a long-running `LongRunningRecognize` call. It is
678 // included in the `metadata` field of the `Operation` returned by the
679 // `GetOperation` call of the `google::longrunning::Operations` service.
680 type LongRunningRecognizeMetadata struct {
681         // Approximate percentage of audio processed thus far. Guaranteed to be 100
682         // when the audio is fully processed and the results are available.
683         ProgressPercent int32 `protobuf:"varint,1,opt,name=progress_percent,json=progressPercent" json:"progress_percent,omitempty"`
684         // Time when the request was received.
685         StartTime *google_protobuf4.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"`
686         // Time of the most recent processing update.
687         LastUpdateTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"`
688 }
689
690 func (m *LongRunningRecognizeMetadata) Reset()                    { *m = LongRunningRecognizeMetadata{} }
691 func (m *LongRunningRecognizeMetadata) String() string            { return proto.CompactTextString(m) }
692 func (*LongRunningRecognizeMetadata) ProtoMessage()               {}
693 func (*LongRunningRecognizeMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }
694
695 func (m *LongRunningRecognizeMetadata) GetProgressPercent() int32 {
696         if m != nil {
697                 return m.ProgressPercent
698         }
699         return 0
700 }
701
702 func (m *LongRunningRecognizeMetadata) GetStartTime() *google_protobuf4.Timestamp {
703         if m != nil {
704                 return m.StartTime
705         }
706         return nil
707 }
708
709 func (m *LongRunningRecognizeMetadata) GetLastUpdateTime() *google_protobuf4.Timestamp {
710         if m != nil {
711                 return m.LastUpdateTime
712         }
713         return nil
714 }
715
716 // `StreamingRecognizeResponse` is the only message returned to the client by
717 // `StreamingRecognize`. A series of one or more `StreamingRecognizeResponse`
718 // messages are streamed back to the client.
719 //
720 // Here's an example of a series of ten `StreamingRecognizeResponse`s that might
721 // be returned while processing audio:
722 //
723 // 1. results { alternatives { transcript: "tube" } stability: 0.01 }
724 //
725 // 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
726 //
727 // 3. results { alternatives { transcript: "to be" } stability: 0.9 }
728 //    results { alternatives { transcript: " or not to be" } stability: 0.01 }
729 //
730 // 4. results { alternatives { transcript: "to be or not to be"
731 //                             confidence: 0.92 }
732 //              alternatives { transcript: "to bee or not to bee" }
733 //              is_final: true }
734 //
735 // 5. results { alternatives { transcript: " that's" } stability: 0.01 }
736 //
737 // 6. results { alternatives { transcript: " that is" } stability: 0.9 }
738 //    results { alternatives { transcript: " the question" } stability: 0.01 }
739 //
740 // 7. results { alternatives { transcript: " that is the question"
741 //                             confidence: 0.98 }
742 //              alternatives { transcript: " that was the question" }
743 //              is_final: true }
744 //
745 // Notes:
746 //
747 // - Only two of the above responses #4 and #7 contain final results; they are
748 //   indicated by `is_final: true`. Concatenating these together generates the
749 //   full transcript: "to be or not to be that is the question".
750 //
751 // - The others contain interim `results`. #3 and #6 contain two interim
752 //   `results`: the first portion has a high stability and is less likely to
753 //   change; the second portion has a low stability and is very likely to
754 //   change. A UI designer might choose to show only high stability `results`.
755 //
756 // - The specific `stability` and `confidence` values shown above are only for
757 //   illustrative purposes. Actual values may vary.
758 //
759 // - In each response, only one of these fields will be set:
760 //     `error`,
761 //     `speech_event_type`, or
762 //     one or more (repeated) `results`.
763 type StreamingRecognizeResponse struct {
764         // *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
765         // specifies the error for the operation.
766         Error *google_rpc.Status `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
767         // *Output-only* This repeated list contains zero or more results that
768         // correspond to consecutive portions of the audio currently being processed.
769         // It contains zero or one `is_final=true` result (the newly settled portion),
770         // followed by zero or more `is_final=false` results.
771         Results []*StreamingRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"`
772         // *Output-only* Indicates the type of speech event.
773         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"`
774 }
775
776 func (m *StreamingRecognizeResponse) Reset()                    { *m = StreamingRecognizeResponse{} }
777 func (m *StreamingRecognizeResponse) String() string            { return proto.CompactTextString(m) }
778 func (*StreamingRecognizeResponse) ProtoMessage()               {}
779 func (*StreamingRecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }
780
781 func (m *StreamingRecognizeResponse) GetError() *google_rpc.Status {
782         if m != nil {
783                 return m.Error
784         }
785         return nil
786 }
787
788 func (m *StreamingRecognizeResponse) GetResults() []*StreamingRecognitionResult {
789         if m != nil {
790                 return m.Results
791         }
792         return nil
793 }
794
795 func (m *StreamingRecognizeResponse) GetSpeechEventType() StreamingRecognizeResponse_SpeechEventType {
796         if m != nil {
797                 return m.SpeechEventType
798         }
799         return StreamingRecognizeResponse_SPEECH_EVENT_UNSPECIFIED
800 }
801
802 // A streaming speech recognition result corresponding to a portion of the audio
803 // that is currently being processed.
804 type StreamingRecognitionResult struct {
805         // *Output-only* May contain one or more recognition hypotheses (up to the
806         // maximum specified in `max_alternatives`).
807         Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"`
808         // *Output-only* If `false`, this `StreamingRecognitionResult` represents an
809         // interim result that may change. If `true`, this is the final time the
810         // speech service will return this particular `StreamingRecognitionResult`,
811         // the recognizer will not return any further hypotheses for this portion of
812         // the transcript and corresponding audio.
813         IsFinal bool `protobuf:"varint,2,opt,name=is_final,json=isFinal" json:"is_final,omitempty"`
814         // *Output-only* An estimate of the likelihood that the recognizer will not
815         // change its guess about this interim result. Values range from 0.0
816         // (completely unstable) to 1.0 (completely stable).
817         // This field is only provided for interim results (`is_final=false`).
818         // The default of 0.0 is a sentinel value indicating `stability` was not set.
819         Stability float32 `protobuf:"fixed32,3,opt,name=stability" json:"stability,omitempty"`
820 }
821
822 func (m *StreamingRecognitionResult) Reset()                    { *m = StreamingRecognitionResult{} }
823 func (m *StreamingRecognitionResult) String() string            { return proto.CompactTextString(m) }
824 func (*StreamingRecognitionResult) ProtoMessage()               {}
825 func (*StreamingRecognitionResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
826
827 func (m *StreamingRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative {
828         if m != nil {
829                 return m.Alternatives
830         }
831         return nil
832 }
833
834 func (m *StreamingRecognitionResult) GetIsFinal() bool {
835         if m != nil {
836                 return m.IsFinal
837         }
838         return false
839 }
840
841 func (m *StreamingRecognitionResult) GetStability() float32 {
842         if m != nil {
843                 return m.Stability
844         }
845         return 0
846 }
847
848 // A speech recognition result corresponding to a portion of the audio.
849 type SpeechRecognitionResult struct {
850         // *Output-only* May contain one or more recognition hypotheses (up to the
851         // maximum specified in `max_alternatives`).
852         // These alternatives are ordered in terms of accuracy, with the top (first)
853         // alternative being the most probable, as ranked by the recognizer.
854         Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"`
855 }
856
857 func (m *SpeechRecognitionResult) Reset()                    { *m = SpeechRecognitionResult{} }
858 func (m *SpeechRecognitionResult) String() string            { return proto.CompactTextString(m) }
859 func (*SpeechRecognitionResult) ProtoMessage()               {}
860 func (*SpeechRecognitionResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }
861
862 func (m *SpeechRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative {
863         if m != nil {
864                 return m.Alternatives
865         }
866         return nil
867 }
868
869 // Alternative hypotheses (a.k.a. n-best list).
870 type SpeechRecognitionAlternative struct {
871         // *Output-only* Transcript text representing the words that the user spoke.
872         Transcript string `protobuf:"bytes,1,opt,name=transcript" json:"transcript,omitempty"`
873         // *Output-only* The confidence estimate between 0.0 and 1.0. A higher number
874         // indicates an estimated greater likelihood that the recognized words are
875         // correct. This field is typically provided only for the top hypothesis, and
876         // only for `is_final=true` results. Clients should not rely on the
877         // `confidence` field as it is not guaranteed to be accurate or consistent.
878         // The default of 0.0 is a sentinel value indicating `confidence` was not set.
879         Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"`
880         // *Output-only* A list of word-specific information for each recognized word.
881         Words []*WordInfo `protobuf:"bytes,3,rep,name=words" json:"words,omitempty"`
882 }
883
884 func (m *SpeechRecognitionAlternative) Reset()                    { *m = SpeechRecognitionAlternative{} }
885 func (m *SpeechRecognitionAlternative) String() string            { return proto.CompactTextString(m) }
886 func (*SpeechRecognitionAlternative) ProtoMessage()               {}
887 func (*SpeechRecognitionAlternative) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} }
888
889 func (m *SpeechRecognitionAlternative) GetTranscript() string {
890         if m != nil {
891                 return m.Transcript
892         }
893         return ""
894 }
895
896 func (m *SpeechRecognitionAlternative) GetConfidence() float32 {
897         if m != nil {
898                 return m.Confidence
899         }
900         return 0
901 }
902
903 func (m *SpeechRecognitionAlternative) GetWords() []*WordInfo {
904         if m != nil {
905                 return m.Words
906         }
907         return nil
908 }
909
910 // Word-specific information for recognized words. Word information is only
911 // included in the response when certain request parameters are set, such
912 // as `enable_word_time_offsets`.
913 type WordInfo struct {
914         // *Output-only* Time offset relative to the beginning of the audio,
915         // and corresponding to the start of the spoken word.
916         // This field is only set if `enable_word_time_offsets=true` and only
917         // in the top hypothesis.
918         // This is an experimental feature and the accuracy of the time offset can
919         // vary.
920         StartTime *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=start_time,json=startTime" json:"start_time,omitempty"`
921         // *Output-only* Time offset relative to the beginning of the audio,
922         // and corresponding to the end of the spoken word.
923         // This field is only set if `enable_word_time_offsets=true` and only
924         // in the top hypothesis.
925         // This is an experimental feature and the accuracy of the time offset can
926         // vary.
927         EndTime *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=end_time,json=endTime" json:"end_time,omitempty"`
928         // *Output-only* The word corresponding to this set of information.
929         Word string `protobuf:"bytes,3,opt,name=word" json:"word,omitempty"`
930 }
931
932 func (m *WordInfo) Reset()                    { *m = WordInfo{} }
933 func (m *WordInfo) String() string            { return proto.CompactTextString(m) }
934 func (*WordInfo) ProtoMessage()               {}
935 func (*WordInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} }
936
937 func (m *WordInfo) GetStartTime() *google_protobuf3.Duration {
938         if m != nil {
939                 return m.StartTime
940         }
941         return nil
942 }
943
944 func (m *WordInfo) GetEndTime() *google_protobuf3.Duration {
945         if m != nil {
946                 return m.EndTime
947         }
948         return nil
949 }
950
951 func (m *WordInfo) GetWord() string {
952         if m != nil {
953                 return m.Word
954         }
955         return ""
956 }
957
958 func init() {
959         proto.RegisterType((*RecognizeRequest)(nil), "google.cloud.speech.v1.RecognizeRequest")
960         proto.RegisterType((*LongRunningRecognizeRequest)(nil), "google.cloud.speech.v1.LongRunningRecognizeRequest")
961         proto.RegisterType((*StreamingRecognizeRequest)(nil), "google.cloud.speech.v1.StreamingRecognizeRequest")
962         proto.RegisterType((*StreamingRecognitionConfig)(nil), "google.cloud.speech.v1.StreamingRecognitionConfig")
963         proto.RegisterType((*RecognitionConfig)(nil), "google.cloud.speech.v1.RecognitionConfig")
964         proto.RegisterType((*SpeechContext)(nil), "google.cloud.speech.v1.SpeechContext")
965         proto.RegisterType((*RecognitionAudio)(nil), "google.cloud.speech.v1.RecognitionAudio")
966         proto.RegisterType((*RecognizeResponse)(nil), "google.cloud.speech.v1.RecognizeResponse")
967         proto.RegisterType((*LongRunningRecognizeResponse)(nil), "google.cloud.speech.v1.LongRunningRecognizeResponse")
968         proto.RegisterType((*LongRunningRecognizeMetadata)(nil), "google.cloud.speech.v1.LongRunningRecognizeMetadata")
969         proto.RegisterType((*StreamingRecognizeResponse)(nil), "google.cloud.speech.v1.StreamingRecognizeResponse")
970         proto.RegisterType((*StreamingRecognitionResult)(nil), "google.cloud.speech.v1.StreamingRecognitionResult")
971         proto.RegisterType((*SpeechRecognitionResult)(nil), "google.cloud.speech.v1.SpeechRecognitionResult")
972         proto.RegisterType((*SpeechRecognitionAlternative)(nil), "google.cloud.speech.v1.SpeechRecognitionAlternative")
973         proto.RegisterType((*WordInfo)(nil), "google.cloud.speech.v1.WordInfo")
974         proto.RegisterEnum("google.cloud.speech.v1.RecognitionConfig_AudioEncoding", RecognitionConfig_AudioEncoding_name, RecognitionConfig_AudioEncoding_value)
975         proto.RegisterEnum("google.cloud.speech.v1.StreamingRecognizeResponse_SpeechEventType", StreamingRecognizeResponse_SpeechEventType_name, StreamingRecognizeResponse_SpeechEventType_value)
976 }
977
978 // Reference imports to suppress errors if they are not otherwise used.
979 var _ context.Context
980 var _ grpc.ClientConn
981
982 // This is a compile-time assertion to ensure that this generated file
983 // is compatible with the grpc package it is being compiled against.
984 const _ = grpc.SupportPackageIsVersion4
985
986 // Client API for Speech service
987
988 type SpeechClient interface {
989         // Performs synchronous speech recognition: receive results after all audio
990         // has been sent and processed.
991         Recognize(ctx context.Context, in *RecognizeRequest, opts ...grpc.CallOption) (*RecognizeResponse, error)
992         // Performs asynchronous speech recognition: receive results via the
993         // google.longrunning.Operations interface. Returns either an
994         // `Operation.error` or an `Operation.response` which contains
995         // a `LongRunningRecognizeResponse` message.
996         LongRunningRecognize(ctx context.Context, in *LongRunningRecognizeRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error)
997         // Performs bidirectional streaming speech recognition: receive results while
998         // sending audio. This method is only available via the gRPC API (not REST).
999         StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error)
1000 }
1001
1002 type speechClient struct {
1003         cc *grpc.ClientConn
1004 }
1005
1006 func NewSpeechClient(cc *grpc.ClientConn) SpeechClient {
1007         return &speechClient{cc}
1008 }
1009
1010 func (c *speechClient) Recognize(ctx context.Context, in *RecognizeRequest, opts ...grpc.CallOption) (*RecognizeResponse, error) {
1011         out := new(RecognizeResponse)
1012         err := grpc.Invoke(ctx, "/google.cloud.speech.v1.Speech/Recognize", in, out, c.cc, opts...)
1013         if err != nil {
1014                 return nil, err
1015         }
1016         return out, nil
1017 }
1018
1019 func (c *speechClient) LongRunningRecognize(ctx context.Context, in *LongRunningRecognizeRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) {
1020         out := new(google_longrunning.Operation)
1021         err := grpc.Invoke(ctx, "/google.cloud.speech.v1.Speech/LongRunningRecognize", in, out, c.cc, opts...)
1022         if err != nil {
1023                 return nil, err
1024         }
1025         return out, nil
1026 }
1027
1028 func (c *speechClient) StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error) {
1029         stream, err := grpc.NewClientStream(ctx, &_Speech_serviceDesc.Streams[0], c.cc, "/google.cloud.speech.v1.Speech/StreamingRecognize", opts...)
1030         if err != nil {
1031                 return nil, err
1032         }
1033         x := &speechStreamingRecognizeClient{stream}
1034         return x, nil
1035 }
1036
1037 type Speech_StreamingRecognizeClient interface {
1038         Send(*StreamingRecognizeRequest) error
1039         Recv() (*StreamingRecognizeResponse, error)
1040         grpc.ClientStream
1041 }
1042
1043 type speechStreamingRecognizeClient struct {
1044         grpc.ClientStream
1045 }
1046
1047 func (x *speechStreamingRecognizeClient) Send(m *StreamingRecognizeRequest) error {
1048         return x.ClientStream.SendMsg(m)
1049 }
1050
1051 func (x *speechStreamingRecognizeClient) Recv() (*StreamingRecognizeResponse, error) {
1052         m := new(StreamingRecognizeResponse)
1053         if err := x.ClientStream.RecvMsg(m); err != nil {
1054                 return nil, err
1055         }
1056         return m, nil
1057 }
1058
1059 // Server API for Speech service
1060
1061 type SpeechServer interface {
1062         // Performs synchronous speech recognition: receive results after all audio
1063         // has been sent and processed.
1064         Recognize(context.Context, *RecognizeRequest) (*RecognizeResponse, error)
1065         // Performs asynchronous speech recognition: receive results via the
1066         // google.longrunning.Operations interface. Returns either an
1067         // `Operation.error` or an `Operation.response` which contains
1068         // a `LongRunningRecognizeResponse` message.
1069         LongRunningRecognize(context.Context, *LongRunningRecognizeRequest) (*google_longrunning.Operation, error)
1070         // Performs bidirectional streaming speech recognition: receive results while
1071         // sending audio. This method is only available via the gRPC API (not REST).
1072         StreamingRecognize(Speech_StreamingRecognizeServer) error
1073 }
1074
1075 func RegisterSpeechServer(s *grpc.Server, srv SpeechServer) {
1076         s.RegisterService(&_Speech_serviceDesc, srv)
1077 }
1078
1079 func _Speech_Recognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
1080         in := new(RecognizeRequest)
1081         if err := dec(in); err != nil {
1082                 return nil, err
1083         }
1084         if interceptor == nil {
1085                 return srv.(SpeechServer).Recognize(ctx, in)
1086         }
1087         info := &grpc.UnaryServerInfo{
1088                 Server:     srv,
1089                 FullMethod: "/google.cloud.speech.v1.Speech/Recognize",
1090         }
1091         handler := func(ctx context.Context, req interface{}) (interface{}, error) {
1092                 return srv.(SpeechServer).Recognize(ctx, req.(*RecognizeRequest))
1093         }
1094         return interceptor(ctx, in, info, handler)
1095 }
1096
1097 func _Speech_LongRunningRecognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
1098         in := new(LongRunningRecognizeRequest)
1099         if err := dec(in); err != nil {
1100                 return nil, err
1101         }
1102         if interceptor == nil {
1103                 return srv.(SpeechServer).LongRunningRecognize(ctx, in)
1104         }
1105         info := &grpc.UnaryServerInfo{
1106                 Server:     srv,
1107                 FullMethod: "/google.cloud.speech.v1.Speech/LongRunningRecognize",
1108         }
1109         handler := func(ctx context.Context, req interface{}) (interface{}, error) {
1110                 return srv.(SpeechServer).LongRunningRecognize(ctx, req.(*LongRunningRecognizeRequest))
1111         }
1112         return interceptor(ctx, in, info, handler)
1113 }
1114
1115 func _Speech_StreamingRecognize_Handler(srv interface{}, stream grpc.ServerStream) error {
1116         return srv.(SpeechServer).StreamingRecognize(&speechStreamingRecognizeServer{stream})
1117 }
1118
1119 type Speech_StreamingRecognizeServer interface {
1120         Send(*StreamingRecognizeResponse) error
1121         Recv() (*StreamingRecognizeRequest, error)
1122         grpc.ServerStream
1123 }
1124
1125 type speechStreamingRecognizeServer struct {
1126         grpc.ServerStream
1127 }
1128
1129 func (x *speechStreamingRecognizeServer) Send(m *StreamingRecognizeResponse) error {
1130         return x.ServerStream.SendMsg(m)
1131 }
1132
1133 func (x *speechStreamingRecognizeServer) Recv() (*StreamingRecognizeRequest, error) {
1134         m := new(StreamingRecognizeRequest)
1135         if err := x.ServerStream.RecvMsg(m); err != nil {
1136                 return nil, err
1137         }
1138         return m, nil
1139 }
1140
1141 var _Speech_serviceDesc = grpc.ServiceDesc{
1142         ServiceName: "google.cloud.speech.v1.Speech",
1143         HandlerType: (*SpeechServer)(nil),
1144         Methods: []grpc.MethodDesc{
1145                 {
1146                         MethodName: "Recognize",
1147                         Handler:    _Speech_Recognize_Handler,
1148                 },
1149                 {
1150                         MethodName: "LongRunningRecognize",
1151                         Handler:    _Speech_LongRunningRecognize_Handler,
1152                 },
1153         },
1154         Streams: []grpc.StreamDesc{
1155                 {
1156                         StreamName:    "StreamingRecognize",
1157                         Handler:       _Speech_StreamingRecognize_Handler,
1158                         ServerStreams: true,
1159                         ClientStreams: true,
1160                 },
1161         },
1162         Metadata: "google/cloud/speech/v1/cloud_speech.proto",
1163 }
1164
1165 func init() { proto.RegisterFile("google/cloud/speech/v1/cloud_speech.proto", fileDescriptor0) }
1166
1167 var fileDescriptor0 = []byte{
1168         // 1318 bytes of a gzipped FileDescriptorProto
1169         0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4d, 0x6f, 0x1b, 0x45,
1170         0x18, 0xce, 0xc6, 0x71, 0x3e, 0xde, 0xe6, 0xc3, 0x19, 0x4a, 0xeb, 0xb8, 0xa1, 0x8d, 0xb6, 0x54,
1171         0x24, 0x3d, 0xd8, 0x24, 0xad, 0x5a, 0x28, 0x08, 0xc9, 0x71, 0x36, 0x89, 0x25, 0xc7, 0x89, 0xc6,
1172         0x0e, 0x29, 0x1c, 0x18, 0x4d, 0xec, 0xf1, 0x76, 0x25, 0x7b, 0x76, 0x99, 0x19, 0x87, 0xa6, 0x17,
1173         0x04, 0x57, 0x24, 0x2e, 0x88, 0x9e, 0x39, 0xf5, 0xca, 0x81, 0x0b, 0xbf, 0x81, 0x23, 0xfc, 0x05,
1174         0x7e, 0x04, 0x47, 0x34, 0x33, 0xbb, 0x8e, 0xed, 0xc4, 0x69, 0x2a, 0x15, 0x89, 0xdb, 0xce, 0xf3,
1175         0x7e, 0xcc, 0x33, 0xef, 0xbc, 0x1f, 0xb3, 0xb0, 0xe6, 0x87, 0xa1, 0xdf, 0x66, 0x85, 0x46, 0x3b,
1176         0xec, 0x36, 0x0b, 0x32, 0x62, 0xac, 0xf1, 0xac, 0x70, 0xb2, 0x6e, 0xd7, 0xc4, 0xae, 0xf3, 0x91,
1177         0x08, 0x55, 0x88, 0x6e, 0x58, 0xd5, 0xbc, 0x11, 0xe5, 0x63, 0xd1, 0xc9, 0x7a, 0x6e, 0x39, 0x76,
1178         0x41, 0xa3, 0xa0, 0x40, 0x39, 0x0f, 0x15, 0x55, 0x41, 0xc8, 0xa5, 0xb5, 0xca, 0xdd, 0x8d, 0xa5,
1179         0xed, 0x90, 0xfb, 0xa2, 0xcb, 0x79, 0xc0, 0xfd, 0x42, 0x18, 0x31, 0x31, 0xa0, 0xb4, 0x14, 0x2b,
1180         0x99, 0xd5, 0x71, 0xb7, 0x55, 0xa0, 0xfc, 0x34, 0x16, 0xdd, 0x1e, 0x16, 0x35, 0xbb, 0xd6, 0x36,
1181         0x96, 0xdf, 0x19, 0x96, 0xab, 0xa0, 0xc3, 0xa4, 0xa2, 0x9d, 0x28, 0x56, 0xb8, 0x19, 0x2b, 0x88,
1182         0xa8, 0x51, 0x90, 0x8a, 0xaa, 0x6e, 0xbc, 0xa9, 0xfb, 0xb3, 0x03, 0x19, 0xcc, 0x1a, 0xa1, 0xcf,
1183         0x83, 0x17, 0x0c, 0xb3, 0xaf, 0xbb, 0x4c, 0x2a, 0x54, 0x84, 0xc9, 0x46, 0xc8, 0x5b, 0x81, 0x9f,
1184         0x75, 0x56, 0x9c, 0xd5, 0x6b, 0x1b, 0x6b, 0xf9, 0x8b, 0x4f, 0x9d, 0x8f, 0x2d, 0x35, 0x93, 0x92,
1185         0x31, 0xc0, 0xb1, 0x21, 0xfa, 0x0c, 0xd2, 0xb4, 0xdb, 0x0c, 0xc2, 0xec, 0xb8, 0xf1, 0xb0, 0x7a,
1186         0x05, 0x0f, 0x45, 0xad, 0x8f, 0xad, 0x99, 0xfb, 0x8b, 0x03, 0xb7, 0x2a, 0x21, 0xf7, 0xb1, 0x8d,
1187         0xd6, 0xff, 0x91, 0xe2, 0xef, 0x0e, 0x2c, 0xd5, 0x94, 0x60, 0xb4, 0x73, 0x11, 0x41, 0x02, 0x19,
1188         0x99, 0x08, 0xc9, 0x00, 0xd5, 0x8d, 0x51, 0x1b, 0x0d, 0x3b, 0x3b, 0xe3, 0xbc, 0x3b, 0x86, 0x17,
1189         0x7a, 0xde, 0x2c, 0x84, 0xee, 0xc1, 0x9c, 0xe1, 0xa1, 0x9d, 0x2b, 0xc6, 0x95, 0x39, 0xc6, 0xec,
1190         0xee, 0x18, 0x9e, 0x35, 0x70, 0xc9, 0xa2, 0x9b, 0xef, 0xc0, 0xe2, 0x19, 0x0f, 0x61, 0xc9, 0xb9,
1191         0xbf, 0x39, 0x90, 0x1b, 0xbd, 0xdb, 0xdb, 0x08, 0xee, 0x1a, 0x64, 0x64, 0xc0, 0xfd, 0x36, 0x23,
1192         0x5d, 0xa5, 0x98, 0xa0, 0xbc, 0xc1, 0x0c, 0xc1, 0x69, 0xbc, 0x60, 0xf1, 0xc3, 0x04, 0x46, 0x1f,
1193         0xc0, 0x42, 0xc0, 0x15, 0x13, 0x41, 0x87, 0x08, 0x26, 0xbb, 0x6d, 0x25, 0xb3, 0x29, 0xa3, 0x39,
1194         0x1f, 0xc3, 0xd8, 0xa2, 0xee, 0xab, 0x09, 0x58, 0x3c, 0x4f, 0xb6, 0x06, 0xd3, 0x8c, 0x37, 0xc2,
1195         0x66, 0xc0, 0x2d, 0xdd, 0xf9, 0x8d, 0xc7, 0x57, 0xa6, 0x9b, 0x37, 0x17, 0xea, 0xc5, 0xe6, 0xb8,
1196         0xe7, 0x08, 0xdd, 0x87, 0x45, 0x49, 0x3b, 0x51, 0x9b, 0x11, 0x41, 0x15, 0x23, 0xcf, 0x98, 0x50,
1197         0x2f, 0x0c, 0xff, 0x34, 0x5e, 0xb0, 0x02, 0x4c, 0x15, 0xdb, 0xd5, 0x30, 0xba, 0x0b, 0x73, 0x6d,
1198         0xca, 0xfd, 0x2e, 0xf5, 0x19, 0x69, 0x84, 0x4d, 0x66, 0xd8, 0xcf, 0xe0, 0xd9, 0x04, 0x2c, 0x85,
1199         0x4d, 0xa6, 0xe3, 0xd1, 0xa1, 0xcf, 0x09, 0x6d, 0x2b, 0x26, 0x38, 0x55, 0xc1, 0x09, 0x93, 0xd9,
1200         0x09, 0xeb, 0xaf, 0x43, 0x9f, 0x17, 0xfb, 0x60, 0xad, 0x1a, 0x89, 0xb0, 0x45, 0x79, 0xa0, 0x4e,
1201         0x49, 0x2b, 0xd0, 0xa2, 0x6c, 0xda, 0x86, 0xae, 0x87, 0x6f, 0x1b, 0x18, 0x55, 0x61, 0xc1, 0x9e,
1202         0xce, 0x26, 0xc1, 0x73, 0x25, 0xb3, 0x93, 0x2b, 0xa9, 0xd5, 0x6b, 0x1b, 0xf7, 0x46, 0xe6, 0x98,
1203         0xf9, 0x2a, 0x59, 0x6d, 0x3c, 0x2f, 0xfb, 0x97, 0x12, 0x3d, 0x86, 0x2c, 0xe3, 0xf4, 0xb8, 0xcd,
1204         0xc8, 0x37, 0xa1, 0x68, 0x12, 0xdd, 0x45, 0x48, 0xd8, 0x6a, 0x49, 0xa6, 0x64, 0x76, 0xda, 0x50,
1205         0x78, 0xd7, 0xca, 0x8f, 0x42, 0xd1, 0xac, 0x07, 0x1d, 0xb6, 0x6f, 0x85, 0xee, 0x0f, 0x0e, 0xcc,
1206         0x0d, 0xc4, 0x12, 0x65, 0xe1, 0xba, 0x57, 0x2d, 0xed, 0x6f, 0x95, 0xab, 0x3b, 0xe4, 0xb0, 0x5a,
1207         0x3b, 0xf0, 0x4a, 0xe5, 0xed, 0xb2, 0xb7, 0x95, 0x19, 0x43, 0xb3, 0x30, 0x5d, 0x29, 0x57, 0xbd,
1208         0x22, 0x5e, 0x7f, 0x94, 0x71, 0xd0, 0x34, 0x4c, 0x6c, 0x57, 0x8a, 0xa5, 0xcc, 0x38, 0x9a, 0x81,
1209         0xf4, 0xde, 0x61, 0xa5, 0x78, 0x94, 0x49, 0xa1, 0x29, 0x48, 0x15, 0xf7, 0x70, 0x66, 0x02, 0x01,
1210         0x4c, 0x16, 0xf7, 0x30, 0x39, 0xda, 0xcc, 0xa4, 0xb5, 0xdd, 0xfe, 0xce, 0x0e, 0xd9, 0x3f, 0x38,
1211         0xac, 0x65, 0x26, 0x51, 0x0e, 0x6e, 0xd4, 0x0e, 0x3c, 0xef, 0x29, 0x39, 0x2a, 0xd7, 0x77, 0xc9,
1212         0xae, 0x57, 0xdc, 0xf2, 0x30, 0xd9, 0xfc, 0xa2, 0xee, 0x65, 0xa6, 0xdc, 0x35, 0x98, 0x1b, 0x38,
1213         0x27, 0xca, 0xc2, 0x54, 0xf4, 0x4c, 0x50, 0xc9, 0x64, 0xd6, 0x59, 0x49, 0xad, 0xce, 0xe0, 0x64,
1214         0xe9, 0xe2, 0x5e, 0xfb, 0xeb, 0xd5, 0x37, 0xca, 0xc1, 0x54, 0x52, 0x53, 0x4e, 0x5c, 0x53, 0x09,
1215         0x80, 0x10, 0xa4, 0xba, 0x22, 0x30, 0xa9, 0x30, 0xb3, 0x3b, 0x86, 0xf5, 0x62, 0x73, 0x1e, 0x6c,
1216         0xc9, 0x11, 0x19, 0x76, 0x45, 0x83, 0xb9, 0x5f, 0xf5, 0xd2, 0x54, 0xb7, 0x03, 0x19, 0x85, 0x5c,
1217         0x32, 0x54, 0x86, 0xa9, 0x24, 0xbb, 0xc7, 0xcd, 0x15, 0x15, 0x2e, 0xbf, 0xa2, 0x3e, 0x56, 0x36,
1218         0xff, 0x71, 0x62, 0xef, 0x06, 0xb0, 0x7c, 0x71, 0x6b, 0x7c, 0xfb, 0x5b, 0xfd, 0xe1, 0x5c, 0xbc,
1219         0xd7, 0x1e, 0x53, 0xb4, 0x49, 0x15, 0x8d, 0x93, 0xd5, 0x17, 0x4c, 0x4a, 0x12, 0x31, 0xd1, 0x48,
1220         0x82, 0x96, 0x36, 0xc9, 0x6a, 0xf0, 0x03, 0x0b, 0xa3, 0x8f, 0x01, 0xa4, 0xa2, 0x42, 0x99, 0xb4,
1221         0x8a, 0x9b, 0x6e, 0x2e, 0x61, 0x96, 0x4c, 0xae, 0x7c, 0x3d, 0x99, 0x5c, 0x78, 0xc6, 0x68, 0xeb,
1222         0x35, 0xda, 0x82, 0x4c, 0x9b, 0x4a, 0x45, 0xba, 0x51, 0x53, 0x97, 0xa3, 0x71, 0x90, 0x7a, 0xad,
1223         0x83, 0x79, 0x6d, 0x73, 0x68, 0x4c, 0x34, 0xe8, 0xfe, 0x39, 0x7e, 0xbe, 0xeb, 0xf5, 0x85, 0x6d,
1224         0x15, 0xd2, 0x4c, 0x88, 0x50, 0xc4, 0x4d, 0x0f, 0x25, 0x9e, 0x45, 0xd4, 0xc8, 0xd7, 0xcc, 0xcc,
1225         0xc4, 0x56, 0x01, 0x55, 0x86, 0x03, 0xfc, 0x46, 0x2d, 0x7d, 0x28, 0xc6, 0x88, 0xc3, 0x62, 0x5c,
1226         0xc4, 0xec, 0x84, 0x71, 0x45, 0xd4, 0x69, 0xc4, 0x4c, 0x6f, 0x98, 0xdf, 0xd8, 0xbc, 0xaa, 0xdf,
1227         0xb3, 0x63, 0xc4, 0x77, 0xea, 0x69, 0x57, 0xf5, 0xd3, 0x88, 0xe1, 0xb8, 0x43, 0xf4, 0x00, 0xb7,
1228         0x02, 0x0b, 0x43, 0x3a, 0x68, 0x19, 0xb2, 0xba, 0x98, 0x4a, 0xbb, 0xc4, 0xfb, 0xdc, 0xab, 0xd6,
1229         0x87, 0x0a, 0xf6, 0x16, 0xdc, 0xf4, 0xaa, 0x5b, 0x64, 0x7f, 0x9b, 0xd4, 0xca, 0xd5, 0x9d, 0x8a,
1230         0x47, 0x0e, 0xeb, 0x75, 0x0f, 0x17, 0xab, 0x25, 0x2f, 0xe3, 0xb8, 0xbf, 0x8e, 0x18, 0x25, 0xf6,
1231         0x94, 0xe8, 0x29, 0xcc, 0x0e, 0xf4, 0x3c, 0xc7, 0xc4, 0xeb, 0xe1, 0x95, 0x13, 0xb2, 0xaf, 0x33,
1232         0xe2, 0x01, 0x4f, 0x68, 0x09, 0xa6, 0x03, 0x49, 0x5a, 0x01, 0xa7, 0xed, 0x78, 0xb2, 0x4c, 0x05,
1233         0x72, 0x5b, 0x2f, 0xd1, 0x32, 0xe8, 0xdc, 0x39, 0x0e, 0xda, 0x81, 0x3a, 0x35, 0x79, 0x32, 0x8e,
1234         0xcf, 0x00, 0x57, 0xc2, 0xcd, 0x11, 0x79, 0xff, 0xdf, 0xb1, 0x75, 0x5f, 0x3a, 0xb0, 0x7c, 0x99,
1235         0x3a, 0xba, 0x0d, 0xa0, 0x04, 0xe5, 0xb2, 0x21, 0x82, 0xc8, 0x96, 0xd0, 0x0c, 0xee, 0x43, 0xb4,
1236         0xdc, 0x8c, 0xd6, 0x26, 0x4b, 0x46, 0xe9, 0x38, 0xee, 0x43, 0xd0, 0x23, 0x48, 0xeb, 0x9e, 0xad,
1237         0x67, 0xa7, 0xe6, 0xbc, 0x32, 0x8a, 0xb3, 0xee, 0xdc, 0x65, 0xde, 0x0a, 0xb1, 0x55, 0x77, 0x7f,
1238         0x74, 0x60, 0x3a, 0xc1, 0xd0, 0x47, 0x03, 0x25, 0x6a, 0xeb, 0x60, 0xe9, 0x5c, 0x85, 0x6d, 0xc5,
1239         0x8f, 0xcf, 0xfe, 0x0a, 0x7d, 0xa8, 0xa7, 0x70, 0xb3, 0xbf, 0xb4, 0x2f, 0xb1, 0x9b, 0x62, 0xdc,
1240         0x4c, 0x0f, 0x84, 0x60, 0x42, 0xb3, 0x88, 0x27, 0xa6, 0xf9, 0xde, 0x78, 0x95, 0x82, 0x49, 0x1b,
1241         0x29, 0xf4, 0x9d, 0x03, 0x33, 0xbd, 0x04, 0x47, 0xaf, 0x7b, 0xa0, 0xf5, 0xde, 0x5e, 0xb9, 0xb5,
1242         0x2b, 0x68, 0xda, 0x6a, 0x71, 0xef, 0x7c, 0xff, 0xd7, 0xdf, 0x3f, 0x8d, 0x2f, 0xb9, 0xd7, 0xf5,
1243         0x7b, 0xdf, 0x2a, 0x3e, 0x11, 0x89, 0xd6, 0x13, 0xe7, 0x3e, 0x7a, 0xe9, 0xc0, 0xf5, 0x8b, 0x3a,
1244         0x20, 0x7a, 0x30, 0x6a, 0x93, 0x4b, 0x9e, 0xad, 0xb9, 0xf7, 0x12, 0xa3, 0xbe, 0x3f, 0x81, 0xfc,
1245         0x7e, 0xf2, 0x27, 0xe0, 0xde, 0x37, 0x6c, 0xde, 0x77, 0xef, 0xf4, 0xb1, 0xe9, 0xd3, 0x1c, 0x20,
1246         0xf6, 0x2d, 0xa0, 0xf3, 0x5d, 0x00, 0xad, 0xbf, 0x49, 0xc7, 0xb0, 0x9c, 0x36, 0xde, 0xbc, 0xc9,
1247         0xac, 0x3a, 0x1f, 0x3a, 0x9b, 0x6d, 0xc8, 0x35, 0xc2, 0xce, 0x08, 0xe3, 0xcd, 0x6b, 0xf6, 0x0e,
1248         0x0f, 0xf4, 0xe5, 0x1f, 0x38, 0x5f, 0x7e, 0x1a, 0xab, 0xf9, 0xa1, 0x7e, 0x16, 0xe5, 0x43, 0xe1,
1249         0x17, 0x7c, 0xc6, 0x4d, 0x6a, 0x14, 0xac, 0x88, 0x46, 0x81, 0x1c, 0xfe, 0x03, 0xfb, 0xc4, 0x7e,
1250         0xfd, 0xe3, 0x38, 0xc7, 0x93, 0x46, 0xf7, 0xc1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x52, 0x28,
1251         0xae, 0xd1, 0xac, 0x0d, 0x00, 0x00,
1252 }