James46717 just shared a new project: "Arduino Audio Recorder with Playback"
This project started with an idea, as most projects do. I wondered if I could use the Arduino UNO to record audio and play it back. I wanted something to amuse the grandkids. They would press a button, say something and the device would then repeat what they had said.
Parts used in this project:
Atmega328p with Arduino Bootloader
3.7V LiPo 2000mAH
Electret Microphone Amplifier
MicroSD Card Breakout Board
Pololu 5V Step-Up/Step-Down Voltage Regulator S7V7F5
Single Push Button Switch
LED Tri Colour Single Anode
In my search, I found many people had used Arduino devices to digitise or playback audio; so I had confidence it might be worth a try.
The starting point for me was:-
APC magazine - Arduino Masterclass
- Project #18 - Digital Audio Recorder v2.0
- Darren Yates - 11 April 2014.
Modifying the code to suit my purpose I was able to record audio that played back on a PC with reasonable clarity. Previously, I had successfully read and written files to an SD Card using the SdFat Library by Bill Greiman. This is an excellent library for accessing SD Card files.
Outputting the audio from the ATMega328P proved much more difficult. After trying a number of options which only produced distorted audio, I was ready to give up.
I posted on the Core Electronics forum the audio recording part.
Stephen replied with a link to
Maks Surguy’s blog on Innovation, IoT and Laravel – 1 Feb 13
How to play WAV audio files with Arduino Uno and MicroSD card - Maks Surguy’s…
I checked it out and examined the TMRpcm.h library in detail, which was being used. The library was not suitable for what I was doing as the audio recording routines were not fully developed. But it did give me a good insight into what I needed to get my device working.
Overall this project has given me a better understanding of the ATMega328P registers and audio wave files.