views:

246

answers:

1

I'm working on a cocoa-touch app using OpenAL, but I'm willing to switch to another framework if I'm forced (I don't really need the 3d stuff).

I've been searching for a way to play a sound backwards but I've only found (very complicated) examples using Audio Unit. Is there anyway to perhaps store a buffer in reverse so I can play it backwards using OpenAL?

+1  A: 

you can play the sound backward by reordering each sample on wave data, this is as simple as binary data manipulation.

openAL does not have ability to read the sample from the end of data to the first data, but you can do it by enqueue the data to openAL using buffer with size of sample size, for example if you are working using 16-bit wave, you will need to have a lot buffer with 2 bytes size, then enqueue it to openAL one-by-one backward, which is not very efficient.

its still better to preprocess the wave data first so it will backward, so you have two data (or track), normal data and backward data, then you can play which data/track based on your apps event.

uray