Skip to main content
GameDev.net gamedev.net
🔒 Locked

Multiple sounds

Started by Clawer Jan 29, 2008 at 8:26 AM 0 replies 600+ views
Original Post
Clawer
Clawer
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
Kylotan
Kylotan
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.