Skip to content

Commit

Permalink
feat: add result_end_time to SpeechRecognitionResult (#825)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 413728495
Source-Link: googleapis/googleapis@10f96cb
Source-Link: googleapis/googleapis-gen@f464864
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjQ2NDg2NDI5MmViNmIwNTVmMWUxZDg0MDhhZmY4NzgxN2NjYTY0YyJ9
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Ching <chingor@google.com>
Co-authored-by: nicain <nicain.seattle@gmail.com>
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
  • Loading branch information
5 people authored Dec 30, 2021
1 parent df47bcb commit 4a99596
Show file tree
Hide file tree
Showing 17 changed files with 301 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ message RecognitionConfig {
// a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
// recognition can be reduced if lossy codecs are used to capture or transmit
// audio, particularly if background noise is present. Lossy codecs include
// `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`.
// `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`,
// and `WEBM_OPUS`.
//
// The `FLAC` and `WAV` audio file formats include a header that describes the
// included audio content. You can request recognition for `WAV` files that
Expand Down Expand Up @@ -245,9 +246,8 @@ message RecognitionConfig {
MP3 = 8;

// Opus encoded audio frames in WebM container
// ([OggOpus](https://wiki.xiph.org/OggOpus)). This is a Beta features and
// only available in v1p1beta1. `sample_rate_hertz` must be one of 8000,
// 12000, 16000, 24000, or 48000.
// ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
// one of 8000, 12000, 16000, 24000, or 48000.
WEBM_OPUS = 9;
}

Expand Down Expand Up @@ -321,10 +321,10 @@ message RecognitionConfig {
bool profanity_filter = 5;

// Speech adaptation configuration improves the accuracy of speech
// recognition. When speech adaptation is set it supersedes the
// `speech_contexts` field. For more information, see the [speech
// recognition. For more information, see the [speech
// adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
// documentation.
// When speech adaptation is set it supersedes the `speech_contexts` field.
SpeechAdaptation adaptation = 20;

// Use transcription normalization to automatically replace parts of the
Expand Down Expand Up @@ -837,6 +837,10 @@ message SpeechRecognitionResult {
// For audio_channel_count = N, its output values can range from '1' to 'N'.
int32 channel_tag = 2;

// Time offset of the end of this result relative to the
// beginning of the audio.
google.protobuf.Duration result_end_time = 4;

// Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
// of the language in this result. This language code was detected to have
// the most likelihood of being spoken in the audio.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,15 @@ service Adaptation {

// Message sent by the client for the `CreatePhraseSet` method.
message CreatePhraseSetRequest {
// Required. The parent resource where this phrase set will be created.
// Format:
// {api_version}/projects/{project}/locations/{location}/phraseSets
// Required. The parent resource where this phrase set will be created. Format:
//
// `projects/{project}/locations/{location}/phraseSets`
//
// Speech-to-Text supports three locations: `global`, `us` (US North America),
// and `eu` (Europe). If you are calling the `speech.googleapis.com`
// endpoint, use the `global` location. To specify a region, use a
// [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
// `eu` location value.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -152,7 +158,14 @@ message UpdatePhraseSetRequest {
//
// The phrase set's `name` field is used to identify the set to be
// updated. Format:
// {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
//
// `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
//
// Speech-to-Text supports three locations: `global`, `us` (US North America),
// and `eu` (Europe). If you are calling the `speech.googleapis.com`
// endpoint, use the `global` location. To specify a region, use a
// [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
// `eu` location value.
PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED];

// The list of fields to be updated.
Expand All @@ -161,9 +174,15 @@ message UpdatePhraseSetRequest {

// Message sent by the client for the `GetPhraseSet` method.
message GetPhraseSetRequest {
// Required. The name of the phrase set to retrieve.
// Format:
// {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
// Required. The name of the phrase set to retrieve. Format:
//
// `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
//
// Speech-to-Text supports three locations: `global`, `us` (US North America),
// and `eu` (Europe). If you are calling the `speech.googleapis.com`
// endpoint, use the `global` location. To specify a region, use a
// [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
// `eu` location value.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -174,9 +193,15 @@ message GetPhraseSetRequest {

// Message sent by the client for the `ListPhraseSet` method.
message ListPhraseSetRequest {
// Required. The parent, which owns this collection of phrase set.
// Format:
// projects/{project}/locations/{location}
// Required. The parent, which owns this collection of phrase set. Format:
//
// `projects/{project}/locations/{location}`
//
// Speech-to-Text supports three locations: `global`, `us` (US North America),
// and `eu` (Europe). If you are calling the `speech.googleapis.com`
// endpoint, use the `global` location. To specify a region, use a
// [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
// `eu` location value.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -210,9 +235,9 @@ message ListPhraseSetResponse {

// Message sent by the client for the `DeletePhraseSet` method.
message DeletePhraseSetRequest {
// Required. The name of the phrase set to delete.
// Format:
// {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
// Required. The name of the phrase set to delete. Format:
//
// `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -223,9 +248,15 @@ message DeletePhraseSetRequest {

// Message sent by the client for the `CreateCustomClass` method.
message CreateCustomClassRequest {
// Required. The parent resource where this custom class will be created.
// Format:
// {api_version}/projects/{project}/locations/{location}/customClasses
// Required. The parent resource where this custom class will be created. Format:
//
// `projects/{project}/locations/{location}/customClasses`
//
// Speech-to-Text supports three locations: `global`, `us` (US North America),
// and `eu` (Europe). If you are calling the `speech.googleapis.com`
// endpoint, use the `global` location. To specify a region, use a
// [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
// `eu` location value.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -250,7 +281,14 @@ message UpdateCustomClassRequest {
//
// The custom class's `name` field is used to identify the custom class to be
// updated. Format:
// {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
//
// `projects/{project}/locations/{location}/customClasses/{custom_class}`
//
// Speech-to-Text supports three locations: `global`, `us` (US North America),
// and `eu` (Europe). If you are calling the `speech.googleapis.com`
// endpoint, use the `global` location. To specify a region, use a
// [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
// `eu` location value.
CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED];

// The list of fields to be updated.
Expand All @@ -259,9 +297,9 @@ message UpdateCustomClassRequest {

// Message sent by the client for the `GetCustomClass` method.
message GetCustomClassRequest {
// Required. The name of the custom class to retrieve.
// Format:
// {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
// Required. The name of the custom class to retrieve. Format:
//
// `projects/{project}/locations/{location}/customClasses/{custom_class}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -272,9 +310,15 @@ message GetCustomClassRequest {

// Message sent by the client for the `ListCustomClasses` method.
message ListCustomClassesRequest {
// Required. The parent, which owns this collection of custom classes.
// Format:
// {api_version}/projects/{project}/locations/{location}/customClasses
// Required. The parent, which owns this collection of custom classes. Format:
//
// `projects/{project}/locations/{location}/customClasses`
//
// Speech-to-Text supports three locations: `global`, `us` (US North America),
// and `eu` (Europe). If you are calling the `speech.googleapis.com`
// endpoint, use the `global` location. To specify a region, use a
// [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
// `eu` location value.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -308,9 +352,15 @@ message ListCustomClassesResponse {

// Message sent by the client for the `DeleteCustomClass` method.
message DeleteCustomClassRequest {
// Required. The name of the custom class to delete.
// Format:
// {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
// Required. The name of the custom class to delete. Format:
//
// `projects/{project}/locations/{location}/customClasses/{custom_class}`
//
// Speech-to-Text supports three locations: `global`, `us` (US North America),
// and `eu` (Europe). If you are calling the `speech.googleapis.com`
// endpoint, use the `global` location. To specify a region, use a
// [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
// `eu` location value.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ message PhraseSet {
// resources and inline classes. Then use the class' id wrapped in $`{...}`
// e.g. "${my-months}". To refer to custom classes resources, use the class'
// id wrapped in `${}` (e.g. `${my-months}`).
//
// Speech-to-Text supports three locations: `global`, `us` (US North America),
// and `eu` (Europe). If you are calling the `speech.googleapis.com`
// endpoint, use the `global` location. To specify a region, use a
// [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
// `eu` location value.
message Phrase {
// The phrase itself.
string value = 1;
Expand All @@ -88,9 +94,8 @@ message PhraseSet {
// Positive value will increase the probability that a specific phrase will
// be recognized over other similar sounding phrases. The higher the boost,
// the higher the chance of false positive recognition as well. Negative
// boost values would correspond to anti-biasing. Anti-biasing is not
// enabled, so negative boost will simply be ignored. Though `boost` can
// accept a wide range of positive values, most use cases are best served
// boost will simply be ignored. Though `boost` can accept a wide range of
// positive values, most use cases are best served
// with values between 0 and 20. We recommend using a binary search approach
// to finding the optimal value for your use case. Speech recognition
// will skip PhraseSets with a boost value of 0.
Expand Down
6 changes: 6 additions & 0 deletions packages/google-cloud-node/protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions packages/google-cloud-node/protos/protos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/google-cloud-node/protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ function main(parent, customClassId, customClass) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource where this custom class will be created.
* Format:
* {api_version}/projects/{project}/locations/{location}/customClasses
* Required. The parent resource where this custom class will be created. Format:
* `projects/{project}/locations/{location}/customClasses`
* Speech-to-Text supports three locations: `global`, `us` (US North America),
* and `eu` (Europe). If you are calling the `speech.googleapis.com`
* endpoint, use the `global` location. To specify a region, use a
* regional endpoint (/speech-to-text/docs/endpoints) with matching `us` or
* `eu` location value.
*/
// const parent = 'abc123'
/**
Expand Down
Loading

0 comments on commit 4a99596

Please sign in to comment.