Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 3.34 KB

File metadata and controls

45 lines (30 loc) · 3.34 KB

Record and Playback with Resample

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

Compatibility

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 alt text ESP32 alt text
ESP32-LyraTD-MSC alt text ESP32 alt text
ESP32-LyraT-Mini alt text ESP32 alt text
ESP32-Korvo-DU1906 alt text ESP32 alt text
ESP32-S2-Kaluga-1 Kit alt text ESP32-S2 alt text

Usage

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.