Playing Audio from an Arduino Uno

Putting together a couple of tutorials, it's not too hard to playback a short audio sample (less than 4 seconds) from the internal memory of an Arduino Uno. 

My sources are:  Instructables: Make a digital meow from an analog clock and High-Low Tech: Simple Arduino Audio Samples

You'll need Audacity, the PCM library for arduino (direct link), and a cross-platform script from the highlowtech site.

Pick an audio file from freesound.com, if its under 4 seconds already that makes it easy, otherwise use audacity to trim the file down. The only things you have to change is the project rate (to 8000 Hz) and resample the track (Track > Resample) and then export: pick other uncompressed files, click options, and select WAV as the header and unsigned 8-bit PCM for the encoding. Hit OK. Hit Save. 

Run the script from highlowtech, select your 8 bit WAV file, and the script will copy a string of numbers to your clipboard.

Open Arduino, navigate to the PCM example, and test that. You should hear "Arduino Duoneuvo" playing over a speaker plugging into GND and Pin11. Now replace the string of numbers in that example code with the stuff in your clipboard (just delete what's there, then hit CTRL+V)

Test it!

Works if your lucky!