This playback can only be done from the CD-ROM, and the STM library is required for this reading.
This is because the GFS library cannot obtain subheader information.
This playback example is included in the sample program of the PCM library, so please refer to it (SMPPCM2).
Even when playing ADPCM data, predicted values must first be calculated and data correction must be performed, so decoding one sample of data takes more time than PCM data.
Some devices perform this decoding in hardware, but the Sega Saturn does not have such a chip, so all decoding is done by software.
For this reason, please note that ADPCM playback is a very demanding job on the Sega Saturn.
CD-ROM XA has two ADPCM levels, B and C, depending on 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 according to the CD-ROM XA standard (Mode2 Form2).
Therefore, for playback, it is necessary to refer to this subheader to obtain information about which level (B or C) and mode (STEREO or MONO).
With the library provided by SEGA, this information acquisition work can be performed using the STM library.
Compress using the ADPCM encoder provided by our company.
Write the created data in the VCD script file.
However, please note that CD-XA can only be used with FORM2 of MODE2.
(Example) When not interleaving (37.8KHz, Mono)
File SAMPLE1.XA;1 FileSource "SAMPLE1.ADP" RealTime DataType FORM2 SourceType MONO_B CodingInformation 0 EndFileSource EndFile
The file on the built disk image will be played.
For details, please refer to the SGL document "SGL\DOC\ADPCM.TXT".
Create data by compressing it using a tool called "AudioStack" sold by .
Calculation formula -oct FNS=(2 ×1024×Fs)/44.1-1024 oct value 5.5125KHz → -3 11.0250KHz → -2 22.0500KHz → -1 44.1000KHz → 0 88.2000KHz → 1 For example, if the rate is "18.9KHz", the OCT value will be -2 and the FNS value will be: -(-2) FNS = (2 ×1024×18.9)/44.1-1024 = (4 ×1024×18.9)/44.1-1024 = 731.4285714
Therefore, errors will occur whether the FNS setting is 2DB or 2DC.
To avoid this, add silent data at the end of the data to avoid being affected by the error.
You should be fine if you add about 0.21 seconds for 1000 samples, which is equivalent to one ring buffer, to the data size.