Forum >Replies by Editor
userhead Editor
Replies (1)
  • You Reply:
    eric wrote:
    Wed Jan 02, 2019 1:44 pm
    in the example done, it use PlayTrack() it play the nth file in the current folder! so...

    how to select a file name?
    There is a command....
    Play the audio in specified drive of specified path.(08)
    Command: AA 08 length drive path SM
    Return: None
    Explanation: length= drive length + path length=1+ path length
    Hum what is drive length? what is path length? Have you an example?

    thks
    Hello.

    Recently faced the same problem. After long torture came to such a code (ARDUINO):
    Code: Select all
      // Воспроизвести указанную композицию;
      // 
      void XY_V17B::SPECPATH(uint8_t drive, String path)
      {
        uint8_t len = path.length();
        
        uint8_t _temp[len + 5] = {0xAA, 0x08, len + 1, drive};
    
        for(uint8_t i = 0; i < len; i++)
        {
          _temp[i + 4] = path.charAt(i);
        }
        
        _temp[len + 5 - 1] = GetSum(_temp, 0, len + 5 - 1);
        Write(_temp, len + 5);
      }
    
    // Получает сумму байт в массиве;
      uint8_t XY_V17B::GetSum(uint8_t data[], uint8_t first, uint8_t last)
      {
        uint8_t result = 0;
        for(int i = first; i <= last; i++) { result = result + data[i]; }
        return result;
      }
    
    USING:
    SPECPATH(00,"/02.mp3");
    00 - USB DRIVE
    /02.mp3 - Path
    ->> /02*???
    Attention slash like that! The file 02.mp3 was in the root of the flash drive.