Playing multiple sounds simultaneously with Arduino

arduinoaudio

I would like to play multiple audio samples (wav files) simultaneously using an Arduino microcontroller. Is this possible by use of external (audio procesing) hardware?

I read about the Adafuit Wave Shield:

https://www.adafruit.com/products/94

But from what I could understand, it seems possible only to play one sound at a time using this board.

What is a good way to playback multiple sounds simultaneously using Arduino?

Best Answer

The AVR microcontroller used on Arduinos is easily fast enough to do the audio mixing. The problem will instead be reading the data from SD. The SD protocol permits reading only in sector sizes (512 bytes on current cards), and you generally don't have much RAM to store the data in. At 22kHz 16bit mono audio, that corresponds to 11.6ms so you can probably permit joining the samples on a sector basis, but that still means reading 430 sectors per second over an SPI port that cannot do DMA. It is absolutely possible but may present a notable coding challenge. If your set of samples is fairly small and static, it could be better to load them into an SPI NOR flash which is more easily read.