No announcement yet.

Random File playing- SomoII

  • Filter
  • Time
  • Show
Clear All
new posts

  • Random File playing- SomoII

    Just putting together a simple application using the SomoII and a Stamp2

    I have the device running with 10 tracks labelled 001.mp3 to 010.mp3 in the root directory of the uSD card and also a copy of these files (again labelled 001.mp3 to 010.mp3) in a folder named 001.

    I can play_next/play_previous/stop/resume/adjust volume etc but what I'm having difficulty with is playing the tracks in a particular sequence.
    I assume I'm not understanding the data sheet correctly.

    If I want to play track 2 in folder 1, do I first issue the 'specify folder & track' command [$7E,$0F,$00,$01,$02,$FF,$EE,$EF] as per the data sheet and then issue a 'Play' command [7E,0D,00,00,00,FF,F3,EF] or should the $0F command automatically initiate playing of this track?

    If I then wish to play track 4, folder 1- do I just issue another 'specify folder & track' command [$7E,$0F,$00,$01,$04,$FF,$EC,$EF] or do you first need to 'stop' the current track if playing?

    I assume the folder and track number can't be set within the 'play' command only? [ eg 7E,0D,00,01,02,FF,F0,EF]

    Does the 'specify folder and track' command work with folder 0 (the root folder)- the data sheet implies it only works within folders 001-100?

    Any code snippets demonstrating the above would be greatly appreciated.

  • #2
    Hello eab.

    It seems you are looking at an old datasheet, as the latest datasheet release a week or so ago fixed the information which is probably leading you astray.

    Folder names need to be 01, 02, 03 etc, not 001, 002 etc.
    MP3 file names you have are correct.

    Best to remove the files in the root directory, this will only confuse things.

    From the datasheet:

    7E 0F 00 01 01 FF EF EF - This will start playing Folder 1, Track 1.
    7E 0F 00 01 0A FF E6 EF - This will start playing Folder 1, Track 10.
    7E 0F 00 63 FF FE 8F EF - This will start playing Folder 99, Track 255.

    Folder and Track are in Hex, so Folder 10 is 0x0A and Track 255.mp3 is 0xFF in Hex, for example.

    If you stop the playback, and then send the Play command, then it will play that same track again. You don't specify the track and folder in the Play command, that is what the Specify Folder and Track command is for.

    I believe the Specify Folder and Track command will only work for the foldered files, rather than the files on the Root. I don't believe you can specified folder 0 for example, it needs to be 1 through 99. This is for the Primary Method described on Page 6 of the Datasheet.

    If you copy the files in order on to the uSD card in the root, then in theory you should just be able to say Play, and it will play 001. Next will go to 002 etc, (Secondary Method). However it is much more reliable to use the foldered method (Primary Method). You will not be able to tell it to play Track 45 for example if you use the Secondary Method, as there is no way to index the files.

    Sorry we have no code snippets for the SOMO-II talking to a Stamp2. There are so many microcontrollers out there we cannot offer code snippets for everything.
    There is an App Note in the works for the SOMO-II talking to an Arduino, however that is not yet ready.
    There is an App Note for the SOMO-II talking to a 4D Display, which can be found on the App Notes page, 4D-AN-P3007. Not sure if this will help you though.



    • #3
      Thanks James-
      Now looks to be working OK.
      ​Just another point- I found that the Somo board seems to need approx 1000msecs after a power-up before it's ready to take commands ( to give it time to read what's on the uSD?)