Repeat function for h4yn0nnymou5e/Audio library ????

charnjit

Well-known member
i recenctly install Audio library from h4yn0nnym0u5e
library link
i try simple WavFilePlayer example
as this code is repeating file, I used for single file (15.wav)
Code:
    !playWav1.isPlaying();
 {  playWav1.play("15.WAV");   }
but I don't want write File name again and again. my SD card will contail so many files.
is there a single function ?? that allow running file in repeat_mode or single shot .
somthing like this
for play loop mode seamlessly
Code:
  playWav1.play("15.WAV");
  playWav1.playMode(repeat);  // for hint only
for play single shot
Code:
  playWav1.play("15.WAV");
  playWav1.playMode(none);  // for hint only

is this Library having also playback speed control funtions ???
 
No, that library doesn’t have repeat / loop or speed control capabilities. It’s intended more for multi-file playback and recording at 1x, e.g. for DAW or looper applications. For the latter, the looping would have to be done via the application code.

The TeensyVariablePlayback library you’ve already found is probably more suitable for your needs, based on your post. I’ve done a branch which is better for multi-file use; it uses a bit more CPU, and may have issues with memory fragmentation, but is likely a better choice for e.g. tuned sample players.

I don’t understand your comment about “I don't want write File name again and again. my SD card will contail so many files.”. The play() functions take a pointer to a C string; your code happens to create that at compile time, but you could just as well generate it at run time.
 
Thank you for reply...
“I don't want write File name again and again. my SD card will contain so many files.” means
writing like below
Code:
playSdWav1.setLoopType(looptype_repeat);
Or

Code:
playSdWav1.setLoopType(looptype_none);
Is easy after calling
Code:
playSdWav1.play("15.WAV");
To get be looped or single shot .

because I will make more than 500 wav (drum loops)on sd card to trigger from 16 buttons.

Yes, TeensyVariablePlayback library is suitable to my need. But it not being compiled with keypad library. How to fix it???
 
Last edited:
Back
Top