Data Sheet

PRELIMINARY
VS1063a Datasheet
10 OPERATION
10.6 Feeding PCM Data
VS1063a can be used as a PCM decoder by sending a WAV file header, followed by PCM
data. If the length sent in the WAV header is 0xFFFFFFFF, VS1063a will stay in PCM mode
indefinitely (or until SM_CANCEL has been set). 8-bit linear and 16-bit linear audio is supported
in mono or stereo. A WAV header looks like this:
File Offset Field Name Size Bytes Description
0 ChunkID 4
4 ChunkSize 4 0xff 0xff 0xff 0xff
8 Format 4
12 SubChunk1ID 4
16 SubChunk1Size 4 0x10 0x0 0x0 0x0 16
20 AudioFormat 2 0x1 0x0 Linear PCM
22 NumOfChannels 2 C0 C1 1 for mono, 2 for stereo
24 SampleRate 4 S0 S1 S2 S3 0x1f40 for 8 kHz
28 ByteRate 4 R0 R1 R2 R3 0x3e80 for 8 kHz 16-bit mono
32 BlockAlign 2 A0 A1 0x02 0x00 for mono, 0x04 0x00 for stereo 16-bit
34 BitsPerSample 2 B0 B1 0x10 0x00 for 16-bit data
52 SubChunk2ID 4
56 SubChunk2Size 4 0xff 0xff 0xff 0xff Data size
The rules to calculate the four variables are as follows:
S = samplerate in Hz, e.g. 44100 for 44.1 kHz.
For 8-bit data B = 8, and for 16-bit data B = 16.
For mono data C = 1, for stereo data C = 2.
A =
C×B
8
.
R = S × A.
Note: When playing back PCM, VS1063a ignores R and A. You may set them to anything if
you don’t intend the datastreams to be sent to any other devices.
Example: A 44100 Hz 16-bit stereo PCM header would read as follows:
Version: 0.42, 2011-11-24 54