-
Notifications
You must be signed in to change notification settings - Fork 13
/
speech-recognition-open-api.proto
184 lines (166 loc) · 3.53 KB
/
speech-recognition-open-api.proto
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
syntax = "proto3";
package ekstep.speech_recognition;
option java_multiple_files = true;
option java_outer_classname = "SpeechRecognitionProto";
option java_package = "com.ekstep.endpoints.speech_recognition";
import "google/api/annotations.proto";
service SpeechRecognizer {
rpc recognize_audio(stream Message) returns (stream Response) {}
rpc punctuate(PunctuateRequest) returns (PunctuateResponse) {
option (google.api.http) = {post: "/v1/punctuate/{language}", body: "*"};
}
rpc recognize (SpeechRecognitionRequest) returns (SpeechRecognitionResult) {
option (google.api.http) = {post: "/v1/recognize/{config.language.sourceLanguage}", body: "*"};
}
}
message Message {
bytes audio = 1;
string user = 2;
string language = 3;
bool speaking = 4;
bool isEnd = 5;
}
message Response {
string transcription = 1;
string user = 2;
string language = 3;
string action = 4;
}
message SpeechRecognitionRequest {
RecognitionConfig config = 1;
repeated RecognitionAudio audio = 2;
}
message RecognitionConfig {
message TranscriptionFormat{
TranscriptionFormatEnum value = 1;
}
enum TranscriptionFormatEnum {
transcript = 0;
srt = 1;
alternatives = 2;
}
enum AudioBitsPerSample {
sixteen = 0;
eight = 1;
}
enum AudioChannel {
mono = 0;
stereo = 1;
}
enum AudioFormat {
wav = 0;
pcm = 1;
mp3 = 2;
flac = 3;
}
enum Domain {
GENERAL = 0;
NEWS = 1;
EDUCATION = 2 ;
LEGAL = 3 ;
GOVERNMENT_PRESS_RELEASE = 4;
HEALTHCARE = 5;
MOVIES = 6;
SUBTITLES = 7;
SPORTS = 8;
}
enum Model {
command_and_search = 0;
phone_call = 1;
video = 2;
default = 3;
}
Language language = 1;
optional AudioFormat audioFormat = 2;
optional AudioChannel channel = 3;
optional int64 samplingRate = 4;
optional AudioBitsPerSample bitsPerSample = 5;
optional TranscriptionFormat transcriptionFormat = 6;
optional bool profanityFilter = 7;
repeated Domain domain = 8;
optional bool detailed = 9;
optional bool punctuation = 10;
optional Model model = 11;
// optional bool enableAutomaticPunctuation = 12;
optional bool enableInverseTextNormalization = 12;
}
message Language {
enum LanguageCode {
hi = 0;
en = 1;
mr = 2;
ta = 3 ;
te = 4;
kn = 5;
gu = 6;
pa = 7;
bn = 8;
ml = 9;
as = 10;
brx = 11;
doi = 12;
ks = 13;
kok = 14;
mai = 15;
mni = 16;
ne = 17;
or = 18;
sd = 19;
si = 20;
ur = 21;
sat = 23;
lus = 24;
njz = 25;
pnr = 26;
kha = 27;
grt = 28;
sa = 29;
raj = 30;
bho = 31;
en_bio = 32;
hi_en = 33;
}
optional string name = 1;
LanguageCode sourceLanguage = 2;
}
message RecognitionAudio {
optional string audioUri = 1;
optional bytes audioContent = 2;
}
message SpeechRecognitionResult {
enum Status {
SUCCESS = 0;
NO_MATCH = 1;
INITIAL_SILENCE_TIMEOUT = 2;
BABBLE_TIMEOUT = 3;
ERROR = 4;
}
message Output{
string source = 1;
}
Status status = 1;
repeated Output output = 2;
optional RecognitionDetails config = 3;
optional string status_text = 4;
}
message RecognitionDetails {
int32 channelTag = 1;
Language language = 2;
int32 snr = 3;
int32 samplingRate = 4;
int32 bitsPerSample = 5;
}
message Alternative {
string word = 1;
string startTime = 2;
string endTime = 3;
}
message PunctuateRequest {
string text = 1;
string language = 2;
bool enabledItn = 3;
}
message PunctuateResponse {
string text = 1;
string language = 2;
}