1.1. Audio Codec Loopback
1.1.1. Overview
The audio_codec example shows how to use codec component to record and play audio information. In this example, codec component records the sound and sents out encoded data by I2S interface, MCU send back the received data to codec component, then codec component decodes and plays the audio data.
1.1.2. Project Configuration
In the file
CMakeLists.txt, set a matched audio codec type according to the development board schematic,e.g. “set(CONFIG_CODEC “sgtl5000”)”
1.1.3. Board Setting
Choose one of the following audio input methods based on the board schematic:
Connect the music player to the LINE_IN interface of the onboard codec using a 3.5mm audio cable to record audio data.
Use the onboard codec’s microphone to record audio data.
Connect headphone to the headphone interface on the audio codec chip to play audio data
1.1.4. Running the example
When the example runs successfully, the headphone will play the sound and the following message is displayed in the terminal:
Audio Codec example
Test Codec playback and record