#[non_exhaustive]pub struct StreamingRecognitionResult {
pub alternatives: Vec<SpeechRecognitionAlternative>,
pub is_final: bool,
pub stability: f32,
pub result_end_offset: Option<Duration>,
pub channel_tag: i32,
pub language_code: String,
/* private fields */
}Expand description
A streaming speech recognition result corresponding to a portion of the audio that is currently being processed.
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.alternatives: Vec<SpeechRecognitionAlternative>May contain one or more recognition hypotheses. These alternatives are ordered in terms of accuracy, with the top (first) alternative being the most probable, as ranked by the recognizer.
is_final: boolIf false, this
StreamingRecognitionResult
represents an interim result that may change. If true, this is the final
time the speech service will return this particular
StreamingRecognitionResult,
the recognizer will not return any further hypotheses for this portion of
the transcript and corresponding audio.
stability: f32An estimate of the likelihood that the recognizer will not change its guess
about this interim result. Values range from 0.0 (completely unstable)
to 1.0 (completely stable). This field is only provided for interim results
(is_final=false).
The default of 0.0 is a sentinel value indicating stability was not set.
result_end_offset: Option<Duration>Time offset of the end of this result relative to the beginning of the audio.
channel_tag: i32For multi-channel audio, this is the channel number corresponding to the
recognized result for the audio from that channel.
For
audio_channel_count = N, its output values can range from 1 to N.
language_code: StringOutput only. The BCP-47 language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
Implementations§
Source§impl StreamingRecognitionResult
impl StreamingRecognitionResult
pub fn new() -> Self
Sourcepub fn set_alternatives<T, V>(self, v: T) -> Self
pub fn set_alternatives<T, V>(self, v: T) -> Self
Sets the value of alternatives.
§Example
use google_cloud_speech_v2::model::SpeechRecognitionAlternative;
let x = StreamingRecognitionResult::new()
.set_alternatives([
SpeechRecognitionAlternative::default()/* use setters */,
SpeechRecognitionAlternative::default()/* use (different) setters */,
]);Sourcepub fn set_is_final<T: Into<bool>>(self, v: T) -> Self
pub fn set_is_final<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_stability<T: Into<f32>>(self, v: T) -> Self
pub fn set_stability<T: Into<f32>>(self, v: T) -> Self
Sourcepub fn set_result_end_offset<T>(self, v: T) -> Self
pub fn set_result_end_offset<T>(self, v: T) -> Self
Sets the value of result_end_offset.
§Example
use wkt::Duration;
let x = StreamingRecognitionResult::new().set_result_end_offset(Duration::default()/* use setters */);Sourcepub fn set_or_clear_result_end_offset<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_result_end_offset<T>(self, v: Option<T>) -> Self
Sets or clears the value of result_end_offset.
§Example
use wkt::Duration;
let x = StreamingRecognitionResult::new().set_or_clear_result_end_offset(Some(Duration::default()/* use setters */));
let x = StreamingRecognitionResult::new().set_or_clear_result_end_offset(None::<Duration>);Sourcepub fn set_channel_tag<T: Into<i32>>(self, v: T) -> Self
pub fn set_channel_tag<T: Into<i32>>(self, v: T) -> Self
Sets the value of channel_tag.
§Example
let x = StreamingRecognitionResult::new().set_channel_tag(42);Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
§Example
let x = StreamingRecognitionResult::new().set_language_code("example");Trait Implementations§
Source§impl Clone for StreamingRecognitionResult
impl Clone for StreamingRecognitionResult
Source§fn clone(&self) -> StreamingRecognitionResult
fn clone(&self) -> StreamingRecognitionResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more