CRI ADX  Last Updated: 2025-05-07 13:34 p
Reading data while playing audio

Sample directory

/cri/pc/samples/criatomex/playback_with_data_load

Data used in the sample

/cri/common/smpdata/criatomex/
  • SampleProject.acf
  • AtomCueSheet.acb
  • AtomCueSheet.awb

Sample description

To load data while playing audio, use the ::criFsLoader_Load function of the CRI File System.


Some cues perform streaming playback, so you need to centralize the file I/O flow management and adjust it to prevent audio interruptions.


CRI Atom uses the CRI File System for file access processing, so applications can easily manage file I/O traffic by using CRI File System functions to read data.


CriFsLoaderHn loader;
CriFsLoaderStatus loader_status;
/* Issue loading request */
criFsLoader_Load(loader, NULL, FILE, 0, file_size, buf, buf_size);
/* Application's main loop */
for(;;) {
/* Wait for V-synchronization */
criFwSys_WaitVsync();
/* Server processing */
/* Get CriFsLoader status */
criFsLoader_GetStatus(loader, &loader_status);
if (loader_status == CRIFSLOADER_STATUS_COMPLETE) {
/* Processing when loading is complete */
}
}
void criAtomEx_ExecuteMain(void)
Execute the server processing.