This recipe demonstrates how to play audio clips downloaded from the Internet globally. When you search for digital audio, you will encounter two common digital audio formats: Waveform Audio
File Format (WAVE or WAV) and MPEG-1, MPEG-2 Audio Layer III Format (MP3). This recipe focuses on playing WAV-encoded audio clips. The STM3241G-EVAL and STM32F4-DISCOVERY evaluation boards both include an MP3 player demo that can be ported to other systems. This recipe illustrates a skeleton that could form the basis for a similar application on the MCBSTM32F400 evaluation board. We'll call this recipe codecDemo_c7v1
.
The easiest way to import WAV audio samples into our program is to convert them into C source code (in the same way that images were imported in Chapter 6, Multimedia Support). A number of programs to manipulate WAV files and write samples to a C source file are available. This recipe uses a free converter by Colin Seymour called WAVtoCode that...