/// Starts the speech synthesis on plain text, asynchronously.
/// It returns when the synthesis request is started to process
/// (the result reason is SynthesizingAudioStarted).
Starts the speech synthesis on plain text, asynchronously.
It returns when the synthesis request is started to process
(the result reason is SynthesizingAudioStarted).
Starts the speech synthesis on plain text asynchronously . It returns when the synthesis request is started to process ( the result reason is SynthesizingAudioStarted ) .
pub async fn start_speaking_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_start_speaking_text(
                self.handle.inner(),
                c_text.as_ptr(),
                text_len as u32,
                &mut result_handle,
            );
            convert_err(ret, "SpeechSynthesizer.start_speaking_text_async error")?;
            SpeechSynthesisResult::from_handle(result_handle)
        }
    }
pub async fn start_speaking_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_start_speaking_text ( self . handle . inner ( ) , c_text . as_ptr ( ) , text_len as u32 , & mut result_handle , ) ; convert_err ( ret , " " ) ? ; SpeechSynthesisResult :: from_handle ( result_handle ) } }
Starts the speech synthesis on plain text, asynchronously.
Starts the speech synthesis on plain text asynchronously .
&self
text
&str