CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
[CriAtom] Playing installed sound data

Sample description

Overview

cri4u_samples_criatom_adv04_game_mini.png

This sample acquires sound data (ACF and ACB files) via the network to play it.
The sample follows the steps below.
  1. Install the ACF and ACB files via the network
  2. Register the installed ACF and ACB files in ADX2
  3. Play a Cue

How to use

  • [1. Install] button
    Starts to install the ACF and ACB files via the network.

  • [Delete installed data] button
    Deletes the local ACF and ACB files.

  • [2. Register ACF, ACB] button
    Registers the ACF and ACB files with the Atom library.

  • [Unregister ACF, ACB] button
    Unregisters the ACF and ACB files with the Atom library.

  • [3. Play Cue 'glass'] button
    Uses a CriAtomSource to play the Cue from the newly installed data.

Scene information


Middleware CRI ADX (CRI Atom)
Sample Advanced samples
Location /CRIWARE/SDK/unity/samples/UnityProject/Assets/Scenes/criatom/advanced/
Scene file Scene_04_PlaybackWithInstall.unity


Description of the program

Installing the ACF and ACB files via the network

The installation feature of FileMajik PRO is used to install the ACF and ACB files via the network.
For more information about the installation feature in FileMajik PRO, refer to [CriFs] Installing data.

Registering the installed ACF and ACB files with ADX

The installed data must be registered with the Atom library in order to be able to play it.
/* Register the installed data in Atom */
private void RegisterAcfAcb()
{
/* Register the installed ACF */
CriAtomEx.RegisterAcf(null, acfFilePath);
/* Add the installed ACB */
CriAtom.AddCueSheet(cueSheetName, acbFilePath, null);
Debug.Log("RegisterAcfAcb. " + Path.GetFileName(acfFilePath) + ", " + Path.GetFileName(acbFilePath));
registerdToAtom = true;
}

Playing a Cue

The names of a CueSheet and a Cue are specified for the CriAtomSource to play the Cue.
if (GUILayout.Button("3. Play Cue 'glass'")) {
/* 3. Play the installed data */
atomSource.cueSheet = cueSheetName;
atomSource.Play("glass");
Debug.Log("Play Cue 'glass'");
}