Jump to content
  • Advertisement
Sign in to follow this  
binpersonal

Play sound from a databuffer

This topic is 3884 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!