The key is to a) feed new stuff into the sound queue in small pieces. b) make sure the sound queue never runs out of sound. Let's start with the GOAL, which is to be able to CHANGE the mix every 1/10 second. This means that at any time, about 1/10 of a second of sound should be in the queue. This means that whenever you KNOW that less than 1/20th of a second of sound is left in the queue, you add another 1/10 second of sound. The timeline for this process looks like this: V init V add new V add new V add new V add new V add new 0.15 * * * * * 0.14 * * * * * 0.13 * * * * * 0.12 * * * * 0.11 * * * * 0.10 * * * * * 0.00 * * * * * 0.09 * * * * * 0.08 * * * * * 0.07 * * * * * 0.06 * * * * * 0.05 * * * * * 0.04 0.03 0.02 0.01 -----------------------------elapsed time---------------------> 012345678901234567890123456789012345678901234567890123456789 X axis: 1/100's second elapsed. Y axis: size of sound queue. To avoid spinlooping and chewing up CPU time, the best way to 'wait' for the next cycle is to set a microsleep alarm (man usleep) and wake up every .05 second to check whether the queue needs more input. If linux doesn't have usleep, you can hack it up yourself with 'man signal' and SIGALRM. There are three tunable parameters: a) min queue size desired. b) max queue size desired. c) wakeup interval to check queue. For now, set these to: a) min desired queue size: .05 second. (the min amount of sound we should have in the queue at all times) b) max desired queue size: .10 second. (the delay between an event and hearing it) c) wakeup interval to check queue: .025 second (min queue size - wakeup interval = actual possible min queue size = .025 second) You'll probably have to play with these a bit.