#[non_exhaustive]pub struct StreamingRecognitionFeatures {
pub enable_voice_activity_events: bool,
pub interim_results: bool,
pub voice_activity_timeout: Option<VoiceActivityTimeout>,
pub endpointing_sensitivity: EndpointingSensitivity,
/* private fields */
}Expand description
Available recognition features specific to streaming recognition requests.
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.enable_voice_activity_events: boolIf true, responses with voice activity speech events will be returned as
they are detected.
interim_results: boolWhether or not to stream interim results to the client. If set to true, interim results will be streamed to the client. Otherwise, only the final response will be streamed back.
voice_activity_timeout: Option<VoiceActivityTimeout>If set, the server will automatically close the stream after the specified
duration has elapsed after the last VOICE_ACTIVITY speech event has been
sent. The field voice_activity_events must also be set to true.
endpointing_sensitivity: EndpointingSensitivityOptional. Endpointing sensitivity for this stream.
Implementations§
Source§impl StreamingRecognitionFeatures
impl StreamingRecognitionFeatures
pub fn new() -> Self
Sourcepub fn set_enable_voice_activity_events<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_voice_activity_events<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_voice_activity_events.
§Example
let x = StreamingRecognitionFeatures::new().set_enable_voice_activity_events(true);Sourcepub fn set_interim_results<T: Into<bool>>(self, v: T) -> Self
pub fn set_interim_results<T: Into<bool>>(self, v: T) -> Self
Sets the value of interim_results.
§Example
let x = StreamingRecognitionFeatures::new().set_interim_results(true);Sourcepub fn set_voice_activity_timeout<T>(self, v: T) -> Selfwhere
T: Into<VoiceActivityTimeout>,
pub fn set_voice_activity_timeout<T>(self, v: T) -> Selfwhere
T: Into<VoiceActivityTimeout>,
Sets the value of voice_activity_timeout.
§Example
use google_cloud_speech_v2::model::streaming_recognition_features::VoiceActivityTimeout;
let x = StreamingRecognitionFeatures::new().set_voice_activity_timeout(VoiceActivityTimeout::default()/* use setters */);Sourcepub fn set_or_clear_voice_activity_timeout<T>(self, v: Option<T>) -> Selfwhere
T: Into<VoiceActivityTimeout>,
pub fn set_or_clear_voice_activity_timeout<T>(self, v: Option<T>) -> Selfwhere
T: Into<VoiceActivityTimeout>,
Sets or clears the value of voice_activity_timeout.
§Example
use google_cloud_speech_v2::model::streaming_recognition_features::VoiceActivityTimeout;
let x = StreamingRecognitionFeatures::new().set_or_clear_voice_activity_timeout(Some(VoiceActivityTimeout::default()/* use setters */));
let x = StreamingRecognitionFeatures::new().set_or_clear_voice_activity_timeout(None::<VoiceActivityTimeout>);Sourcepub fn set_endpointing_sensitivity<T: Into<EndpointingSensitivity>>(
self,
v: T,
) -> Self
pub fn set_endpointing_sensitivity<T: Into<EndpointingSensitivity>>( self, v: T, ) -> Self
Sets the value of endpointing_sensitivity.
§Example
use google_cloud_speech_v2::model::streaming_recognition_features::EndpointingSensitivity;
let x0 = StreamingRecognitionFeatures::new().set_endpointing_sensitivity(EndpointingSensitivity::Standard);
let x1 = StreamingRecognitionFeatures::new().set_endpointing_sensitivity(EndpointingSensitivity::Supershort);
let x2 = StreamingRecognitionFeatures::new().set_endpointing_sensitivity(EndpointingSensitivity::Short);Trait Implementations§
Source§impl Clone for StreamingRecognitionFeatures
impl Clone for StreamingRecognitionFeatures
Source§fn clone(&self) -> StreamingRecognitionFeatures
fn clone(&self) -> StreamingRecognitionFeatures
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamingRecognitionFeatures
impl Debug for StreamingRecognitionFeatures
Source§impl Default for StreamingRecognitionFeatures
impl Default for StreamingRecognitionFeatures
Source§fn default() -> StreamingRecognitionFeatures
fn default() -> StreamingRecognitionFeatures
Source§impl PartialEq for StreamingRecognitionFeatures
impl PartialEq for StreamingRecognitionFeatures
Source§fn eq(&self, other: &StreamingRecognitionFeatures) -> bool
fn eq(&self, other: &StreamingRecognitionFeatures) -> bool
self and other values to be equal, and is used by ==.