Go Down

Topic: Make a song play? (Read 558 times) previous topic - next topic

astefanidis1

Hello, i have a quick question that i figured i'd ask here to get a good answer. For my engineering class we were asked to take the arduino home and do "something cool" with it, and basically have a show and tell when we get back. i decided to simply play a song out of a speaker from the arduino, and have a light show from LED's go along with the beat of the song. i already created a code for the LED's by painfully listening to the same part of the song over and over again and figuring out how long i need each LED to light up. Now it's time for me to get the speaker to play the song, but i realized something. idk how to do that. this is where you guys come in. by tonight i need to have this project done. can someone please tell me what i need to do in order to play the beginning of "crazy train" out of the small speaker that i have connected to my arduino. please also keep in mind that im still a rookie with everything about this and all of the terms that apply, so take it easy on me.
Thanks

AWOL

Have you tried using tone()?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

astefanidis1

well to be honest, i havent tried anything because i have no clue what to do lol. i understand what you mean by that, but how can i get audio of the actual song to play in that. i mean like what do i put for the code to play the song.

AWOL

The audio of the actual song, or a monophonic representation of the song?
Hadn't you better start trying things?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

astefanidis1

the audio of the actual song. i would've tried simpler things first to learn my way around this thing but unfortunately this is what im required to do.

AWOL

Where is the song stored?
What connections between the Arduino and the device the song is stored on can you exploit?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

astefanidis1

well, i have the song on my itunes if thats what you mean. i can probably find the file where the download for it is, but not sure what i can do with that.

AWOL

Maybe hook a servo up to the Arduino to press the play key?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

astefanidis1

:~ i dont have one atm and my project is due tomorrow. didnt think id need it. any other options? lol thanks btw

AWOL

How do you imagine the Arduino is going to play your song?

I'm sorry, but from your first post, this was a "simple" thing to do - I assumed you had put some thought into how it could be achieved.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

astefanidis1

im sorry for misleading you then. im actually completely clueless on how to do it. the first time ive ever used an arduino was only a few days ago so im not too adept with it yet. i just was presented with a task and thought of a cool solution, but didnt realize how difficult it would actually be to do so. now its too late to turn back, so i need help. if you believe this is just too hard to do then tell me and i will just not do it i guess but i was hoping that someone might know how to do this.

Pauly

The  two ways of making sound with an Arduino are to use Tone
http://arduino.cc/en/Reference/tone#.UynBF-29LCQ or a shield.
This shield https://www.adafruit.com/products/94 plays WAV files stored on a SD card.
For what you want, you will need a shield.
There are others shields that play mp3 files.

Go Up