Sign in to follow this  
Clawer

Multiple sounds

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
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

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