/// Executes the speech synthesis on plain text, asynchronously.
Executes the speech synthesis on plain text, asynchronously.
Executes the speech synthesis on plain text asynchronously .
pub async fn speak_text_async(&self, text: &str) -> Result<SpeechSynthesisResult> {
        unsafe {
            let c_text = CString::new(text)?;
            let text_len = c_text.as_bytes().len();
            let mut result_handle: SPXRESULTHANDLE = MaybeUninit::uninit().assume_init();
            let ret = synthesizer_speak_text(
                self.handle.inner(),
                c_text.as_ptr(),
                text_len as u32,
                &mut result_handle,
            );
            convert_err(ret, "SpeechSynthesizer.speak_text_async error")?;
            SpeechSynthesisResult::from_handle(result_handle)
        }
    }
pub async fn speak_text_async ( & self , text : & str ) -> Result < SpeechSynthesisResult > { unsafe { let c_text = CString :: new ( text ) ? ; let text_len = c_text . as_bytes ( ) . len ( ) ; let mut result_handle : SPXRESULTHANDLE = MaybeUninit :: uninit ( ) . assume_init ( ) ; let ret = synthesizer_speak_text ( self . handle . inner ( ) , c_text . as_ptr ( ) , text_len as u32 , & mut result_handle , ) ; convert_err ( ret , " " ) ? ; SpeechSynthesisResult :: from_handle ( result_handle ) } }
Executes the speech synthesis on plain text, asynchronously.
Executes the speech synthesis on plain text asynchronously .
&self
text
&str