Datasheet
HH
VS1053B OGG VORBIS ENCODER VSMPG
5.4 Streaming Example
Let’s take a streaming system that uses two VS1053b’s, both running at 12.288 MHz
crystals, and using best possible quality: the 44.1 kHz stereo Music Profile, Quality 5.
This is what you need to do on the encoder side:
• Load and start the VS1053b Ogg Vorbis Encoder.
• If you want to maintain synchronization for an indefinite time, send also the sam-
ple counter in your message packats. For how to read the sample counter, see
Chapter 5.1, Sample Counter.
This is what you need to do on the decoder side:
• Load and run the VS1053b Patches package (with or without FLAC decoding) to
the decoding VS1053b.
• As seen in Chapter 2.6, Samplerate Considerations, the encoding VS1053b records
at 43885.7 Hz although it reports using 44100 Hz. So, set the playback rate as told
in Chapter 5.3, Playback Speed Adjustment.
• If you want to maintain sync indefinitely, compare the recording sample counter
value to the sample counter of the decoder. For how to read the sample counter
at the decoder and, refer to the documentation of the VS1053b Patches package,
Chapter Sample Counter.
• Decide what your target difference between the sample counters are. If, for in-
stance, you are using Internet as your transfer medium, and you have lots of buffer-
ing in your microcontroller, the time may be e.g. 10 seconds (441000 samples).
On an RF link, the time difference may be e.g. 0.5 seconds (22050 samples).
• By making very small positive and negative adjustments to the playback sample-
rate, keep the recording and playback sample counter difference as constant as
possible.
If you take all these steps, you will have a streaming system that both keeps synchro-
nized for extended periods of time, and will self-adjust back to sync even after such
issues as packet loss.
Rev. 1.70c 2012-11-16
Page 37(39)