You could place a limit on the number of sounds that are concurrently playing.
When a sound is played, increment a counter. When the sound finishes playing, decrement the counter .
Don't play a sound if the counter is greater than the limit.
You might need to use a Mutex to protect the counter's incrementing/decrementing.
Using a separate thread for playing the sounds might help too.