Audio Player Lab

In this lab you will build a 1-bit audio to play WAV files from the Z8. You will take WAV audio files and on your PC you will convert them to RAW format then convert the RAW files to a hex data array as a .h file. You can then include the .h file into your Z8 C program. The Z8 C program will output a signal based on the PCM data (that was WAV then RAW then HEX data from the RAW). You will need to figure out send this data to a speaker attached to an IO pin (similar to the ringtone lab).

You can find several bin2h or bin2hex programs online (or write your own):

Here is an example of this done in stereo on an AVR microcontroller.

  • http://www.rpi.edu/~kouttd/03/Rage_against_the_arduino.html
  • This program http://www.nch.com.au/switch/ makes your life easier as it will save an audio file as RAW data so you don’t need to figure out WAV file formatting. Just save to a RAW file and then write a simple program to convert bytes to ascii hex so you can #include that in your C code. Of better yet, send it over a serial link from your PC to the Z8 as a binary data stream.

Here is a web page describing 1-bit audio

  • Last updated: Sun, 02/10/2008 - 23:32