Intro

Small microcontroller audio project like CircuitPython or the Adafruit Wave Shield are designed to play a very specific type of audio. If your music sample is in MP3 format, or 44KHz wav, you'll want to convert it to the right format. This way you will get the best sounding audio, and makes your code easy!

This guide will show how to convert your music of FX into PCM 16-bit Mono Wave files at 22KHz samplerate

If you are using a Wave Shield, note that Arduino does not support "long filenames" - so if you have a file called, say, "My favorite song.wav" it will show up as "MY FAV~1.WAV" in the shield, which can be confusing. To make your brain hurt a little less, rename your files to 8.3 all-caps format so for example, "My favorite song.wav" -> "MYFAVSNG.WAV"
CircuitPython is fine with long file names, but still, we recommend less than 32 characters long names

Check the file

In Windows 7, if you have a wave file already, you should check to see if it's already in a proper format. That way you will save yourself some time! In Windows, right-click on the file, and select Properties then click on the Summary tab.

Note: This doesn't work under WIndows 10 unfortunately. You'll probably need to put the file into one of the conversion programs and just change it to ensure it works well.

This file is 16KHz, 16-bit, mono PCM. Since thats below the maximum (22KHz, 16-bit, mono PCM) you are good to go. No need to convert the file.

Ok, let's say the file is an MP3 or 44KHz or stereo wave file. Or that you don't know what the file is. We will need to convert it down.

The next two sections of this guide shows two ways in which to convert files. There are also other programs on various platforms that perform the same type of conversion but we don't have a step-by-step for such programs.

This guide was first published on Jul 17, 2013. It was last updated on Mar 01, 2013.

This page (Convert files) was last updated on Mar 01, 2013.

Text editor powered by tinymce.