DirectSound Buffers

Started by
2 comments, last by Hedphoniks 18 years, 2 months ago
I have created a simple media player in VB.Net which allows me to stream a wav file using primary and secondary buffers. I want to be able to access the actual samples in the buffers so I can play a .wav file in reverse. Is it possible to gain access to the sample data through either the secondary or primary buffer? If so, how do I go about doin this? Thanks
Advertisement
through buffer locking
Yep. If you're familiar with D3D it's exactly like locking a texture/surface/vertex buffer to access the raw data. Look up 'Lock' in the SDK and one entry will be for the soundbuffer interface. You could do:
Create buffer1 from sound.wavCreate buffer2 with same settings as buffer1.Lock both buffers to get pointers to each buffer's data.Copy data from buffer2->buffer1 in whatever way you want.


I beleive you can lock with flags to tell DSound you only wish to read or only wish to write to the buffer, which can be faster (I know D3D does this anyway).
This seems possible in c++ but not in VB.net?? Is buffer locking not allowed in managed code?

This topic is closed to new replies.

Advertisement