CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
[CriAtom] Simple playback

Description of the sample

Overview

cri4u_samples_criatom_scene01_game_mini.png

This is a simple sample that demonstrates cue playback.
When the "Push to Play" button on the screen is clicked, a gunshot is played.

Scene information


Middleware CRI ADX (CRI Atom)
Sample Basic sample
Location /CRIWARE/SDK/unity/samples/UnityProject/Assets/Scenes/criatom/basic/
Scene file Scene_01_SimplePlayback.unity
ProjInfo file CriAtomProjInfo.Unity.cs
ACF file DemoProj.acf
ACB file DemoProj.acb


Description of the program


Demo of simple playback.
This sample obtains the CriWare.CriAtomSource of the object and plays it.
Therefore it plays a sound with almost no programming.

[CRIWARE] object

The ACF and ACB files are configured for the CRI Atom component of the CRIWARE object.
On this scene, the DemoProj.acf, DemoProj.acb, and DemoProj_stream.awb files are loaded.

Note
To know more about the creation method, see " CRI Atom " and " Cri Atom Source ".

[Cube] object

A cue sheet name (ACB) and a cue name are associated to the CRI Atom Source component of the Cube object.
The specified cue of the cue sheet will be played.

Cue sheet and ACB file names

The cue sheet and ACB file names are identical (except for the extension of the ACB file).
If you have changed the name of the file instead of using the data created in CRI Atom Craft as it is, remove the extension from the name of the ACB file.

Playing an CriAtomSouce

When the play button is clicked, the CriWare.CriAtomSource::Play function is called.

if (Scene_00_GUI.Button(new Rect(100, 100, 160, 160), "Push to Play")) {
atomSource.Play();
}

Attention
In this sample, the number of simultaneous playbacks of sound data is not limited. If requesting playbacks in a row, an error message may be output on the CRI library side.
In this case, the application must adjust the initialization parameters of the CRI library.
Or, the settings such as the Cue limit or the Category limit features must be applied to the CRI ADX data. By doing this, the number of simultaneous playbacks of sound data can be limited without changing application's source code.