Files

Playback Example of WAV File Processed by Equalizer

This example is playing back a WAV file processed by an equalizer.

Compatibility

ESP32-LyraT ESP32-LyraT-MSC
alt text alt text
alt text alt text

Usage

Prepare the audio board:

  • Connect speakers or headphones to the board.
  • Insert a microSD card loaded with a WAV file 'test.wav' into board's card slot.

Configure the example:

  • Select compatible audio board in menuconfig > Audio HAL.

Load and run the example.

Additional Information

To change the parameters of the equalizer, edit set_gain[] table in filr equalizer_example.c. The center frequencies of equalizer are 31 Hz, 62 Hz, 125 Hz, 250 Hz, 500 Hz, 1 kHz, 2 kHz, 4 kHz, 8 kHz and 16 kHz.

To run the example of playback, the following conditions should be met:

  • The audio file should be in format supported by the equalizer:

    • Sampling rate of 11025 Hz, 22050 Hz, 44100 Hz or 48000 Hz.
    • Number of channels: 1 or 2.
  • Audio file format for this example is WAV.

Contents of 'document' folder:

  • The 'test.wav' file is the example file with sample rate of 44100 Hz and a single audio channel.
  • The 'spectrum_before.png' is the spectrum image of the original 'test.wav' file.
spectrum_before
- The 'spectrum_after.png' is the spectrum image of the 'test.wav' file after processing by the equalizer, when the gain of equalizer is -13 dB.
spectrum_after
- The 'amplitude_frequency.png' is the equalizer's frequency response diagram, when the gain of equalizer is 0 dB.
amplitude_frequency