View Single Post
Old 07 July 2004, 15:46   #4
xtc
Amiga lover
 
xtc's Avatar
 
Join Date: Jun 2004
Location: Italy
Age: 46
Posts: 23
Send a message via MSN to xtc
Hi Toni. First of all, this simple effect is the result of a test i've made with goldwave. I've recorded an audio session with winuae and saved it to a wav file. I've copied it onto another file, flipped the channels, lowered the volume and mixed it with the original. It worked! Though is not a "real" wide stereo effect, it's simple and efficient. I've tried to change the volume and the effect changes accordingly.
I think it can be done in two different modes. I'm quite new to directsound, but it's similar to Direct3D so i've just had a look to the documentation.

First. Using the actual code, modifying the buffer descriptor to handle 8 hardware channels (or 4 if software) if wide stereo is selected. When the code fills the buffer it puts the data into buffer in an interleaved form. If you write 4 word (16 bit samples) (for example, 4 channels: left1, right1, left2, right2) just replicate them, flipped by channel (so r1, l1, r2, l2) but multiplied by 1.0/"wide_stereo_strenght" (the slider value, to be clear). The data will be lowered in volume and mixed alltogheter with the other data. All done.

Second. Duplicating the secondary buffer with IDirectSound8:uplicateSoundBuffer and setting the right volume as usual with SetVolume. The problem is the left-right flipping. You have to lock the duplicated buffer, walk through all the word and flipping them in a 2 by 2 or 4 by 4 fashion. The descriptor of the buffer remains the same. But this buffer must be played simultaneously with the original one.

I'd like to know what is the simplest one. I prefer the first one.

If you have any question, feel free to ask me!

Bye!!!
xtc is offline  
 
Page generated in 0.04884 seconds with 11 queries