pub struct EmbeddedSpeechConfig {
pub config: SpeechConfig,
}
Expand description
Class that defines embedded (offline) configurations for speech recognition and speech synthesis. This is currently a preview of the API. The functionality is not available in public releases. Added in version 1.19.0
Fields
config: SpeechConfig
Implementations
sourceimpl EmbeddedSpeechConfig
impl EmbeddedSpeechConfig
sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<EmbeddedSpeechConfig>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<EmbeddedSpeechConfig>
Creates an instance of the embedded speech config with a specified offline model path for speech recognition and/or synthesis.
path
: the folder path to search for offline models. This can be a root path under which several models are located in sub-folders, or a direct path to a specific model folder.
sourcepub fn from_paths<P: AsRef<Path>>(paths: Vec<P>) -> Result<EmbeddedSpeechConfig>
pub fn from_paths<P: AsRef<Path>>(paths: Vec<P>) -> Result<EmbeddedSpeechConfig>
Creates an instance of the embedded speech config with specified offline model paths for speech recognition and/or synthesis.
paths
: The folder paths to search for offline models. These can be root paths under which several models are located in sub-folders, or direct paths to specific model folders.
sourcepub fn get_speech_recognition_models(
&self
) -> Result<Vec<SpeechRecognitionModel>>
pub fn get_speech_recognition_models(
&self
) -> Result<Vec<SpeechRecognitionModel>>
Gets a list of available speech recognition models.
sourcepub fn set_speech_recognition_model<S: Into<String>>(
&mut self,
model: &SpeechRecognitionModel,
model_key: S
) -> Result<()>
pub fn set_speech_recognition_model<S: Into<String>>(
&mut self,
model: &SpeechRecognitionModel,
model_key: S
) -> Result<()>
Sets the model for speech recognition.
model
: The recognition modelmodel_key
: The model decryption key.
sourcepub fn get_speech_recognition_model_name(&self) -> Result<String>
pub fn get_speech_recognition_model_name(&self) -> Result<String>
Gets the model name for speech recognition.
sourcepub fn set_speech_recognition_output_format(
&mut self,
format: OutputFormat
) -> Result<()>
pub fn set_speech_recognition_output_format(
&mut self,
format: OutputFormat
) -> Result<()>
Sets the speech recognition output format.
format
: Speech recognition output format (simple or detailed).
sourcepub fn get_speech_recognition_output_format(&self) -> Result<OutputFormat>
pub fn get_speech_recognition_output_format(&self) -> Result<OutputFormat>
Gets the speech recognition output format.
sourcepub fn set_profanity(&mut self, profanity: ProfanityOption) -> Result<()>
pub fn set_profanity(&mut self, profanity: ProfanityOption) -> Result<()>
Sets the profanity option. This can be used to remove profane words or mask them.
profanity
: Sets the profanity option. This can be used to remove profane words or mask them.
pub fn set_speech_synthesis_voice<S, K>(
&mut self,
voice_name: S,
model_key: K
) -> Result<()> where
S: Into<String>,
K: Into<String>,
sourcepub fn get_speech_synthesis_voice_name(&self) -> Result<String>
pub fn get_speech_synthesis_voice_name(&self) -> Result<String>
Gets the voice name for embedded speech synthesis.
sourcepub fn set_speech_synthesis_output_format<F: Into<String>>(
&mut self,
format: F
) -> Result<()>
pub fn set_speech_synthesis_output_format<F: Into<String>>(
&mut self,
format: F
) -> Result<()>
Sets the speech synthesis output format (e.g. Riff16Khz16BitMonoPcm).
sourcepub fn get_speech_synthesis_output_format(&self) -> Result<String>
pub fn get_speech_synthesis_output_format(&self) -> Result<String>
Gets the speech synthesis output format.
Trait Implementations
sourceimpl Debug for EmbeddedSpeechConfig
impl Debug for EmbeddedSpeechConfig
sourceimpl From<EmbeddedSpeechConfig> for SpeechConfig
impl From<EmbeddedSpeechConfig> for SpeechConfig
sourcefn from(esc: EmbeddedSpeechConfig) -> SpeechConfig
fn from(esc: EmbeddedSpeechConfig) -> SpeechConfig
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for EmbeddedSpeechConfig
impl Send for EmbeddedSpeechConfig
impl !Sync for EmbeddedSpeechConfig
impl Unpin for EmbeddedSpeechConfig
impl UnwindSafe for EmbeddedSpeechConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more