Pages: [1]   Go Down
Author Topic: Play sound with Arduino  (Read 682 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My robotics team needs a little help.  We have an Arduino Uno and a Duemilanova.  We also have an SD card reader.  What we want to to is put some sound files on the SD card and play a specific file when a button is pressed.  The goal is to create an interactive display where people can press a button and get information. What would be the best format to use, WAV, MP3 or something else?  The information will be spoken.  Also, what size SD card can the Arduino recognize?  We have almost everything from 2gb to 16gb.  Will any work or just a certain size?  Any links to code would be greatly appreciated.

Thanks!
Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 106
Posts: 3758
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need an MP3 shield, one that allows you to enter the track number and play it. You can do a search for Arduino MP3, and your mostly likely going to either get a shield or a small chip like board. If the vender is nice, they will have a sample code you can look at before you buy the part. Shields tend to be the easiest to program, but if you already have multiple things running off the Arduino, your more likely to have complications with pin usage. So check the schematics and data sheets on what pins the shield takes up before hand.
« Last Edit: September 23, 2013, 12:48:39 pm by HazardsMind » Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1857
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There is another active thread where the poster was asking the same question, as was pointed to some MP3 shields that could do what you want: http://forum.arduino.cc/index.php?topic=189376.0

Here is another one from a US supplier I've bought other components from: http://www.ebay.com/itm/MP3-Music-VS1053-shield-board-with-TF-card-slot-work-with-arduino-/321157017822?pt=LH_DefaultDomain_0&hash=item4ac67330de

A somewhat cheaper approach would be to use a WTV020SD16P based card that plays WAV files (note, many of these WTV020SD16 devices will only take older, smaller SD cards up to 1GB): http://www.ebay.com/itm/WTV020-SD-16P-U-Disk-Audio-Player-SD-Card-Voice-Module-MP3-Voice-Module-/221263135372?pt=LH_DefaultDomain_0&hash=item33844f828c
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34518
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like you want to do this project of mine
http://forum.arduino.cc/index.php?topic=188909.0
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, something like this https://www.sparkfun.com/products/10628 from Sparkfun or anyplace really?  My assumption is then have the arduino wait for a button press and then it can "play track 3" or "play track 1".  Basically that's it, right?  Since children will be able to access this, how could we address multiple button presses?  Like some kid presses 3 buttons at once.  Is there a way to code for that?
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Or you could try the SimpleSDAudio library, which uses PWM to output sound direct form the Arduino. It reads from an SD card.

The only Caveat is that you have to convert the files first, but that is a simple drag and drop operation.

The sound quality is very respectable and you can do 8 bit Mono and Stereo and even a pseudo 16 bit Mono and Stereo.

http://www.hackerspace-ffm.de/wiki/index.php?title=SimpleSDAudio
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I looked at the Simple SDA Library.  That looks sort of complicated.  My students (and I) are new to the whole Arduino platform. I think we will go with a MP3 shield.  I found a couple on Amazon that are in our price range.  If we get something working, pictures and an update.  We may need help along the way.  I will be sure to ask.  Thanks!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34518
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You are better off getting one of these:-
http://learn.adafruit.com/adafruit-wave-shield-audio-shield-for-arduino
It uses wav files.

Quote
Like some kid presses 3 buttons at once.  Is there a way to code for that?
Sure you just have to define exactly what you want to do in those circumstances.

No comment on my project? I would have though it was exactly what you wanted.
Logged

Pages: [1]   Go Up
Jump to: