How to use alsa to play sounds simultaneously in c?
I'm using alsa lib in c under linux. I'd like to load several wav files and play them depending on some test conditions. I'm using the following code, but it needs to be improved: // A simple C example to play a mono or stereo, 16-bit 44KHz // WAVE file using ALSA. This goes directly to the first // audio card (ie, its first set of audio out jacks). It // uses the snd_pcm_writei() mode of outputting waveform data, // blocking. // // Compile as so to create "alsawave": // gcc -o alsawave alsawave.c -lasound // // Run it from a terminal, specifying the name of a WAVE file to play: // ./alsawave