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