Jump to content
  • Advertisement
Sign in to follow this  
Clawer

Multiple sounds

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

Hi there, I was wondering how sound streaming is usually implemented inside APIs. It's easy to guess that this implementation is higly influenced by the particular platform APIs are programmed for but I was trying to figure out a "general schema". These days I had to program a simple sound engine for a platform which allows me to use threads. So my idea was to dedicate a single thread for each sound in order to play different streams( 3 sounds max ) at the same time. What do you think, is that a good idea? Is there any better way or something neater? Thanks in advance, Gionathan

Share this post


Link to post
Share on other sites
Advertisement
Generally, you keep a list of which sounds are currently playing, and how far you are through them. Periodically, your sound-reading function will copy the next bit of data from each individual sound and mix it into the main sound buffer, which the sound card plays. This is repeated forever.

I don't think it's a good idea using one thread per sound.

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.

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!