TLV320 WAV Player

This page describes how the TLV320 and a USB host can be used to play Wave files.

The overall architecture is designed like this:

/media/uploads/p07gbar/block_diagram.png

Which translates to: When a file is opened, the class scans the files header for various useful information: the sample rate, sample word size and number of channels. This is then stored in the players configuration. Here the file is sourced on a USB flash drive, using the USB MSCFilesystem library. When the player is told to play, it uses a series of fread()s to load up a circular buffer. When the I2S ISR triggers (because the TLV320 requires more data), data is loaded from the circular buffer into the I2S FIFO where it is then sent out to the DAC. The sample rate of the audio is re-sampled to 48KHz to match the limited sample rates the TLV320 supports.

The Wav Player, streaming off USB, supports data rates such as 44.1KHz 16bit mono and 11.025kHz 16bit stereo and will alert if it deems the streaming to slow.

Import programWavPlayer_test

A test program for the WavPlayer class, works on the RS Animatronic Lab Board


All wikipages