#[non_exhaustive]pub struct InputAudioConfig {
pub audio_encoding: AudioEncoding,
pub sample_rate_hertz: i32,
pub enable_word_info: bool,
pub phrase_hints: Vec<String>,
pub model: String,
pub model_variant: SpeechModelVariant,
pub single_utterance: bool,
pub barge_in_config: Option<BargeInConfig>,
pub opt_out_conformer_model_migration: bool,
/* private fields */
}sessions or test-cases only.Expand description
Instructs the speech recognizer on how to process the audio content.
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.audio_encoding: AudioEncodingRequired. Audio encoding of the audio content to process.
sample_rate_hertz: i32Sample rate (in Hertz) of the audio content sent in the query. Refer to Cloud Speech API documentation for more details.
enable_word_info: boolOptional. If true, Dialogflow returns
SpeechWordInfo in
StreamingRecognitionResult
with information about the recognized speech words, e.g. start and end time
offsets. If false or unspecified, Speech doesn’t return any word-level
information.
phrase_hints: Vec<String>Optional. A list of strings containing words and phrases that the speech recognizer should recognize with higher likelihood.
See the Cloud Speech documentation for more details.
model: StringOptional. Which Speech model to select for the given request. For more information, see Speech models.
model_variant: SpeechModelVariantOptional. Which variant of the Speech model to use.
single_utterance: boolOptional. If false (default), recognition does not cease until the
client closes the stream.
If true, the recognizer will detect a single spoken utterance in input
audio. Recognition ceases when it detects the audio’s voice has
stopped or paused. In this case, once a detected intent is received, the
client should close the stream and start a new request with a new stream as
needed.
Note: This setting is relevant only for streaming methods.
barge_in_config: Option<BargeInConfig>Configuration of barge-in behavior during the streaming of input audio.
opt_out_conformer_model_migration: boolIf true, the request will opt out for STT conformer model migration.
This field will be deprecated once force migration takes place in June
2024. Please refer to Dialogflow CX Speech model
migration.
Implementations§
Source§impl InputAudioConfig
impl InputAudioConfig
Sourcepub fn set_audio_encoding<T: Into<AudioEncoding>>(self, v: T) -> Self
pub fn set_audio_encoding<T: Into<AudioEncoding>>(self, v: T) -> Self
Sets the value of audio_encoding.
§Example
use google_cloud_dialogflow_cx_v3::model::AudioEncoding;
let x0 = InputAudioConfig::new().set_audio_encoding(AudioEncoding::Linear16);
let x1 = InputAudioConfig::new().set_audio_encoding(AudioEncoding::Flac);
let x2 = InputAudioConfig::new().set_audio_encoding(AudioEncoding::Mulaw);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 = InputAudioConfig::new().set_sample_rate_hertz(42);Sourcepub fn set_enable_word_info<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_word_info<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_word_info.
§Example
let x = InputAudioConfig::new().set_enable_word_info(true);Sourcepub fn set_phrase_hints<T, V>(self, v: T) -> Self
pub fn set_phrase_hints<T, V>(self, v: T) -> Self
Sets the value of phrase_hints.
§Example
let x = InputAudioConfig::new().set_phrase_hints(["a", "b", "c"]);Sourcepub fn set_model_variant<T: Into<SpeechModelVariant>>(self, v: T) -> Self
pub fn set_model_variant<T: Into<SpeechModelVariant>>(self, v: T) -> Self
Sets the value of model_variant.
§Example
use google_cloud_dialogflow_cx_v3::model::SpeechModelVariant;
let x0 = InputAudioConfig::new().set_model_variant(SpeechModelVariant::UseBestAvailable);
let x1 = InputAudioConfig::new().set_model_variant(SpeechModelVariant::UseStandard);
let x2 = InputAudioConfig::new().set_model_variant(SpeechModelVariant::UseEnhanced);Sourcepub fn set_single_utterance<T: Into<bool>>(self, v: T) -> Self
pub fn set_single_utterance<T: Into<bool>>(self, v: T) -> Self
Sets the value of single_utterance.
§Example
let x = InputAudioConfig::new().set_single_utterance(true);Sourcepub fn set_barge_in_config<T>(self, v: T) -> Selfwhere
T: Into<BargeInConfig>,
pub fn set_barge_in_config<T>(self, v: T) -> Selfwhere
T: Into<BargeInConfig>,
Sets the value of barge_in_config.
§Example
use google_cloud_dialogflow_cx_v3::model::BargeInConfig;
let x = InputAudioConfig::new().set_barge_in_config(BargeInConfig::default()/* use setters */);Sourcepub fn set_or_clear_barge_in_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<BargeInConfig>,
pub fn set_or_clear_barge_in_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<BargeInConfig>,
Sets or clears the value of barge_in_config.
§Example
use google_cloud_dialogflow_cx_v3::model::BargeInConfig;
let x = InputAudioConfig::new().set_or_clear_barge_in_config(Some(BargeInConfig::default()/* use setters */));
let x = InputAudioConfig::new().set_or_clear_barge_in_config(None::<BargeInConfig>);Sourcepub fn set_opt_out_conformer_model_migration<T: Into<bool>>(self, v: T) -> Self
pub fn set_opt_out_conformer_model_migration<T: Into<bool>>(self, v: T) -> Self
Sets the value of opt_out_conformer_model_migration.
§Example
let x = InputAudioConfig::new().set_opt_out_conformer_model_migration(true);Trait Implementations§
Source§impl Clone for InputAudioConfig
impl Clone for InputAudioConfig
Source§fn clone(&self) -> InputAudioConfig
fn clone(&self) -> InputAudioConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InputAudioConfig
impl Debug for InputAudioConfig
Source§impl Default for InputAudioConfig
impl Default for InputAudioConfig
Source§fn default() -> InputAudioConfig
fn default() -> InputAudioConfig
Source§impl Message for InputAudioConfig
impl Message for InputAudioConfig
Source§impl PartialEq for InputAudioConfig
impl PartialEq for InputAudioConfig
Source§fn eq(&self, other: &InputAudioConfig) -> bool
fn eq(&self, other: &InputAudioConfig) -> bool
self and other values to be equal, and is used by ==.