-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffered WAV file recording and playback #483
base: master
Are you sure you want to change the base?
Buffered WAV file recording and playback #483
Conversation
Original branch is slightly polluted with unrelated fixes
Also omit alignment of user-generated audio buffer, doesn't seem to be needed
…nnym0u5e/Audio into feature/buffered-SD-for-PR
Extremely exciting!!! |
yay! |
I tested this in two different situations today:
And both worked wonderfully. Neither of them could reliably play long wav files without intermittent glitches with the normal sd wav file player but with this it works a charm :) |
Oh and heads up: The AudioBuffer class clashes with the AudioBuffer in the codecs library. https://github.com/FrankBoesing/Arduino-Teensy-Codec-lib/blob/master/audiobuffer.h |
I'll let Paul adjudicate that one. I'm fairly sure he won't be pulling Frank's library, (a) because there's no PR, and (b) because it's GPL, not MIT-licensed. |
As discussed on forum thread https://forum.pjrc.com/index.php?threads/yet-another-file-player-and-recorder.70963/ Seems to be pretty stable now, so I've added a couple of extra examples and submitted this PR.
Provides 1-, 2-, 4-, 6- and 8- channel playback and recording of WAV files from/to any filesystem, while not interfering with the sketch's ability to access files - all accesses are done via EventResponder so not from within the interrupt handler, which has a tendency to cause all sorts of mayhem.
With reasonably-sized buffers in heap or PSRAM the resilience to other system activities seems pretty good, and playback / recording of multiple files is possible.
Several examples are provided (maybe too many, or too complex?); documentation has been updated.