When [Rec] button on an audio board is pressed, this example will record, and when the button is released, it will play back the recorded file.
For the Recorder:
- We will set up I2S and get audio at sample rate 48000 Hz, 16-bits, stereo.
- Using resample-filter to convert to 16000 Hz, 16-bits, 1 channel.
- Encode with Wav encoder
- Write to microSD
For the Playback:
- We will read the recorded file, with sample rate 16000 Hz, 16-bits, 1 channel,
- Decode with WAV decoder
- Using resample-filter to convert to 48000 Hz, 16-bits, 2 channel.
- Write the audio to I2S
This example is will run on boards marked with green checkbox. Please remember to select the board in menuconfig as discussed is section Usage below.
Board Name | Getting Started | Chip | Compatible |
---|---|---|---|
ESP32-LyraT | |||
ESP32-LyraTD-MSC | |||
ESP32-LyraT-Mini | |||
ESP32-Korvo-DU1906 | |||
ESP32-S2-Kaluga-1 Kit |
Prepare the audio board:
- Connect speakers or headphones to the board.
- Insert a microSD card.
Configure the example:
- Select compatible audio board in
menuconfig
>Audio HAL
.
Load and run the example:
- By using [Rec] button on the ESP32-LyraT board, when the button is pressed, it will start recording, and when the button is released, it will play back the recorded file.
- To stop the pipeline press [Mode] button on the ESP32-LyraT board.