pub unsafe extern "C" fn module_audio_init(
status_info: *mut *mut c_char,
) -> c_intExpand description
Initialize audio
Your module implementation must export it’s own version of this
function, unless your build system builds and links with its own
version of module-utils.c from the speech-dispatcher distribution.
Note that this function is only required when using client audio playback. Implementations relying on server playback being available may stub this.
#[unsafe(no_mangle)]
unsafe extern "C" fn module_audio_init(status_info: *mut *mut raw::c_char) -> raw::c_int {
// Stub implementation
let resp = c"This speech-dispatcher module was compiled without client audio support";
unsafe {
let ptr = libc::malloc(size_of_val(resp));
assert!(ptr != ptr::null_mut());
libc::memcpy(ptr, resp.as_ptr(), size_of_val(resp));
*status_info = ptr;
}
-1
}