🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Reverse buffers.

Started by
2 comments, last by qals 21 years, 3 months ago
How would you go about reversing directsound buffer to play something in reverse? I can''t seem to retrive or set the size of the buffer. Cheers Al
Advertisement
The best way is to create a second ''reverse'' buffer when you create the first one and populate it with the reverse of the sound.

There doesn''t seem to be any way to do it on the fly unless you use custom mixing.

Mark
Bytten Independent Games Magazine
http://www.bytten.com
Sound Effects For Game Developers
http://www.indiesfx.co.uk
How would you go about doing this?
I''ve tried copying the data to another buffer in reverse but can''t seem to get it to work.

Cheers

Al
qals: how do you imagine reversing a continuous waveform (for example, one being read from the mic)?

If you want to reverse a loaded sound source (such as one loaded from a wav file), simply reverse the sound itself and feed it to the DS buffer. It could look somthing like this (pseudocode):

      Load16bitWAV(Data, &Size);do { Data2[Size - i] = Data[i]; } while(i < Size)  


Data2 is now reversed Data.
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

This topic is closed to new replies.

Advertisement