1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 option optimize_for = LITE_RUNTIME;
8 // TODO(hans): Commented out due to compilation errors.
9 // option cc_api_version = 2;
11 package content.proto;
13 // SpeechRecognitionEvent is the only message type sent to client.
15 // The first SpeechRecognitionEvent is an empty (default) message to indicate
16 // as early as possible that the stream connection has been established.
17 message SpeechRecognitionEvent {
19 // Note: in JavaScript API SpeechRecognitionError 0 is "OTHER" error.
23 STATUS_AUDIO_CAPTURE = 3;
25 STATUS_NOT_ALLOWED = 5;
26 STATUS_SERVICE_NOT_ALLOWED = 6;
27 STATUS_BAD_GRAMMAR = 7;
28 STATUS_LANGUAGE_NOT_SUPPORTED = 8;
30 optional StatusCode status = 1 [default = STATUS_SUCCESS];
32 // May contain zero or one final=true result (the newly settled portion).
33 // May also contain zero or more final=false results.
34 // (Note that this differs from JavaScript API resultHistory in that no more
35 // than one final=true result is returned, so client must accumulate
36 // resultHistory by concatenating the final=true results.)
37 repeated SpeechRecognitionResult result = 2;
40 message SpeechRecognitionResult {
41 repeated SpeechRecognitionAlternative alternative = 1;
43 // True if this is the final time the speech service will return this
44 // particular SpeechRecognitionResult. If false, then this represents an
45 // interim result that could still be changed.
46 optional bool final = 2 [default = false];
48 // An estimate of the probability that the recognizer will not change its
49 // guess about this interim result. Values range from 0.0 (completely
50 // unstable) to 1.0 (completely stable). Note that this is not the same as
51 // "confidence", which estimate the probability that a recognition result
52 // is correct. This field is only provided for interim (final=false) results.
53 optional float stability = 3;
56 // Item in N-best list.
57 message SpeechRecognitionAlternative {
59 optional string transcript = 1;
61 // The confidence estimate between 0.0 and 1.0. A higher number means the
62 // system is more confident that the recognition is correct.
63 // This field is typically provided only for the top hypothesis and only for
65 optional float confidence = 2;