Frequently Asked Questions

How do I handle wav-files for playing the audio samples?

Some boards have an audio codec that receives the audio sample stream via the i2s-interface. Other boards have an audio output from a DAC (Digital to Analog Converter). In both cases, a stream of audio samples are output. A wav-file contains audio samples and the (uncompressed) format is simple to work with.

  1. Install a PC application that can edit audio clips in the wav-format, for example WavePad Sound Editor (http://www.nch.com.au/wavepad/index.html)
  2. Open the audio file that you want to work with.
  3. Make the adjustments needed on the file, for example trim leading and trailing silent sections.
  4. Save the file in a suitable wav-format. First select the "Save File As" operation and then select the format. Typically 16-bit resolution and "PCM uncompressed format", mono or stereo format. Select the sample rate also. The higher the sample rate is, the bigger the wav-file will be. If it shall be stored on the on-chip flash memory, the size is really limited (typically less than 512 kBytes).
  5. The wav-file contains a header with some information about the audio samples, for example bitwidth, mono/stereo and sample rate. Your player application can interpret this information and make the necessary adjustments to the player application. Alternatively, the wav-file header can be removed so that the file only contain audio data. Use for example the PSPad editor for this. Open the file in hex-mode and then it is possible to delete bytes in the beginning of the file. Normally the 44 first bytes shall be removed. Google on the wav-file format and the header for details.
  6. The saved wav-file (or audio sample file) must then be converted to a c-struct. There are many "binary to c" conversion programs (just google it, for example "bin2c", for example sourceforge.net/projects/bin2c).

Go to FAQ List