Sign in to follow this  

Play sound from a databuffer

This topic is 3575 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

Dear all, Anyone can give me suggestions on how to play sound from a data buffer ( not from a file)? The data buffer keeps changing and keeps playing sound, till I press the stop Button. I consider using CSoundManager, but its CreateStreaming() require a file name, which is maybe not what I want. Can I use it to point to a buffer? I also consider putting data directly to DirectSound primary buffer. How do you guys think? anyone can give me some examples? Thank you very much!

Share this post


Link to post
Share on other sites
CSoundManager simplifies the interface. It sounds like you can use that.

If you want to create the data in memory yourself, rather than loading it from a file, you can try CreateFromMemory. You supply the data and the format.

If you want to change the sound "on the fly," it may be easier to create two sounds and fade one in and the other out (by changing the volume) rather than to change the data in the buffer itself.

Streaming data is a complicated task as you need to trap notifications, etc.

However, if you want to try that, you can try setting up your own CreateStreaming function, and your own CSound::FillBufferWithSound() routine to fill it with your own data when the notification comes through.

Share this post


Link to post
Share on other sites

This topic is 3575 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