need to play simple .wav or such files

hey,

For my current project, I need to play a simple wav file or such. simple things like "DJ!" or "L33T!" n such. I have about 20 of them. What would I need to do this. I first thought of having a recorded file and have the Arduino switch a relay to trigger the sound. but this would require 20 diffrent sound devices and outputs. is there a better way?

thanks!
Mariah

Audrima:
hey,

For my current project, I need to play a simple wav file or such. simple things like "DJ!" or "L33T!" n such. I have about 20 of them. What would I need to do this. I first thought of having a recorded file and have the Arduino switch a relay to trigger the sound. but this would require 20 diffrent sound devices and outputs. is there a better way?

thanks!
Mariah

Full of questions today I see...

:slight_smile:

Look into something like a Wave shield or MP3 playback shield - one of these will do exactly what you want...

Hey,

Hehe, ya I am. I want to get this project done before moving on to more impotent projects. Is there a way around using a prebuilt shield? Do I really need something that powerful for something as simple as 20 Voice samples?

Thanks,
Mariah

Audrima:
Hey,

Hehe, ya I am. I want to get this project done before moving on to more impotent projects. Is there a way around using a prebuilt shield? Do I really need something that powerful for something as simple as 20 Voice samples?

Thanks,
Mariah

There used to a device out there called a "voice record/playback" IC - but they haven't been made in a while, I think (?) - they could store up to 20 seconds of audio, and could playback the entire audio, or 1 second clips, or other combinations, via a fairly simple interface. They used to be sold by Radio Shack. You might try to see if you can source one of these chips as NOS (new-old stock) from some place.

Other than that - there might be one method you could try (probably wouldn't work well, if at all, though). Set up a 1K buffer in SRAM on the Arduino. Then use a timer interrupt (or some other method?) to read a PCM audio file (ie, raw samples, 8 bit) from an SD card (or some other storage), a bit at a time into the buffer. As you are doing this, you need another method to read from the buffer and play back the sound via a digital output (using PWM). The idea is to keep the buffer filled and to not overrun the buffer during playback. Unfortunately, the quality will be poor (if it works at all) - something between phone and AM radio quality - don't expect hi-fi here. Also, you won't have much room left for any other code (or speed to run it - you'll need everything dedicated for playback) so that would make the Arduino a dedicated device for the playback, and such a playback method isn't easy to implement (I did it once a long time ago using QuickBASIC and a soundblaster on a PC - doing it on an Arduino would be a real challenge, if possible at all). At that point - you'd probably be better off with a shield.

Do I really need something that powerful for something as simple as 20 Voice samples?

Yes

  1. the wave shield is not that powerfully
  2. 20 voices are not that simple

You could do it in Processing and have the arduino trigger the sounds but that would not be a stand alone solution.

Look here at MIT's High-Low Tech: http://hlt.media.mit.edu/?p=1963

Roughly 4 seconds of audio is enough to fill the Arduino's 32kB program memory.

I've got a sketch built to play the line "School's out for summer" from Alice Cooper's song "School's Out", but I don't have a speaker I can use yet. I'll get one soon and see how it sounds.

Here's a voice recorder breakout board from SparkFun Electronics: