This is the documentation for the latest (main) development branch of HPM SDK. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

1.2. Audio Wav Decoder

1.2.1. Overview

The audio codec sample project shows how to play WAV format audio. In this project, the wav format file from the SD card is read and then played, MCU send back the received data to codec component, then codec component decodes and plays the audio data.

1.2.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.2.3. Board Setting

  • According to project configuration, connect speaker to DAO interface if using DAO as player, connect headphone to headphone interface if using audio codec as player.

1.2.4. Running the example

When the project runs correctly, select the music name and the headset will play this music, while the serial terminal will output the following message:

audio codec example
SD card has been mounted successfully

***********Music List**********
0: music1.wav

1: music2.wav

2: music3.wav

3: music4.wav

4: music5.wav

5: music6.wav

6: mucsic7.wav

7: Ring10.wav

8: on_phone.wav

9: calling.wav

**Any non-numeric key to change pages**

Enter Music Number:

music playing time:174 seconds ...
music end.