Hello all!
On T4 I am looking for a way to play multiple wav or stereo raw files at the same time. The T4 using SDIO can happily play (8!!!) stereo wav files at the same time but if you launch them all at the same time you get drop out on the first one (the wave form has gaps in it when recorded and reviewed) this only happens for the first fractions of a second then it all works perfectly again.
This is using the wav player example with the wav player duplicated. The RAW player is mono only which isn't ideal as all my files are stereo.
In the note on the audio config tool it says to un-comment the SD optimisation when playing multiple files, if I do this on T4 then it wont compile. are these optimisations still relevant to T4 and SDIO as I know SDIO is much faster anyway.
I have tried staggering the loading of each wav slightly using a counter but for some reason this actually causes more drop outs and clicks when loading every file rather than just the first one...
I know I am asking a lot from the T4 but the fact that it plays all the audio fine once the files are loaded makes me think there must be a way to load them In a way which doesn't cause dropouts.
Is there a way to increase the buffer used when loading to give the system a bit more headroom?
Thanks all, -A
On T4 I am looking for a way to play multiple wav or stereo raw files at the same time. The T4 using SDIO can happily play (8!!!) stereo wav files at the same time but if you launch them all at the same time you get drop out on the first one (the wave form has gaps in it when recorded and reviewed) this only happens for the first fractions of a second then it all works perfectly again.
This is using the wav player example with the wav player duplicated. The RAW player is mono only which isn't ideal as all my files are stereo.
In the note on the audio config tool it says to un-comment the SD optimisation when playing multiple files, if I do this on T4 then it wont compile. are these optimisations still relevant to T4 and SDIO as I know SDIO is much faster anyway.
I have tried staggering the loading of each wav slightly using a counter but for some reason this actually causes more drop outs and clicks when loading every file rather than just the first one...
Code:
int currentWAVloadMS = millis();
int prevWAVloadMS = millis();
int durWAVload = 10;
int LOADtime = 1;
int index = 1;
while (LOADtime == 1) {
currentWAVloadMS = millis();
if (currentWAVloadMS - prevWAVloadMS >= durWAVload) {
// Start playing the files
if (index == 1) { playSdWav1.play(filename1); Serial.println("Debug"); }
if (index == 2) { playSdWav2.play(filename2); Serial.println("Debug"); }
if (index == 3) { playSdWav3.play(filename3); Serial.println("Debug"); }
if (index == 4) { playSdWav4.play(filename4); Serial.println("Debug"); }
if (index == 5) { playSdWav5.play(filename5); Serial.println("Debug"); }
if (index == 6) { playSdWav6.play(filename6); Serial.println("Debug"); }
if (index == 7) { playSdWav7.play(filename7); Serial.println("Debug"); }
if (index == 8) { playSdWav8.play(filename8); Serial.println("Debug"); }
if (index == 9) { LOADtime = 0; }
prevWAVloadMS = currentWAVloadMS;
index++;
}
}
I know I am asking a lot from the T4 but the fact that it plays all the audio fine once the files are loaded makes me think there must be a way to load them In a way which doesn't cause dropouts.
Is there a way to increase the buffer used when loading to give the system a bit more headroom?
Thanks all, -A