CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
[Asset Support] Atom Basic Playback

Sample description

Overview

cri4u_samples_addon_asset01_playback.png

This sample uses the ACB Asset to perform a basic Cue playback.
Press the button in the window to play/stop the Cue.

Scene information


Middleware CRI ADX (CRI Atom)
Sample Asset Support Sample
Location /cri/unity/samples/UnityProject/Assets/CriAssetSamples/Scenes/
Scene file Scene_01_AssetPlayback.unity
ACF Asset /cri/unity/samples/UnityProject/Assets/CriAssetSamples/Data/DemoProj.acf
ACB Asset /cri/unity/samples/UnityProject/Assets/CriAssetSamples/Data/DemoProj.acb
AWB Asset /cri/unity/samples/UnityProject/Assets/CriAssetSamples/Data/DemoProj.awb


Description of the program


Basic playback using a CriAtomSourceForAsset.
This sample plays back audio while only requiring very little code.

CriAtomSourceForAsset

With the Asset Support Add-on, a CriAtomSourceForAsset is used instead of the usual CriAtomSource.
The CriAtomSourceForAsset uses an ACB Asset and a Cue ID to specify the Cue to play back.

[Reference]
Cri Atom Source For Asset

Loading the Cue Sheet

If the Cue Sheet is not yet loaded when the CriAtomSourceForAsset is initialized, it will be loaded automatically.
This sample uses the automatic loading mechanism of the CriAtomSourceForAsset to load the ACB Asset.

Playing the Cues

CriAtomSourceBase.Play is called when an event is triggered from the UI.

// Play the Cue set in CriAtomSourceBase via the Inspector
criAtomSource.Play();

Play another Cue from the same Cue Sheet by specifying its name.

// Play a Cue by specifying its name
criAtomSource.Play(name);