pub fn speech_synthesizer() -> (SpeechSynthesizer, PullAudioOutputStream) {
    let pull_stream = PullAudioOutputStream::create_pull_stream().unwrap();
    let audio_config = AudioConfig::from_stream_output(&pull_stream).unwrap();

    let speech_config = SpeechConfig::from_subscription(
        env::var("MSSubscriptionKey").unwrap(),
        env::var("MSServiceRegion").unwrap(),
    )
    .unwrap();
    let speech_synthesizer = SpeechSynthesizer::from_config(speech_config, audio_config).unwrap();
    (speech_synthesizer, pull_stream)
}
///creates speech synthesizer from provided audio config and implicit speech config
/// created from MS subscription key hardcoded in sample file
creates speech synthesizer from provided audio config and implicit speech config
created from MS subscription key hardcoded in sample file
creates speech synthesizer from provided audio config and implicit speech config created from MS subscription key hardcoded in sample file
pub fn speech_synthesizer() -> (SpeechSynthesizer, PullAudioOutputStream) {
    let pull_stream = PullAudioOutputStream::create_pull_stream().unwrap();
    let audio_config = AudioConfig::from_stream_output(&pull_stream).unwrap();
    let speech_config = SpeechConfig::from_subscription(
        env::var("MSSubscriptionKey").unwrap(),
        env::var("MSServiceRegion").unwrap(),
    )
    .unwrap();
    let speech_synthesizer = SpeechSynthesizer::from_config(speech_config, audio_config).unwrap();
    (speech_synthesizer, pull_stream)
}
pub fn speech_synthesizer ( ) -> ( SpeechSynthesizer , PullAudioOutputStream ) { let pull_stream = PullAudioOutputStream :: create_pull_stream ( ) . unwrap ( ) ; let audio_config = AudioConfig :: from_stream_output ( & pull_stream ) . unwrap ( ) ; let speech_config = SpeechConfig :: from_subscription ( env :: var ( " " ) . unwrap ( ) , env :: var ( " " ) . unwrap ( ) , ) . unwrap ( ) ; let speech_synthesizer = SpeechSynthesizer :: from_config ( speech_config , audio_config ) . unwrap ( ) ; ( speech_synthesizer , pull_stream ) }
creates speech synthesizer from provided audio config and implicit speech config
created from MS subscription key hardcoded in sample file
creates speech synthesizer from provided audio config and implicit speech config created from MS subscription key hardcoded in sample file