Adafruit_VS1053_Library
Adafruit_VS1053_Library copied to clipboard
Adding ability to record and playback WAV files.
This code adds the ability to record WAV files to the SD card, in a similar manner to how the record_ogg sample code works.
Unlike the record_ogg example, this uses the native IMA ADPCM encoding which doesn't require the loading of a patch file every time the user wants to record some audio. This results in a much faster response time, from the time that a recording is requested to be started, to the time that the system is able to actually start recording.
The example provided here has the following functionality:
- Connect to the VS1053
- Play a tone
- Connect to the SD card
- Wait for the button to be pressed
- While the button is pressed, save the recorded sound to a WAV file
- When the button is released, finalise the WAV file, and play it back immediately
- Go back to waiting for the button to be pressed
This code is based on the following sources:
- Adafruit Ogg Vorbis example: https://github.com/adafruit/Adafruit_VS1053_Library/tree/master/examples/record_ogg
- VS1053 datasheet located here: https://cdn-shop.adafruit.com/datasheets/vs1053.pdf
- TMRPCM code located here: https://github.com/TMRh20/TMRpcm/
- Adafruit forum post located here: https://forums.adafruit.com/viewtopic.php?t=50885