Pages: [1]   Go Down
Author Topic: Make a song play?  (Read 450 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25706
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried using tone()?
Logged

"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.

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

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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25706
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The audio of the actual song, or a monophonic representation of the song?
Hadn't you better start trying things?
Logged

"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.

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

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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25706
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where is the song stored?
What connections between the Arduino and the device the song is stored on can you exploit?
Logged

"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.

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

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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25706
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe hook a servo up to the Arduino to press the play key?
Logged

"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.

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

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25706
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

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

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.
Logged

Boston
Offline Offline
God Member
*****
Karma: 3
Posts: 575
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: