Datasheet

HH
VS1053B OGG VORBIS ENCODER VSMPG
5.1 Sample Counter
An 32-bit sample counter, added for v1.3, is designed to help streaming Ogg Vorbis files.
It tells the absolute sample number that is currently recorded through the ADC when an
Ogg Vorbis file is being recorded. The sample counter is located at the beginning of the
X memory user area, at address 0x1800, and it can be read through SCI.
The VS1053b Patches package has a similar counter. This makes it possible to main-
tain synchronization between the encoder and the decoder within an accuracy of a few
samples if the data link has a constant delay and the sample counter data is transmitted
from the sender to the receiver (e.g. RF link).
Note: The sample counter is not valid for the first few milliseconds of encoding.
As the sample counter is 32 bits and the SCI interface is 16 bits, the most significant bits
of the counter may change while it is being read. To prevent incorrect values, read the
sample counter using the following, self-correcting code:
The code is used like this:
The VS1053b Patches package, which contains the other half of the Ogg Vorbis sample
counter as well as some Ogg Vorbis decoding quality patches, is available at
Rev. 1.70c 2012-11-16
Page 35(39)