Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: WAV File Names?

  1. #1
    Senior Member
    Join Date
    Dec 2015
    Posts
    184

    WAV File Names?

    Hi all,

    I'm playing around with a Teensy on the Audio board. I downloaded the SDTEST1.WAV file and it plays just fine. When I substitute my own file (a sad trombone noise) I hear nothing. I am still seeing the "Start Playing" on the serial monitor, but it looks like it's repeating so fast that there's no way the library is playing the file.

    Further investigation has shown that apparently something doesn't like the file names. It appears that if the file name starts with a single number, we're good (1Trombone.wav). If there are two or more numbers, it fails (01Trombone.wav). If there is a special character along with a single number, it also fails (1_Trombone.wav).

    I'm not entirely sure what causes this. I'm starting to investigate on my own, but if anyone has any experience with this I'd love to know if you managed to get around this.

    What I'd like to do eventually is have the Teensy have a number of triggers, and be able to put a file on the SD card prefaced by the number of the trigger I want to trigger it. So 01_Trombone.wav would play when trigger 1 is tripped.

    Thank you!

    Josh

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,608
    I think the SD library restricts filenames to be 8.3 format. But if that's so, I don't know how you got 1Trombone.wav to work.
    Try shorter names such as 1_Trmbon.wav

    Pete

  3. #3
    Senior Member
    Join Date
    Dec 2015
    Posts
    184
    Hi Pete,

    Aha, I believe you are correct. I just tried 001_TRO.WAV and it worked!

    Now to figure out how I can use wildcards...

    Thank you!

    Josh

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,111
    Quote Originally Posted by jkoffman View Post
    Now to figure out how I can use wildcards...
    Look at File > Examples > SD > listfiles for an example that reads all the file names. There isn't any convenient wildcard support in the library, but you could build something that finds the files you like by going through that list and picking out the names which match.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •