Play a file in subfolder

Status
Not open for further replies.

darioconcilio

Well-known member
Hi,
I'm trying to play on subfolder of SD, but I don't know which way I have to take.

I tryed to call open methods, as I use when I keep a files, but I think that is a bad way.
Infact, it take no effect.

have you got any idea?

Code:
  [...]

  mixer.gain(0, 0.8);
  mixer.gain(1, 0.8);
  AudioMemory(8);
  pinMode(10, OUTPUT);
  SPI.setMOSI(11);
  SPI.setSCK(13);
  if (!(SD.begin(10))) {
    // stop here, but print a message repetitively
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(500);
    }
  }
  SD.open("/MYSUBFOLDER/"); //Is it good way? .....it's not works....

  sdwav1.play("MYAUDIO1.WAV");
 
Have you tried?

Code:
  sdwav1.play("MYSUBFOLDER/MYAUDIO1.WAV");

But of course, you'd name your folder with 8 or fewer characters, or figure out the short 8.3 name for it. SD only supports 8.3 filenames.
 
Status
Not open for further replies.
Back
Top