Hello,
this is my first post here.
I'm involved in the developing a drum machine using a teensy 3.6 and I have a question on which is the best way in terms of performance to play samples before start testing on the board.
My task is to fill an SD card with several samples and every drum part reads the related sample, for instance bd.wav, sn.wav hh.wav and so on.
I've found that there are several ways to play samples and the one "out of the box" of the Audio library that do the task seems to be AudioPlaySdWav
Then I've read the code of the object and if I'm not wrong, every time the sound is triggered with play(filename), it is forced to reload the file from SD.
I don't know if this introduces latency or overheads but what I'm thinking is that reading the file one time and then keeping the data in memory could have better performances.
Then I'm in front of a juncture:
1. Develop a new object like AudioPlaySdWav but that stores the file data in memory and then plays without reloading it
2. Develop a wav file parser, like the tool used by the wav2sketch utility and then use it to load the wav data in memory and then use the AudioPlayMemory to play back the data.
Does anybody of you have some experience on this subject and could give me some advices?
Thanks!
this is my first post here.
I'm involved in the developing a drum machine using a teensy 3.6 and I have a question on which is the best way in terms of performance to play samples before start testing on the board.
My task is to fill an SD card with several samples and every drum part reads the related sample, for instance bd.wav, sn.wav hh.wav and so on.
I've found that there are several ways to play samples and the one "out of the box" of the Audio library that do the task seems to be AudioPlaySdWav
Then I've read the code of the object and if I'm not wrong, every time the sound is triggered with play(filename), it is forced to reload the file from SD.
I don't know if this introduces latency or overheads but what I'm thinking is that reading the file one time and then keeping the data in memory could have better performances.
Then I'm in front of a juncture:
1. Develop a new object like AudioPlaySdWav but that stores the file data in memory and then plays without reloading it
2. Develop a wav file parser, like the tool used by the wav2sketch utility and then use it to load the wav data in memory and then use the AudioPlayMemory to play back the data.
Does anybody of you have some experience on this subject and could give me some advices?
Thanks!