PDA

View Full Version : Arduino and sound playback


jjm2958
09-22-2010, 02:11 PM
So, here's the deal-io. I'm working on a project using an arduino board. The objectives are to use an arduino board connected to a "regular" mp3 player with its audio out/headphone jack connected to speakers.

1. The idea would be for the arduino to trigger a connection which would complete the circuit between the headphone jack and the speaker (the mp3 player theoretically would be playing a looped sound, but you wouldn't hear it because the connection between the headphone jack and speaker is open.). I don't want to have to hack the mp3 player if at all possible - which is why I mentioned using the audio out connector.

Any thoughts on how to accomplish this? Someone had mentioned a MUX to switch off the speaker, but they didn't elaborate much so I'm a bit lost.

OR

2. Still centering around an arduino but not using an MP3 player, is there way to build a (very) simple circuit from standard component parts that would interface with the arduino and play back a sound file (either from on board flash or better yet, an SD card)?

Ideally, I like 2. if there is a pretty simple circuit that could be made.

Any takers?

Mr_Chicken
09-22-2010, 03:19 PM
there is a sound board available for the arduino. I haven't used it, but I imagine it would make this much simpler

jjm2958
09-22-2010, 03:23 PM
there is a sound board available for the arduino. I haven't used it, but I imagine it would make this much simpler

Hey Mr. Chicken - yes, I've seen a few external boards available and agree that it would be eaiser to buy one. I was just trying to see if it would be possible (and relatively easy) to create something with basic component parts or get the audio out to speaker thing working...either way.

DarkLore
09-22-2010, 06:55 PM
If I understand this thread correctly - you want to trigger a circuit which will close the audio loop to make a sound play. The linked thread, Trigger (http://www.hauntforum.com/showthread.php?t=22839), details a very cheap sensor circuit used to close a circuit loop. It acts as a switch....I don't see why it wouldn't close the loop on audio. I don't know if that helps but I think you are looking for something similar.

jjm2958
09-22-2010, 07:27 PM
If I understand this thread correctly - you want to trigger a circuit which will close the audio loop to make a sound play. The linked thread, Trigger (http://www.hauntforum.com/showthread.php?t=22839), details a very cheap sensor circuit used to close a circuit loop. It acts as a switch....I don't see why it wouldn't close the loop on audio. I don't know if that helps but I think you are looking for something similar.

Cool, thanks! I'll check it out...

HomeyDaClown
09-22-2010, 07:57 PM
Two things come to mind,

First if you've got a standard Arduino board, use a an audio shield like this:
http://www.ladyada.net/make/waveshield/ Lot's of people using these so there's lot's of support.

Second, just drive a simple relay from any Digital Out pin setting the pin high or low in your sketch. You can do as you say "switch the audio line on and off" or use the relay to control power to PC speakers. Schematic is here: http://www.arduino.cc/playground/uploads/Learning/relays.pdf

JeffHaas
09-23-2010, 02:20 AM
I've built the Adafruit WaveShield, it does lots of stuff. You can have a whole list of sound files on the flash card and depending on what sensors get tripped or buttons get pushed, the Arduino can play whatever sound you need.

There's also a stand-alone sound board that Sparkfun came out with a few months back:
http://www.sparkfun.com/commerce/product_info.php?products_id=9715
Their "MP3 Trigger" has a TON of functions you can use.

jjm2958
09-25-2010, 08:02 PM
Cool - got a few things on order. Thanks for all of the suggestions