pub fn load_wav_rw(src: &mut RWops) -> Result<AudioSpecWAV, String> {
        use std::mem::uninitialized;
        use std::ptr::null_mut;

        let mut desired = unsafe { uninitialized::<sys::SDL_AudioSpec>() };
        let mut audio_buf: *mut u8 = null_mut();
        let mut audio_len: u32 = 0;
        unsafe {
            let ret = sys::SDL_LoadWAV_RW(src.raw(), 0, &mut desired, &mut audio_buf, &mut audio_len);
            if ret.is_null() {
                Err(get_error())
            } else {
                Ok(AudioSpecWAV {
                    freq: desired.freq,
                    format: AudioFormat::from_ll(desired.format).unwrap(),
                    channels: desired.channels,
                    audio_buf: audio_buf,
                    audio_len: audio_len
                })
            }
        }
    }
/// Loads a WAVE from the data source.
Loads a WAVE from the data source.
Loads a WAVE from the data source .
pub fn load_wav_rw(src: &mut RWops) -> Result<AudioSpecWAV, String> {
        use std::mem::uninitialized;
        use std::ptr::null_mut;
        let mut desired = unsafe { uninitialized::<sys::SDL_AudioSpec>() };
        let mut audio_buf: *mut u8 = null_mut();
        let mut audio_len: u32 = 0;
        unsafe {
            let ret = sys::SDL_LoadWAV_RW(src.raw(), 0, &mut desired, &mut audio_buf, &mut audio_len);
            if ret.is_null() {
                Err(get_error())
            } else {
                Ok(AudioSpecWAV {
                    freq: desired.freq,
                    format: AudioFormat::from_ll(desired.format).unwrap(),
                    channels: desired.channels,
                    audio_buf: audio_buf,
                    audio_len: audio_len
                })
            }
        }
    }
pub fn load_wav_rw ( src : & mut RWops ) -> Result < AudioSpecWAV , String > { use std :: mem :: uninitialized ; use std :: ptr :: null_mut ; let mut desired = unsafe { uninitialized :: < sys :: SDL_AudioSpec > ( ) } ; let mut audio_buf : * mut u8 = null_mut ( ) ; let mut audio_len : u32 = 0 ; unsafe { let ret = sys :: SDL_LoadWAV_RW ( src . raw ( ) , 0 , & mut desired , & mut audio_buf , & mut audio_len ) ; if ret . is_null ( ) { Err ( get_error ( ) ) } else { Ok ( AudioSpecWAV { freq : desired . freq , format : AudioFormat :: from_ll ( desired . format ) . unwrap ( ) , channels : desired . channels , audio_buf : audio_buf , audio_len : audio_len } ) } } }
Loads a WAVE from the data source.
Loads a WAVE from the data source .
src
&mut RWops
src
&mut RWops