★ FAQ ★ Sound related This playback can only be played from a CD-ROM, and this reading requires the STM library.
This is because the GFS library cannot get the subheader information.
This playback example is included in the sample program of the PCM library, so please refer to it (SMPPCM2).
When playing back ADPCM data, it takes longer than PCM data to decode one sample of data because the predicted value must first be calculated and the data corrected.
Some have this decoding work in hardware, but in the case of Sega Saturn, since such a chip is not installed, all decoding is done by software.
For this reason, in Sega Saturn, playing ADPCM should be considered a very burdensome task.
CD-ROM XA has two ADPCM levels, B and C, depending on the data compression conditions.
Level B → Sample frequency 37.8kHz 4bit FM level sound quality Level C → Sample frequency 18.9kHz 4bit AM level sound quality
Each of the above is divided into STEREO / MONO modes.
This information is not attached to the file, but is recorded in the submode of the subheader part, which is the standard of CD-ROM XA (Mode 2 Form 2).
Therefore, for playback, it is necessary to refer to this subheader part to obtain information on which level (B or C) and which mode (STEREO or MONO).
With the library provided by SEGA, this information acquisition work can be performed with the STM library.
(Example) When not interleaving (37.8KHz, Mono)
File SAMPLE1.XA; 1
FileSource "SAMPLE1.ADP"
RealTime
DataType FORM2
SourceType MONO_B
CodingInformation 0
EndFileSource
EndFile
Create data by compressing with a tool called "AudioStack" sold by.
Calculation formula -oct
FNS = (2 x 1024 x Fs) / 44.1-1024
oct value 5.5 125KHz → -3
11.0250KHz → -2
22.0500KHz → -1
44.1000KHz → 0
88.2000KHz → 1
For example, when the rate is "18.9KHz", the OCT value is -2 and the FNS value is-(-2).
FNS = (2 x 1024 x 18.9) / 44.1-1024
= (4 x 1024 x 18.9) / 44.1-1024
= 731.4285714
Therefore, the FNS setting will have an error in both 2DB and 2DC.
To avoid this, add silence data at the end of the data to make it unaffected by the error.
For the data size, it is okay to add about 0.21 seconds for 1000 samples, which is equivalent to one ring buffer.
★ FAQ ★ Sound related