Datasheet
VS1053b Datasheet
10 OPERATION
If you know beforehand how much you are going to record, you may fill in the complete header
before any actual data. However, if you don’t know how much you are going to record, you have
to fill in the header size datas F, S and D after finishing recording.
The 128 words (256 words for stereo) of an ADPCM block are read from SCI_HDAT0 and
written into file as follows. The high 8 bits of SCI_HDAT0 should be written as the first byte to a
file, then the low 8 bits (big-endian order). Note that this is contrary to the native byte order of
some 16-bit microcontrollers, and you may have to take extra care to do this right. Note also,
that this is different from how PCM data is written to a file (see Chapter 10.8.3).
To see if you have written the mono file in the right way check bytes 2 and 3 (the first byte
counts as byte 0) of each 256-byte block. Byte 2 should be in the range 0..88 and byte 3 should
be zero. For stereo you check bytes 2, 3, 6, and 7 of each 512-byte block. Bytes 2 and 6 should
be in the range 0..88. Bytes 3 and 7 should be zero.
Below is an example of a valid header for a 44.1 kHz stereo IMA ADPCM file that has a final
length of 10038844 (0x992E3C) bytes:
0000 52 49 46 46 34 2e 99 00 57 41 56 45 66 6d 74 20 |RIFF4...WAVEfmt |
0010 14 00 00 00 11 00 02 00 44 ac 00 00 a7 ae 00 00 |........D.......|
0020 00 02 04 00 02 00 f9 01 66 61 63 74 04 00 00 00 |........fact....|
0030 14 15 97 00 64 61 74 61 00 2e 99 00 |....data....|
10.8.5 Playing ADPCM Data
In order to play back your PCM / IMA ADPCM recordings, you have to have a file with a header
as described in Chapter 10.8.3 or Chapter 10.8.4. 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.
10.8.6 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.
If you want better quality with the expense of increased data rate, you can use higher sample
rates, for example 16 kHz.
Version: 1.22, 2014-12-19 57