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

content / public / browser / google_streaming_api.proto [blame]

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";
option optimize_for = LITE_RUNTIME;

// TODO(hans): Commented out due to compilation errors.
// option cc_api_version = 2;

package content.proto;

// SpeechRecognitionEvent is the only message type sent to client.
//
// The first SpeechRecognitionEvent is an empty (default) message to indicate
// as early as possible that the stream connection has been established.
message SpeechRecognitionEvent {
  enum StatusCode {
    // Note: in JavaScript API SpeechRecognitionError 0 is "OTHER" error.
    STATUS_SUCCESS = 0;
    STATUS_NO_SPEECH = 1;
    STATUS_ABORTED = 2;
    STATUS_AUDIO_CAPTURE = 3;
    STATUS_NETWORK = 4;
    STATUS_NOT_ALLOWED = 5;
    STATUS_SERVICE_NOT_ALLOWED = 6;
    STATUS_BAD_GRAMMAR = 7;
    STATUS_LANGUAGE_NOT_SUPPORTED = 8;
  }
  optional StatusCode status = 1 [default = STATUS_SUCCESS];

  // May contain zero or one final=true result (the newly settled portion).
  // May also contain zero or more final=false results.
  // (Note that this differs from JavaScript API resultHistory in that no more
  // than one final=true result is returned, so client must accumulate
  // resultHistory by concatenating the final=true results.)
  repeated SpeechRecognitionResult result = 2;

  enum EndpointerEventType {
    START_OF_SPEECH = 0;
    END_OF_SPEECH = 1;
    END_OF_AUDIO = 2;  // End of audio stream has been reached.
    // End of utterance indicates that no more speech segments are expected.
    END_OF_UTTERANCE = 3;
  }

  optional EndpointerEventType endpoint = 4;
};

message SpeechRecognitionResult {
  repeated SpeechRecognitionAlternative alternative = 1;

  // True if this is the final time the speech service will return this
  // particular SpeechRecognitionResult. If false, then this represents an
  // interim result that could still be changed.
  optional bool final = 2 [default = false];

  // An estimate of the probability that the recognizer will not change its
  // guess about this interim result.  Values range from 0.0 (completely
  // unstable) to 1.0 (completely stable).  Note that this is not the same as
  // "confidence", which estimate the probability that a recognition result
  // is correct. This field is only provided for interim (final=false) results.
  optional float stability = 3;
};

// Item in N-best list.
message SpeechRecognitionAlternative {
  // Spoken text.
  optional string transcript = 1;

  // The confidence estimate between 0.0 and 1.0.  A higher number means the
  // system is more confident that the recognition is correct.
  // This field is typically provided only for the top hypothesis and only for
  // final results.
  optional float confidence = 2;
}