Datasheet

VS1053b Datasheet
10 OPERATION
10.6 Feeding PCM Data
VS1053b can be used as a PCM decoder by sending a WAV file header. If the length sent in the
WAV header is 0xFFFFFFFF, VS1053b will stay in PCM mode indefinitely (or until SM_CANCEL
has been set). 8-bit (unsigned) linear and 16-bit (signed, 2’s complement) linear audio is sup-
ported in mono or stereo. A WAV header looks like this:
File Offset Field Name Size Bytes Description
0 ChunkID 4 "RIFF"
4 ChunkSize 4 0xff 0xff 0xff 0xff
8 Format 4 "WAVE"
12 SubChunk1ID 4 "fmt "
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 "data"
56 SubChunk2Size 4 0xff 0xff 0xff 0xff Data size
The rules to calculate the four variables are as follows:
S = sample rate 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.
Example: A 44100 Hz 16-bit stereo PCM header would read as follows:
0000 52 49 46 46 ff ff ff ff 57 41 56 45 66 6d 74 20 |RIFF....WAVEfmt |
0100 10 00 00 00 01 00 02 00 44 ac 00 00 10 b1 02 00 |........D.......|
0200 04 00 10 00 64 61 74 61 ff ff ff ff |....data....|
10.7 Ogg Vorbis Recording
Ogg Vorbis is an open file format that allows for very high sound quality with low to medium
bitrates.
Ogg Vorbis recording is activated by loading the Ogg Vorbis Encoder Application to the 16
KiB program RAM memory of the VS1053b. After activation, encoder results can be read
from registers SCI_HDAT0 and SCI_HDAT1, much like when using PCM/ADPCM recording
(Chapter 10.8).
Three profiles are provided: one for high-quality stereo recording at a bitrate of approx. 140
kbit/s, and two for speech-quality mono recording at a bitrates between 15 and 30 kbit/s.
To use the Ogg Vorbis Encoder application, please load the application from VLSI Solution’s
Web page http://www.vlsi.fi/en/support/software/vs10xxapplications.html and read the accom-
panying documentation.
Version: 1.22, 2014-12-19 52