OSDN Git Service

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