circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

May 2006, Issue 190

ARM-Based Modern Answering Machine
Philips ARM Design Contest 2005 First Prize


WAV FILES

The TAM-TAM can play and record WAV files in the same format as a PC. Tracking the WAV file format can be another interesting project because of all the conflicting information on the Internet. My first attempt to record and then interpret WAV file content on a PC running Windows XP failed. There were differences between the format I found on the Internet and the actual data from a hex dump of a WAV file recorded on a PC. This problem was certainly caused by the fact that Microsoft has improved or added parameters to the older format.

The good news is that when you understand the philosophy of the format, it becomes easier to interpret the data instead of relying on a given piece of information at a given location. In some cases, the format interpreted in Playback mode might be slightly different from the format generated in Record mode. This doesn’t affect the fact that both types of files are valid WAV files that you can play and record on the TAM-TAM or a PC.

The WAV file format is a hierarchy that starts with the four letters RIFF. The rest of the hierarchy can be navigated because each level announces its name and the length of the data that follows. When a name isn’t understood or expected, it can be skipped.

During playback, the WAV files are loosely analyzed. The file interpreter navigates through the file structure to extract a key value: the number of samples to be played. This value indicates how many bytes (not samples) are present in the data section of the file.

The TAM-TAM makes no attempt to fix a wrong sampling rate value by performing quantization or interpolation. Nor does it do anything fancy with files that may have been compressed. On the other end, the parser correctly analyzes files that have been created with different versions of Windows or with different programs in the same operating system. The key is to not rely on a parameter to be present at a fixed offset. You must navigate the file structure while skipping the parameters that aren’t understood.