English
Language : 

VS1033 Datasheet, PDF (43/70 Pages) List of Unclassifed Manufacturers – MP3/AAC/WMA/MIDI AUDIO CODEC
VLSI
Solution y
VS1033a PRELIMINARY
VS1033A
9. OPERATION
9.4.4 Playing ADPCM Data
In order to play back your IMA ADPCM recordings, you have to have a file with a header as described
in Chapter 9.4.3. If this is the case, all you need to do is to provide the ADPCM file through SDI as you
would with any audio file.
9.4.5 Sample Rate Considerations
VS10xx chips that support IMA ADPCM playback are capable of playing back ADPCM files with
any sample rate. However, some other programs may expect IMA ADPCM files to have some exact
sample rates, like 8000 or 11025 Hz. Also, some programs or systems do not support sample rates below
8000 Hz.
However, if you don’t have an appropriate clock, you may not be able to get an exact 8 kHz sample rate.
If you have a 12 MHz clock, the closest sample rate you can get with 2.0 × 12 MHz and d = 12 is
fs = 7812.5Hz. Because the frequency error is only 2.4%, it may be best to set fs = 8000Hz to the
header if the same file is also to be played back with an PC. This causes the sample to be played back a
little faster (one minute is played in 59 seconds).
Note, however, that unless absolutely necessary, sample rates should not be tweaked in the way described
here.
If you want better quality with the expense of increased data rate, you can use higher sample rates, for
example 16 kHz.
9.4.6 Example Code
The following code initializes IMA ADPCM encoding on VS1003b/VS1023 and shows how to read the
data.
const unsigned char header[] = {
0x52, 0x49, 0x46, 0x46, 0x1c, 0x10, 0x00, 0x00,
0x57, 0x41, 0x56, 0x45, 0x66, 0x6d, 0x74, 0x20, /*|RIFF....WAVEfmt |*/
0x14, 0x00, 0x00, 0x00, 0x11, 0x00, 0x01, 0x00,
0x40, 0x1f, 0x00, 0x00, 0x75, 0x12, 0x00, 0x00, /*|........@......|*/
0x00, 0x01, 0x04, 0x00, 0x02, 0x00, 0xf9, 0x01,
0x66, 0x61, 0x63, 0x74, 0x04, 0x00, 0x00, 0x00, /*|.......fact....|*/
0x5c, 0x1f, 0x00, 0x00, 0x64, 0x61, 0x74, 0x61,
0xe8, 0x0f, 0x00, 0x00
};
unsigned char db[512]; /* data buffer for saving to disk */
Version 0.6, 2005-01-05
43