Go Down

Topic: Playing Sound On Arduino (Read 939 times) previous topic - next topic

BenCampbell16

Hi,

I was wondering how to play sound files on Arduino...how do I code it and do I need a decoder; If I need a decoder what one do you reccomend?

DVDdoug

What kind of sound? 

tone() can make basic square waves into a piezo transducer.

If you want to play WAV or MP3 files, look for an audio shield.   The audio shield has a digital-to-audio converter, memory for the audio files, and optionally an MP3 decoder, etc.

Some audio shields can drive headphones but In most cases, you'll need an amplifier to drive a speaker.

BenCampbell16

What audio shield do you reccomend and how do you code them?

slipstick

You haven't said what it is that you want to play yet.

The shield/module will depend on what you want to do and the code will depend on the shield/module chosen.

Steve

BenCampbell16

#4
Feb 19, 2018, 10:58 pm Last Edit: Feb 20, 2018, 11:00 pm by BenCampbell16
I would like to play .wav and .mp3 files. What shield do I need to play those files? How do I program the shield needed?

thedemoriliza

the Adafruit Audio FX Sound Board could be an option. you load sounds onto it with a usb.  you just digitalWrite (xxx, HIGH); to a pin on the sound board to trigger those sounds.

Go Up