16 channel mixing 16 bit raw format. a) compute chunksize to use (= 1/10 second of sound, say) b) express all event sounds as arrays that are divisible by chunk size. Each sound can be expressed as TWO arrays (one for each channel) but I'll describe algorithm in mono. For now assume that short *sounds[NSOUNDS]; is the array of sounds, (which all get loaded from memory) and sounds[i][j] is the jth sample of sound i. (raw format after decoding ulaw compression) sounds[i][0] is first audio level for sound i. lengths[i] = length of array sounds[i] To keep track of what's playing, need sounds[0][j] = 0. need int what[32]; which sound is playing int where[32]; which byte of sound is playing. Initially, what[i]=0; When a sound starts, what[i]=5; /* sounds[what[i]][where[i]] is where we are in that sound */ where[i]=0; At each time tick, short output[FRAMESIZE]; for (i=0; i