Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Densun

why won't the secondary buffer play?

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

This is a quick list of what I do to setup DirectSound. It might not be enough information to go on, but hopefully you can figure out what''s wrong. -Create the DirectSound object. -SetCooperativeLevel to DSSCL_EXCLUSIVE. -Create primary sound buffer with only DSBCAPS_PRIMARY. -Set format for primary sound buffer. -Create secondary buffer with only DSBCAPS_STATIC. -Call Play (0, 0, 0) from the secondary buffer. That''s where the program causes an error to occur. I do not load any wave data into the secondary buffer yet, but I think it should at least play some noise.

Share this post


Link to post
Share on other sites
Advertisement

Assuming that the secondary buffer created successfully, I believe that you need to fill the secondary buffer with "silence" (0x00''s) if you want silence, but am not positive on that!

Share this post


Link to post
Share on other sites
I don''t think you can Play() a buffer with no data in it. Even though it''s created, isn''t the pointer to the actual data NULL? Try making a one-byte buffer filled with 0 (or whatever) and then Play() it.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!