CRI ADX  Last Updated: 2024-07-17 10:47 p
Read Error
When reading a file from a disc media, it may fail due to a damage/smear on the disc surface. (A read error)
To detect a read error by Atom library, appropriate processes need to be taken in the following modules.
  • ACF
  • ACB
  • AtomEx player
  • AWB
  • Atom player

Error Check in ACF Registration

If a read error occurs in ACF file registration by the criAtomEx_RegisterAcfFile function, the criAtomEx_RegisterAcfFile function returns CRI_FALSE.
If a read error detection is needed, check the return value of the criAtomEx_RegisterAcfFile function, and perform an appropriate process. (e.g. displaying an error message.)

[Note]
When registering ACF information using the ::criAtomEx_RegisterAcfConfig function or the criAtomEx_RegisterAcfData function, an error check is not needed.

Error Check in ACB Loading

If a read error occurs in ACB file loading using the criAtomExAcb_LoadAcbFile function, the criAtomExAcb_LoadAcbFile function returns CRI_NULL.
If a read error detection is needed, check the return value of the criAtomExAcb_LoadAcbFile function, and perform an appropriate process. (e.g. displaying an error message.)

[Note]
When loading on-memory ACB data using the criAtomExAcb_LoadAcbData function, an error check is not needed.

Error Check in File Playback by AtomEx Player

If a read error occurs during sound data streaming playback, the AtomEx player status changes to an error.
AtomEx player status can be acquired by the criAtomExPlayer_GetStatus function.

If a read error detection is needed, check the AtomEx player status at some interval, and set an appropriate action. (e.g. displaying an error message.)

// Set file
criAtomExPlayer_SetFile(player, NULL, "sample.adx");
// Start playback
:
// Main loop
for (;;) {
:
// Status check
status = criAtomExPlayer_GetStatus(player);
// Perform error handling when an error occurs
:
}
:
}
CriAtomExPlayerStatus criAtomExPlayer_GetStatus(CriAtomExPlayerHn player)
Get the player status.
void criAtomExPlayer_SetFile(CriAtomExPlayerHn player, CriFsBinderHn binder, const CriChar8 *path)
Set the sound data to play (specifying a file name)
CriAtomExPlaybackId criAtomExPlayer_Start(CriAtomExPlayerHn player)
Start the playback.
@ CRIATOMEXPLAYER_STATUS_ERROR
Definition: cri_le_atom_ex.h:3671


Error Check in AWB Loading

During Synchronous TOC Information Read-In

When a read error occurs at loading TOC information of AWB file by the criAtomAwb_LoadToc function, the criAtomAwb_LoadToc function returns CRI_FALSE.

If a read error detection is needed, check the return value of the criAtomAwb_LoadToc function, and set an appropriate action. (e.g. displaying an error message.)

During Asynchronous TOC Information Read-In

When a read error occurs at loading TOC information of AWB file by the criAtomAwb_LoadTocAsync function, AWB handle status changes to an error. AWB handle status can be acquired by the criAtomAwb_GetStatus function.

If user needs to detect a read error, check the AWB handle status periodically during reading TOC information, and take an appropriate action when an error occurs. (e.g. displaying an error message.)

[Note]
An error check is not needed when loading an on-memory ACB data using the criAtomExAcb_LoadAcbData function.

Error Check in File Playback by Atom Player

When a read error occurs during streaming a sound data, the Atom player status changes to an error.
The Atom player status can be acquired by the criAtomPlayer_GetStatus function.

If user needs to detect a read error, check the Atom player status periodically, and perform an appropriate process when an error occur. (e.g. displaying an error message.)

// Set file
criAtomPlayer_SetFile(player, NULL, "sample.adx");
// Start playback
:
// Main loop
for (;;) {
:
// Status check
status = criAtomPlayer_GetStatus(player);
if (status == CRIATOMPLAYER_STATUS_ERROR) {
// When an error occurs, run an error process
:
}
:
}
void criAtomPlayer_Start(CriAtomPlayerHn player)
Start playback.
void criAtomPlayer_SetFile(CriAtomPlayerHn player, CriFsBinderHn binder, const CriChar8 *path)
Set sound data (specify file)
CriAtomPlayerStatus criAtomPlayer_GetStatus(CriAtomPlayerHn player)
Get status.
@ CRIATOMPLAYER_STATUS_ERROR
Definition: cri_le_atom.h:2315


Error Check by CRI File System

A file read error may occur during loading a file by CRI File System library API. (criFsLoader_Load and other functions)

To see how to detect a read error using CRI File System library, please refer to CRI File System "FileMajik PRO" user's manual.