CRI ADX  Last Updated: 2024-07-17 10:47 p
Reading Data in Background while Playing Sound

Samples Directory

/CRIWARE/SDK/pc/samples/criatomex/playback_with_data_load


Sample Description

In order to read data while playing back sound, use the ::criFsLoader_Load function in CRI File System.

Some Cue must be adjusted so that sound does not break by centralizing file I/O flow rate in order to perform streaming playback.

Since CRI Atom uses CRI File System for accessing files, application can easily achieve file I/O flow rate management by using functions in CRI File System for reading 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) {
/* Post-loading task */
}
}
void criAtomEx_ExecuteMain(void)
Execute the server processing.