Wave Shield Examples
Getting Stack overflow errors?
These examples are all tested to work with v13 or higher, so try to use that if possible!
Get more RAM & Flash!

Before you try to play audio, you'll want to free up some Arduino RAM, so that you don't end up with a nasty stack-overflow. Especially if you're running a Atmega168-based Arduino!

Follow these instructions on how to get more RAM by reducing the input Serial library buffer. You dont need to do this if you're using an ATmega328 (although, hey it wont hurt!)

Note that the library is pretty big (about 10K) so if you want to do a lot more, I suggest upgrading to an ATmega328. The shield was designed with the expectation that this part would be available.

Generating speech

If you want a human voice in your project, you can use the free generator at AT&T Text-to-Speech demo page

It will create a 16KHz, 16-bit audio file so you can use the audio 'right out of the box'

Sound sample library

Here is huge collection of C.C. Attribution licensed sound samples! A lot of it is already mono, 16 or 22KHz

Digital audio player

This is the simplest example. It plays every audio file it finds on the SD card in a loop. This sketch is also included in the library

PI party!

This example shows how to use the AT&T text-to-speech website to speak the first 2640 digits of pi. The number is stored in flash, each digit is spoken one at a time.

Playing sound based on input

This example plays 6 different files depending on whether buttons connected to the 6 analog input pins are pressed.

This one plays 4 different files depending on serial characters, good if you have say an xbee you want to use

Changing the playback rate

By messing with the playback interrupt, you can change the speed of playback for an interesting effect.

Here is the sketch, connect the potentiometer to analog pin 0 (or change the code)

Halloween pumpkin

An example of using a sensor to trigger sounds, as well as animating LEDs based on the volume

Volume control via software
By changing the #define DVOLUME 1 in wave.cpp and recompiling you can do rudimentary software volume control as in this sketch
August 24, 2009 15:13