// Play sound data // exit: >=0 => handle to playing sound // -1 => error, voice not played int rtvoice_play(int index, unsigned char *data, int size) { int ds_handle, rval; ds_handle = Rtv_output_buffers[index].ds_handle; // Stop any currently playing voice output ds_stop_easy(ds_handle); // TODO: uncompress the data into PCM format // lock the data in if ( ds_lock_data(ds_handle, data, size) ) { return -1; } // play the voice rval = ds_play(ds_handle, -100, DS_MUST_PLAY, Master_voice_volume, 0, 0); return rval; }
// Play sound data // exit: >=0 => handle to playing sound // -1 => error, voice not played int rtvoice_play(int index, unsigned char *data, int size) { int ds_handle, rval; ds_handle = Rtv_output_buffers[index].ds_handle; // Stop any currently playing voice output ds_stop_easy(ds_handle); // TODO: uncompress the data into PCM format // lock the data in if ( ds_lock_data(ds_handle, data, size) ) { return -1; } // play the voice EnhancedSoundData enhanced_sound_data(SND_ENHANCED_PRIORITY_MUST_PLAY, SND_ENHANCED_MAX_LIMIT); rval = ds_play(ds_handle, -100, DS_MUST_PLAY, &enhanced_sound_data, Master_voice_volume, 0, 0); return rval; }