controll music shield from mega to play selected songs

hi one and all

i have got seeedstudio music shield and arduino mega …

i could able to play the songs , but now my task is i want to pick my own selective file like passing arguments : play("track001.mp3)

so can any 1 help me out with the code …

am using the same code from seeedstudio misic shield wiki…

only requirement is to add the ability to pick the selective file…

You can download and Fat16 for from our wiki.

Now there are two examples in MusicShieldNewSDLib.One is to play songs randomly and the other play the song with the name you select in the demo code.


Hey Frankie,
I’m am trying to do the same thing in my code but using that library I get the following error when I am trying to compile the MusicPlayWithName example.

C:\Users\Ben\Desktop\arduino-1.0.1\libraries\MusicShieldNewSDLib\player.cpp: In function 'int playFile()': C:\Users\Ben\Desktop\arduino-1.0.1\libraries\MusicShieldNewSDLib\player.cpp:136: error: 'listoffset' was not declared in this scope C:\Users\Ben\Desktop\arduino-1.0.1\libraries\MusicShieldNewSDLib\player.cpp:137: error: 'indexlist' was not declared in this scope

Could you tell me what I did wrong? I downloaded the fat16lib that you link to (fat16lib20111205). I have Arduino IDE 1.0.1


bdirgo, did you ever get it working? I’ve managed to get mine playing all songs in order using the music_v1_14 library, but it can only play songs in order – if I try calling PlayCurrentFile(), it can play the file but it doesn’t return at the end of the song, just continues playing the next file and the next until it gets to the end of the SD card.

When I switch to the Demo 2 libraries, I can compile MusicPlayRandomly but it can’t read the SD card – it prints
error: Fat16::init
over serial – and then loops forever with
error: open file failed

Same SD card that works with music_v1_14.

hey,you can download this attachment and have a try (30.3 KB)

Attention:Please delete your Music1.4 libraries firstly.

Nope, MusicPlayer_v1_7 doesn’t work for me – I tried the playWithName example but it doesn’t play anything. I hacked it to add some Serial.printlns, and it’s successfully adding my filename to the playlist (and the filename is on the microSD card), but it fails when trying to open the file. BTW, that demo doesn’t compile unless I change
#include “newSDLib.h”
#include “newSDlib.h”
(note incorrect capitalization of Lib, which doesn’t match the filename). I’m on Linux so filenames are case-sensitive.

Music_v1_14 is the only version of the libraries that I’ve gotten to work at all. I’ve managed to hack a version of the library that can play multiple songs, play them out of order, etc. I’d like to distribute it, since it seems like a lot of people have trouble using this music shield. But the readme.txt says:
Copyright © 2010 Seedstudio. All right reserved.
so I can’t legally share this code with anyone else.

Would Seeed be willing to open their code so that people can actually get it working? Maybe give it a GPL license, or some other open license, or even make it public domain. It would make it a lot easier to use your hardware if it was possible to share working libraries and examples.