Sign in to follow this  

DirectSound Buffers

This topic is 4334 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.wav
Create 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).

Share this post


Link to post
Share on other sites

This topic is 4334 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this