My first Arduino project is being planned, but I do need some help with that.

I am planning on building 2 Portal Turrets (from the award-winning 2007 game, Portal) that have a motion sensor on the front. When one walks by, thus activating the sensor, it will play a random audio from an assortment of .wav OR .mp3 files (whichever seems easier is what I'll convert it to.)
But, a vital problem here is that I'm not sure where to get this random choice from, and where to store the audio. I'm thinking about buying one of those cheap $20 dollar MP3 players that barely have enough room for a few albums. But even then, once I get everything onto it, it will be pretty hard to access, as it will involve literally taking apart the MP3 player in a very hacky way. So, I'm wondering if there's an easier way. I wish (or maybe they do...) they had a chip that could store files which could plug right into the arduino.
Thanks for taking your time reading this, and I'd appreciate any suggestions. It's probably blindingly obvious and since I'm new, I'm just completely oblivious to it. Either way, thanks!

Hi, There are a couple or more ways to do this.

There is a .wav shield from adafruit. And there is another way to do it here: http://arduino-direct.com/sunshop/index.php?l=product_detail&p=83

(Click on the "larger image" and you will see the setup with a small .wav 'brick' board, an SD card board and the connecting shield.) You can stack other shields on top if needed..

These approaches have you put .wav files on the SD card on your regular computer, and move the SD card to Arduino. You can play files by their number, so you can generate a random number and play the file.

There are a couple of online sites that will create text to .WAV with different voices, which might be cool..

Get some free audio editor like Goldwave to make coolest audio effects...

DISCLAIMER: I mentioned stuff from my own Shop...

These MP3 players are AMAZING, cheap, and I've got source code for them already:
http://www.mdfly.com/index.php?main_page=product_info&cPath=9_53&products_id=284&zenid=kk3sdibh1iaibeps01dgfhqco0

They're dirt cheap and SUPER easy to work with (two lines of code when doing it the HARD way)

Reply if you want the code I used.

@brucethehoon, these look very cool. I'm confused by the photos though.. Where does the SD card plug in???

Thanks!

I have one of these but haven't had a chance to play with it yet. The SD card slot is on the bottom side (the shiny metal section near the middle. it's shown on the third picture on the product page). http://www.mdfly.com/images/MOL/AU5121_02.JPG

Here's the secret with these MP3 players:
http://www.thaieasyelec.net/archives/Manual/TDB380%20datasheet%20V2[1].0%20.pdf (this is the file that's attached, because this site is often down)

The MDFLY "datasheet" is frankly garbage. The PROPER model number for the unit is TDB380. Google will net some solid help on interfacing with them, but what you can see from the datasheet above is that there are several modes that it can run in. I personally use serial to connect and play / control volume for my projects, but by modifying two small jumpers, you can run it in parallel mode, direct play mode, MP3 mode or serial mode.

In direct mode, you can simply bring one of 8 pins low and it will start to play that file. Best for OP's use: by pressing the PLAY button (bring it low), it will RANDOMLY play one file from the SD card!

It looks like MDFLY is out of them for the moment, but they tend to get them back in stock pretty fast. I suggest emailing them to ask when!

EDIT:
Here's a sketch for the basics

void setup() {
// initialize the serial communication:
Serial.begin(4800); //Set to 4800 bps
Serial.print(0xEF, BYTE); // Reset board
delay(2000);
}

void loop() {

Serial.print(1, BYTE); // Play first file
delay(5000);
Serial.print(15, BYTE); // Play second file
delay(8000);
Serial.print(0xEB, BYTE); // Suspend playing
delay(3000);
Serial.print(0xEC, BYTE); // Resume playing
delay(8000);

}

TDB380 datasheet V2[1].0 .pdf (1.04 MB)

Actually, while rummaging through my closet for electronics, I happened to find a skull that I got years ago as a gift. You can set it to either tell jokes or say pirate warnings. When someone walks by, it says them and the Eyes (LEDs) blink and the mouth moves. I wonder if it is possible to 'hack' it by basically removing the mouth motor, taking apart the whole thing and either discarding the skull or keeping it for a later project, and somehow find a way to edit the sound files stored on it... And the LEDs would just be a bonus for me without having to do any work, because the Portal Turrets DO have red lights.

Pretty darn unlikely.

See this thread for reasons:
http://arduino.cc/forum/index.php/topic,59514.0.html

MDFLY reports those mp3 players will be back in stock within 2 weeks