diff --git a/google/cloud/speech/v1/cloud_speech.proto b/google/cloud/speech/v1/cloud_speech.proto index afca4d57f..97dd86296 100644 --- a/google/cloud/speech/v1/cloud_speech.proto +++ b/google/cloud/speech/v1/cloud_speech.proto @@ -19,6 +19,10 @@ package google.cloud.speech.v1; import "google/api/annotations.proto"; import "google/rpc/status.proto"; +option java_multiple_files = true; +option java_outer_classname = "SpeechProto"; +option java_package = "com.google.cloud.speech.v1"; + // Service that implements Google Cloud Speech API. service Speech { @@ -51,7 +55,7 @@ message RecognizeRequest { // The audio data to be recognized. For `NonStreamingRecognize`, all the // audio data must be contained in the first (and only) `RecognizeRequest` - // message. For streaming `Recognize`, sequential chunks of audio data are + // message. For streaming `Recognize`, sequential chunks of audio data are // sent in sequential `RecognizeRequest` messages. AudioRequest audio_request = 2; } @@ -61,7 +65,7 @@ message RecognizeRequest { message InitialRecognizeRequest { // Audio encoding of the data sent in the audio message. enum AudioEncoding { - // Not specified. Will return result `INVALID_ARGUMENT`. + // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. ENCODING_UNSPECIFIED = 0; // Uncompressed 16-bit signed little-endian samples. @@ -115,8 +119,6 @@ message InitialRecognizeRequest { // 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. - // Note that profanity filtering is not implemented for all languages. - // If the language is not supported, this setting has no effect. bool profanity_filter = 5; // [Optional] If `false` or omitted, the recognizer will detect a single @@ -143,13 +145,38 @@ message InitialRecognizeRequest { // as they become available. // If `false` or omitted, no `EndpointerEvents` are returned. bool enable_endpointer_events = 8; + + // [Optional] URI that points to a file where the recognition result should + // be stored in JSON format. If omitted or empty string, the recognition + // result is returned in the response. Should be specified only for + // `NonStreamingRecognize`. If specified in a `Recognize` request, + // `Recognize` returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + // If specified in a `NonStreamingRecognize` request, + // `NonStreamingRecognize` returns immediately, and the output file + // is created asynchronously once the audio processing completes. + // Currently, only Google Cloud Storage URIs are supported, which must be + // specified in the following format: `gs://bucket_name/object_name` + // (other URI formats return [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request URIs](/storage/docs/reference-uris). + string output_uri = 9; } // Contains audio data in the format specified in the `InitialRecognizeRequest`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. message AudioRequest { - // [Required] The audio data bytes encoded as specified in - // `InitialRecognizeRequest`. + // The audio data bytes encoded as specified in + // `InitialRecognizeRequest`. Note: as with all bytes fields, protobuffers + // use a pure binary representation, whereas JSON representations use base64. bytes content = 1; + + // URI that points to a file that contains audio data bytes as specified in + // `InitialRecognizeRequest`. Currently, only Google Cloud Storage URIs are + // supported, which must be specified in the following format: + // `gs://bucket_name/object_name` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](/storage/docs/reference-uris). + string uri = 2; } // `NonStreamingRecognizeResponse` is the only message returned to the client by @@ -190,8 +217,12 @@ message RecognizeResponse { // specifies the error for the operation. google.rpc.Status error = 1; - // [Output-only] May contain zero or one `is_final=true` result (the newly - // settled portion). May also contain zero or more `is_final=false` results. + // [Output-only] For `continuous=false`, this repeated list contains zero or + // one result that corresponds to all of the audio processed so far. For + // `continuous=true`, this repeated list contains zero or more results that + // correspond to consecutive portions of the audio being processed. + // In both cases, contains zero or one `is_final=true` result (the newly + // settled portion), followed by zero or more `is_final=false` results. repeated SpeechRecognitionResult results = 2; // [Output-only] Indicates the lowest index in the `results` array that has @@ -203,7 +234,10 @@ message RecognizeResponse { EndpointerEvent endpoint = 4; } +// A speech recognition result corresponding to a portion of the audio. message SpeechRecognitionResult { + // [Output-only] May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). repeated SpeechRecognitionAlternative alternatives = 1; // [Output-only] Set `true` if this is the final time the speech service will