#[non_exhaustive]pub struct ExplicitDecodingConfig {
pub encoding: AudioEncoding,
pub sample_rate_hertz: i32,
pub audio_channel_count: i32,
/* private fields */
}Expand description
Explicitly specified decoding parameters.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.encoding: AudioEncodingRequired. Encoding of the audio data sent for recognition.
sample_rate_hertz: i32Optional. Sample rate in Hertz of the audio data sent for recognition. Valid values are: 8000-48000, and 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that’s not possible, use the native sample rate of the audio source (instead of resampling). Note that this field is marked as OPTIONAL for backward compatibility reasons. It is (and has always been) effectively REQUIRED.
audio_channel_count: i32Optional. Number of channels present in the audio data sent for recognition. Note that this field is marked as OPTIONAL for backward compatibility reasons. It is (and has always been) effectively REQUIRED.
The maximum allowed value is 8.
Implementations§
Source§impl ExplicitDecodingConfig
impl ExplicitDecodingConfig
pub fn new() -> Self
Sourcepub fn set_encoding<T: Into<AudioEncoding>>(self, v: T) -> Self
pub fn set_encoding<T: Into<AudioEncoding>>(self, v: T) -> Self
Sets the value of encoding.
§Example
use google_cloud_speech_v2::model::explicit_decoding_config::AudioEncoding;
let x0 = ExplicitDecodingConfig::new().set_encoding(AudioEncoding::Linear16);
let x1 = ExplicitDecodingConfig::new().set_encoding(AudioEncoding::Mulaw);
let x2 = ExplicitDecodingConfig::new().set_encoding(AudioEncoding::Alaw);Sourcepub fn set_sample_rate_hertz<T: Into<i32>>(self, v: T) -> Self
pub fn set_sample_rate_hertz<T: Into<i32>>(self, v: T) -> Self
Sets the value of sample_rate_hertz.
§Example
let x = ExplicitDecodingConfig::new().set_sample_rate_hertz(42);Sourcepub fn set_audio_channel_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_audio_channel_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of audio_channel_count.
§Example
let x = ExplicitDecodingConfig::new().set_audio_channel_count(42);Trait Implementations§
Source§impl Clone for ExplicitDecodingConfig
impl Clone for ExplicitDecodingConfig
Source§fn clone(&self) -> ExplicitDecodingConfig
fn clone(&self) -> ExplicitDecodingConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more