Skip to content

Commit b38aab7

Browse files
Google APIscopybara-github
authored andcommitted
docs: updated description of sample_rate_hertz
feat: add denoiser related configuration PiperOrigin-RevId: 769585786
1 parent ad56690 commit b38aab7

5 files changed

Lines changed: 24 additions & 6 deletions

File tree

google/cloud/speech/v1/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ load(
348348

349349
csharp_proto_library(
350350
name = "speech_csharp_proto",
351-
extra_opts = [],
352351
deps = [":speech_proto"],
353352
)
354353

google/cloud/speech/v1p1beta1/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ load(
348348

349349
csharp_proto_library(
350350
name = "speech_csharp_proto",
351-
extra_opts = [],
352351
deps = [":speech_proto"],
353352
)
354353

google/cloud/speech/v2/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ load(
348348

349349
csharp_proto_library(
350350
name = "speech_csharp_proto",
351+
extra_opts = [],
351352
deps = [":speech_proto"],
352353
)
353354

google/cloud/speech/v2/cloud_speech.proto

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,9 @@ message ExplicitDecodingConfig {
762762
AudioEncoding encoding = 1 [(google.api.field_behavior) = REQUIRED];
763763

764764
// Optional. Sample rate in Hertz of the audio data sent for recognition.
765-
// Valid values are: 8000-48000. 16000 is optimal. For best results, set the
766-
// sampling rate of the audio source to 16000 Hz. If that's not possible, use
767-
// the native sample rate of the audio source (instead of re-sampling).
765+
// Valid values are: 8000-48000, and 16000 is optimal. For best results, set
766+
// the sampling rate of the audio source to 16000 Hz. If that's not possible,
767+
// use the native sample rate of the audio source (instead of resampling).
768768
// Note that this field is marked as OPTIONAL for backward compatibility
769769
// reasons. It is (and has always been) effectively REQUIRED.
770770
int32 sample_rate_hertz = 2 [(google.api.field_behavior) = OPTIONAL];
@@ -921,6 +921,21 @@ message SpeechAdaptation {
921921
repeated CustomClass custom_classes = 2;
922922
}
923923

924+
// Denoiser config. May not be supported for all models and may
925+
// have no effect.
926+
message DenoiserConfig {
927+
// Denoise audio before sending to the transcription model.
928+
bool denoise_audio = 1;
929+
930+
// Signal-to-Noise Ratio (SNR) threshold for the denoiser. Here SNR means the
931+
// loudness of the speech signal. Audio with an SNR below this threshold,
932+
// meaning the speech is too quiet, will be prevented from being sent to the
933+
// transcription model.
934+
//
935+
// If snr_threshold=0, no filtering will be applied.
936+
float snr_threshold = 2;
937+
}
938+
924939
// Provides information to the Recognizer that specifies how to process the
925940
// recognition request.
926941
message RecognitionConfig {
@@ -977,6 +992,10 @@ message RecognitionConfig {
977992
// the given audio to the desired language for supported models.
978993
TranslationConfig translation_config = 15
979994
[(google.api.field_behavior) = OPTIONAL];
995+
996+
// Optional. Optional denoiser config. May not be supported for all models
997+
// and may have no effect.
998+
DenoiserConfig denoiser_config = 16 [(google.api.field_behavior) = OPTIONAL];
980999
}
9811000

9821001
// Request message for the

google/cloud/speech/v2/locations_metadata.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ option java_multiple_files = true;
2121
option java_outer_classname = "LocationsMetadataProto";
2222
option java_package = "com.google.cloud.speech.v2";
2323

24-
// Representes a singular feature of a model. If the feature is `recognizer`,
24+
// Represents a singular feature of a model. If the feature is `recognizer`,
2525
// the release_state of the feature represents the release_state of the model
2626
message ModelFeature {
2727
// The name of the feature (Note: the feature can be `recognizer`)

0 commit comments

Comments
 (0)