/// NewDialogServiceConnectorFromConfig creates a dialog service connector from a dialog service config and an audio config.
/// Users should use this function to create a dialog service connector.
// using static dispatch, see https://joshleeb.com/posts/rust-traits-and-trait-objects/
NewDialogServiceConnectorFromConfig creates a dialog service connector from a dialog service config and an audio config.
Users should use this function to create a dialog service connector.
NewDialogServiceConnectorFromConfig creates a dialog service connector from a dialog service config and an audio config . Users should use this function to create a dialog service connector .
pub fn from_config(
        dialog_service_config: impl DialogServiceConfig,
        audio_config: Option<AudioConfig>,
    ) -> Result<Self> {
        unsafe {
            let mut handle: SPXRECOHANDLE = MaybeUninit::uninit().assume_init();
            let speech_config_handle = dialog_service_config.get_handle();
            let ret;
            if let Some(audio_cfg) = audio_config {
                ret = dialog_service_connector_create_dialog_service_connector_from_config(
                    &mut handle,
                    speech_config_handle,
                    audio_cfg.handle.inner(),
                );
            } else {
                let spxhandle_null: SPXHANDLE = 0 as SPXHANDLE;
                ret = dialog_service_connector_create_dialog_service_connector_from_config(
                    &mut handle,
                    speech_config_handle,
                    spxhandle_null,
                );
            }
            convert_err(ret, "DialogServiceConnector::from_config error")?;
            DialogServiceConnector::from_handle(handle)
        }
    }
pub fn from_config ( dialog_service_config : impl DialogServiceConfig , audio_config : Option < AudioConfig > , ) -> Result < Self > { unsafe { let mut handle : SPXRECOHANDLE = MaybeUninit :: uninit ( ) . assume_init ( ) ; let speech_config_handle = dialog_service_config . get_handle ( ) ; let ret ; if let Some ( audio_cfg ) = audio_config { ret = dialog_service_connector_create_dialog_service_connector_from_config ( & mut handle , speech_config_handle , audio_cfg . handle . inner ( ) , ) ; } else { let spxhandle_null : SPXHANDLE = 0 as SPXHANDLE ; ret = dialog_service_connector_create_dialog_service_connector_from_config ( & mut handle , speech_config_handle , spxhandle_null , ) ; } convert_err ( ret , " " ) ? ; DialogServiceConnector :: from_handle ( handle ) } }
NewDialogServiceConnectorFromConfig creates a dialog service connector from a dialog service config and an audio config.
NewDialogServiceConnectorFromConfig creates a dialog service connector from a dialog service config and an audio config .
dialog_service_config
impl DialogServiceConfig
audio_config
Option<AudioConfig>