This project is a really simple example of embedding wav file audio into a pic chip and playing it back through a speaker. The method used should be applicable to any other MCU out there with enough ROM space and fast enough clock speed.

With some of the newer 8-bit Pic chips from microchip coming with 32K and 64K of ROM and 64Mhz internal OSC (using 4x PLL) they are quite capable of storing and playing back a good number of decent quality sound samples with processing power to spare.

There are quite a few sites out there showing how to playback wav files from SD cards using a pic chip but sometimes you just want to keep things simple and have a few built in sound fx when you press buttons or maybe you just want to keep costs down and use a minimal number of components.

This project consists of a Pic18F25K22, an audio amp IC, a speaker, and a few passive components, or if you want to go very minimal you can leave out the audio amp ic and support components and drive the speaker directly from the Pic PWM output but it won’t be nearly as loud.

Along with the hardware side of this project there is a python script that does the wav file conversion to .h header file to include in the source code. The conversion process allows you to also resample the audio so you can choose your quality versus size / time as well as size limit to make sure longer samples won’t go over the memory limit of the chip.

This is still a work in progress, there will be some updates later and possibly a dev board or kit available at some point, for now I just wanted to share it as is, hopefully someone will find it useful and at least have some fun with it.
Create | Share | Innovate | Have Fun
Pic SFX Player by Circuits For Fun is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.