Ok hi I have solved this!!! I want to write here for future readers in case anyone stumbles here in the years to come.
The musicPlayer.playFullFile() reads a char array, NOT a string.
In my case, all of my file names are the same length, deliberately. And there is a number that changes each time a file is played. So my code for example would be
Code: Select all
int tracknum = 1
string filename = "File" + string(tracknum) + ".wav"; // You have to do string(tracknum) to get a string version of the int declared above
const char filechar[10]; // you have to declare a const char array to read the details into. the [10] in square brackets is the number of characters in the array - this needs to be one more than you need, so it contains the terminator char at the end
filename.toCharArray(filechar,10); // this is where you read the string filename into the char array filechar - the 10 is the number of characters you have, as above 10 because FILE1.wav is 9 characters
musicPlayer.playFullFile(filechar); //and you're done! The file will now play.
Good job getting this far, future-starter! I hope this helps you.