SD card audio library to scan SD card for valid files and make a list?

Status
Not open for further replies.

kyranzor

Member
Hello,

In my project, I'd like to play WAV files from the SD card, but first I would like to scan the SD card filesystem and find all the valid sound files on there and return a dynamically allocated list of strings with the valid file names, and then later on I might sort them alpha-numerically so i can play them in sequence based on name.

Is this kind of functionality possible? I see from some older threads that it's not possible to use the audio SD lib at the same time without some modifications (which were never explicitly listed/mentioned, only vague indications of this issue).

Is there an easier way to do what i'm trying to do?

Thanks for any pointers..

edit:
If there's no easy way around this, i'll just have to get my users to hard-code their sound files more strictly, and i'll have to iterate through each potential named file (lets say, "SOUNDx.WAV" where x is 1->500) and make an array to indicate if that file is valid/present.

Is there a way to check that a sound file exists without actually playing it directly?
 
Last edited:
Oh it looks like the SD.h example library programs show how to print the contents of files/directories from Root of the SD card. that doesn't use the sdFat.h include? I am just about to test it, it seems like it should work. I'm already using SD.begin() and SD.exists() so I'm sure i can also look through the filesystem and find files with .WAV extension and add them to my list to play with the wavplayer object later on :)
 
Status
Not open for further replies.
Back
Top