snusmumriken
Active member
I'm struggling with the interaction of the Audio and Snooze libraries. Most applications seem to want the processor to perform other tasks while Audio is playing a WAV file. But those other tasks include going to sleep, which of course stops play.
After studying the examples, I thought the ability of Audio to play while doing something else lay in the lines:
So I figured that this was a control issue. I tried moving my play routine (including the above lines) into a function, thinking that control would not pass back to the main loop (containing the sleep command) until the function was complete. That didn't work, the processor still went to sleep mid-sentence, as it were. So I assume the multi-tasking ability is somehow built into the Audio library?
All I want to do is to play the file from beginning to end, then go to sleep until woken by an alarm or timer. Is there a way to do this, please?
After studying the examples, I thought the ability of Audio to play while doing something else lay in the lines:
Code:
while (playWav1.isPlaying()) {
} // Wait for the file to finish playing.
All I want to do is to play the file from beginning to end, then go to sleep until woken by an alarm or timer. Is there a way to do this, please?