Music Maker shield unable to play first song after second

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
clararaa
 
Posts: 1
Joined: Wed Feb 22, 2023 11:22 am

Music Maker shield unable to play first song after second

Post by clararaa »

I am running into a very specific problem with the music maker shield where my device doesn't play certain songs depending on the track name and its order on the SD card.

I am setting up a device where there are two IR beam break sensors connected to my arduino, which has the music maker shield and is attached to an external speaker. When one beam is broken, one song plays, and when the other beam is broken, another song plays.

Playback was very inconsistent, so I did a lot of testing. What I found eventually was that if I had two songs on the SD card, the first track would not play after the second track, and the second track would play immediately after the first track but would not play after itself again. So the pattern would be:

song 1 played in setup - successful
song 2 played in setup - successful

sensor 1 triggered - song 1 unsuccessful
sensor 2 triggered - song 2 successful
sensor 2 triggered - song 2 unsuccessful
sensor 2 triggered - song 2 unsuccessful (and will continue being unsuccessful)
sensor 1 triggered - song 1 unsuccessful
sensor 1 triggered - song 1 successful
sensor 1 triggered - song 1 successful (and will continue being successful)

I also found that the shield didn't "know" it wasn't playing the song--when I put in a bunch of "if (musicPlayer.playFullFile("/track001.wav"){ Serial.println ("Song 1 played")}" type code, the Serial monitor would say that the file had played regardless of whether it was actually coming out of the speakers. It would also wait the approximate amount of time for the song to play, when using playFullFile, before reading out "Song 1 played", as if it had really played the file.

I experimented with naming the files different things and found that it had nothing to do with the audio files themselves and nothing to do with their names, it was only the order in which they were found on the SD card. I experimented with having the perches trigger different songs and found that it did not affect the pattern of song order explained above. I also tried adding more songs to the SD card and not using them. I found it somewhat successful but also really erratic--if I had four songs and played all four in setup, nothing would play again no matter what I tried. If I had four songs and didn't play any in setup, some combinations (i.e. using 1 and 2 or 2 and 4) would work flawlessly and some wouldn't, and I haven't found a consistent pattern yet.

I'd really just like to know what is going on with the Adafruit_VS1053.h library, to see what could be causing these types of issues.

Also, I don't think it's my wiring because I created six identical devices and they are all having exactly the same problem.

I would appreciate any input!

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Music Maker shield unable to play first song after second

Post by adafruit_support_mike »

That's more likely to be a code issue than a hardware issue.

Drop back to a toy sketch that plays one file, then plays the other. Then swap the order of the files to see if the files play in both orders.

If they don't, reduce the code to the simplest example that still has the same unwanted behavior and post if between CODE tags please.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”