Datasheet
HH
VS1053B OGG VORBIS ENCODER VSMPG
Contents
VS1053b Ogg Vorbis Encoder Front Page 1
Table of Contents 2
1 Introduction 4
2 Using the Ogg Vorbis Encoder 5
2.1 Limitations and Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Ogg Vorbis Encoder Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.1 Profile Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.2 Profile Quality Settings . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Running the VS1053b Ogg Vorbis Encoder . . . . . . . . . . . . . . . . . 8
2.3.1 VS1053b Ogg Vorbis Encoder Registers . . . . . . . . . . . . . . . 8
2.3.2 Loading and Starting the Code . . . . . . . . . . . . . . . . . . . . 9
2.3.3 Reading Ogg Vorbis Data . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.4 Reading Additional Data while Recording Ogg Vorbis . . . . . . . 11
2.3.5 Finishing Ogg Vorbis Recording . . . . . . . . . . . . . . . . . . . 11
2.4 Recording Levels and Automatic Gain Control (AGC) . . . . . . . . . . . . 12
2.4.1 Reading the Recording Level . . . . . . . . . . . . . . . . . . . . . 12
2.4.2 Setting AGC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4.3 Building a Useful VU Meter . . . . . . . . . . . . . . . . . . . . . . 14
2.4.4 Converting from Linear to Decibel Scale . . . . . . . . . . . . . . . 16
2.4.5 vs1053oggrec.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.5 Vox and Pause Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5.1 Vox and Pause Registers . . . . . . . . . . . . . . . . . . . . . . . 23
2.5.2 Vox Output to GPIO4 . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.6 Samplerate Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.7 Post-Processing the Recording with VorbisGain . . . . . . . . . . . . . . . 24
3 The Ogg Vorbis Format 25
3.1 Introduction to Ogg Vorbis . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.1.1 Variable Bit-Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.1.2 Transcoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.2 Compressing into Ogg Vorbis with a PC . . . . . . . . . . . . . . . . . . . 27
3.2.1 Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2.2 Compressing CD-Quality Music . . . . . . . . . . . . . . . . . . . . 27
3.2.3 Compressing Speech . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3 Post-Processing with VorbisGain . . . . . . . . . . . . . . . . . . . . . . . 30
4 How to Load a Plugin 31
4.1 How to Load a .PLG File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2 How to Load an .IMG File . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.2.1 Example Microcontroller .IMG File Decoder . . . . . . . . . . . . . 33
5 Building a Streaming System 34
5.1 Sample Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2 End-to-End Delay of a Streaming System . . . . . . . . . . . . . . . . . . 36
Rev. 1.70c 2012-11-16
Page 2(39)