CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
CRIWARE Library Initializer
This component makes it possible to customize the initialization of CRIWARE, for example by specifying the maximum number of handles.
Attention
To use the features of the plugin, please be sure to allocate the CRIWARE Library Initializer component in the scene.
The plugin may not work properly without using this component.


adx2u_initializer_float.png


[Remarks]
You can also create the CRIWARE Library Initializer from the CRI -> Create CRIWARE Library Initializer menu. In this case it will be created as a game object.

Refer to the sections below for how to set each initialization parameter.

Details about each initialization parameter

Initializes File System checkbox
It initializes CRIWARE's common file system"CRI File System library".

File System Config group
You can set the initialization parameters of the CRI File System library.

Initialization Parameters of the CRI File System Library
Parameter Description Default value
Number of Loaders Number of the CriWare.CriFsLoader handles that are used. A
CriFsLoader is used for normal file loading.
If you use a CRI Atom function, you must increase the Number of Loaders value by at least one.
16
Number of Binders Number of the CriWare.CriFsBinder handles that are used. A
CriFsBinder is used to load files from folders and CPK files (dedicated packed files).
Also increase the number of the binders by one for each AWB file you want to load (one binder is used internally).
8
Number of Installers Number of the CriWare.CriFsInstaller handles that are used. A
CriFsInstaller is used to copy files to external writable devices (such as a HDD).
Each time you increase the Number of Installers by 1, the amount of memory allocated increases by about 2KB.
2
Install Buffer Size Settings for CriWare.CriFsInstaller.
Specify the buffer size in KB when copying a file.
4096 [KiB]
Max Length of Path Specify the maximum length of a path that is specified for loading or installation.
This value is also used as the maximum length of a URL for an HTTP request.
It includes a final character. So, the number of characters that you can use is "this value - 1".
256 [byte]
User Agent String The UserAgent string used in HTTP requests. Max: 255 characters (255 bytes).
None
Minimize FD Usage When this checkbox is enabled, the number of file descriptors that are used by the plugin is minimized.
Enable this when you want to save the file descriptor. Note that it may slightly impact the reading performance of the file.
Disabled
Enable CRC Check When this checkbox is selected, it will perform a CRC check on CPK files.
Disabled
Android Config Android configuration Default value
Device Read Bitrate Android device loading speed setting. 50000000 [bps]
Initializes Atom checkbox
It initializes the "CRI Atom library" (library for CRI ADX).

Atom Config group
You can set the initialization parameters of the CRI Atom library.
Initialization Parameters of the CRI Atom Library
Parameter Description Default value
ACF File Name Specifies the default ACF file. None
Max Virtual Voices Maximum number of virtual voices.
Number of voices for simultaneous playback control.
If there are movies played by Mana and the number of audio tracks in movies being simultaneously played exceeds 4, it is necessary to increase this value by the number of exceeded audio tracks.
32
Max Voice Limit Groups Maximum number of voice limit groups.
If the number of voice limit groups created with authoring tool exceeds the setting value, loading ACF file will fail.
32
Max Parameter Blocks Maximum number of parameter blocks.
This is the number of areas for parameter management during voice playback. If you run out, some parameters will not be set for the playback Cue.
1024
Max Buses Maximum number of buses.
This is the maximum number of Buses available for audio processing. Specify a value equal to or greater than the number of Buses set on the data side.
8
Max Categories Maximum number of categories.
If the number of voice limit groups created with authoring tool exceeds the setting value, loading ACF file will fail.
32
Max Aisacs Maximum number of AISACs.
This is the maximum number of AISACs that can be associated with a Cue.
The maximum value that can be specified is 55.
8
Max Bus Sends Maximum number of Bus Sends.
This is the maximum number of Buses to which a single Voice can be sent simultaneously.
The maximum value that can be specified is 32.
8
Max Sequence Events Per Frame Maximum number of sequence events in each frame. Sequence callback events, etc., will be handled according to this value.
If multiple events occur at the same time and dropping occurs, increase the setting value.
2
Max Beat Sync Callbacks Per Frame Maximum number of beat-synchronization callbacks in each frame BeatSync callbacks will be handled according to this value.
If multiple callbacks occur at the same time which causes callbacks to be missing, please increase this value.
1
Max Cue Link Callbacks Per Frame Maximum number of Cue Link callbacks per frame. Cue Link callbacks will be handled according to this value.
If multiple callbacks occur at the same time which causes callbacks to be missing, please increase this value.
1
Categories per Playback Number of category references in playback units.
If the number of reference categories in the Cue set on the data side exceeds the setting value, loading of ACF fails.
4
Max Faders Maximum number of Faders.
Sets the maximum number of Faders that can be used within the Atom library.
Faders specified here are reserved during the initialization and used when playing TrackTransitionBySelector data.
4
Sampling Rate Output sampling rate.
When using HCA-MX encoded data, the same sampling rate must be used for all the sounds.
48 kHz will be used on most platforms if 0 (for the default value) is specified.
0
Server Frequency Operating frequency of the server processes from CRI Atom.
Server processes handle playback requests, update parameters and decode and output sound data.
60 [Hz]
ASR Output Mode When [Default], the sound is output in the maximum channels supported on the platform.
When set to [Stereo], it will output to the device in 2ch.
You may also select [4ch], [5.1ch], [7.1ch], or [7.1.4ch].
Default
Use Time For Seed Specifies whether to use time for the random seed. The random seed is used by the random sound playback features.
If time is not used, the random seed is fixed.
Enabled
In Game Preview Specifies whether to use the in-game preview function.
Select from Disable, Enable, Follow Build Setting.
For "Follow Build Setting", in-game preview will only be enabled when "Development Build" is checked in the Editor's build settings.
Not supported on some platforms.
Parameter Description Default value
Max Preview Objects Maximum number of management resources for in-game preview
Each ACB handle uses one of these resources during in-game preview.
Therefore, please set a value larger than the number of ACBs used at the same time.
200
Communication Buffer Size Communication buffer size
Specifies the size of the buffer used to communicate between the monitor library and the authoring tool.
There are two buffers, one for transmission and the other for reception. Each of them will have 1.5x the size indicated here.
Therefore, the total size of the memory used for the communication buffers is 3 times this value.
2048[KiB]
Update Interval Update interval of the playback position
Specifies the interval at which the playback positional information is sent when the server processing is executed.
Change this value to reduce the frequency at which the positional information is sent without impacting the frequency at which the server processing occurs.
For example, if the "Update Interval" is set to 2, the positional information will only be sent once every two server calls.
(The frequency at which the positional information is sent is therefore halved.)
8[counts of server process]
Disable
Use Spatializer Whether to initialize the Spatializer
When enabled, it will use the Binauralizer to output stereo from the ASR.
Disabled
Keep Playing Sound On Pause Whether to pause Atom audio output when Unity is paused, e.g. when the pause button is pressed while the Editor is running. Do not Pause
Enable SonicSYNC Whether to enable SonicSYNC (common in platforms)
iOS and Android use this platform-specific flag to enable/disable SonicSYNC.
Please check the initialization configuration specific to each platform.
Enabled
Standard Voice Pool Config Standard voice pool configuration:
The standard voices can play ADX and HCA data.
Parameter Description Default value
Memory Voices Number of standard voices that can use memory playback 16
Streaming Voices Number of standard voices that can use streaming playback.
One CriFsLoader handle is required for each streaming playback.
When increasing the value of Streaming Voices by one, you must also increase the value of Number of Loaders in the File System Config group by one.
8
HCA-MX Voice Pool Config HCA-MX voice pool configuration:
The HCA-MX voice can only play HCA-MX data.
Parameter Description Default value
Memory Voices Number of HCA-MX voices that can use memory playback 0
Streaming Voices Number of HCA-MX voices that can use streaming playback
One CriFsLoader handle is required for each playback.
When increasing the value of Streaming Voices by one, you must also increase the value of Number of Loaders in the File System Config group by one.
0
Editor Config Configuration for Unity Editor Default Value
Enable User PCM Out Mode Whether to initialize in user PCM output mode.
If this flag is enabled, no sound will be output by the Atom library.
Internally, PCM data will be periodically discarded from the output buffer.
Enable this to output a buffer at the rate of your choice (e.g., when recording).
Disabled
PCM Buffer Length The size of the output buffer when the User PCM Out Mode is enabled. 4096 [Sample]
Linux Config Configuration for Linux Default value
Sound Output To decide which system to be used for sound output.
Select from Default (PulseAudio)/PulseAudio/ALSA.
PulseAudio
PulseAudio Latency Latency setting (unit: microseconds) when outputting PulseAudio.
If the sound breaks up during execution, you can increase this setting's value.
The default setting is the value assuming the server frequency is 60Hz.
When initializing with a low server frequency, you need to increase this setting value.
60000(60msec)
iOS Config iOS configuration Default value
Enable SonicSYNC Enables SonicSYNC . Enabled
Buffering Time Buffer size (milliseconds)
If the audio is interrupted when on iOS device, please increase the size of the buffer. To reduce the latency, decrease the size of the buffer.
50 [msec]
Override iPod Music Controls whether to stop the iPod playback.
A similar iOS-specific setting exists in Unity but, when you use the Atom library, the setting in the Atom library is always used.
Disabled (do not stop)
Android Config Android configuration Default value
Enable SonicSYNC Enables SonicSYNC . Enabled
Buffering Time Buffer size (milliseconds) for ASR(normal playback) 133 [msec]
Start Buf Time Playback start buffer size (milliseconds) for NSR(low-latency playback) 100 [msec]
Low Latency Standard Voice Pool Config Low-latency standard voice pool configuration
Parameter Description Default value
Memory Voices Number of voices in the low-latency standard voice pool that can use memory playback 0
Streaming Voices Number of voices in the low-latency standard voice pool that can use streaming playback
One CriFsLoader handle is required for each playback.
When increasing the value of Streaming Voices by one, you must also increase the value of Number of Loaders in the File System Config group by one.
0
Use Android Fast Mixer Whether to enable Android Fast Mixer.
When enabled, internal resampling provides lower delay audio playback.
Enabled
Use Asr For Default Playback Whether to do default audio playback with non-low latency playback.
When enabled, players that do not have low-delay playback enabled explicitly perform non-low-delay playback.
Enabled
[Beta] Use AAudio Whether to enable AAudio audio playback on Android 8 or higher devices.
When enabled, compatible devices will be able to play audio with lower latency.
This feature is a beta version, which may cause unintended behavior during audio playback.
Disabled
Stream Type Output audio stream type.
Specifies the type of the audio output stream on Android.
This setting is only valid when SonicSYNC is enabled.
Music(Default)
Initializes Mana checkbox
It initializes the "CRI Mana library" (library for CRI Sofdec).

Mana Config group
You can set initialization parameters for the CRI Mana library.
Initialization parameters for the CRI Mana library
Parameter Description Default value
Number Of Decoders <tdMaximum number of simultaneous player handles
One player handle and one CriFsLoader handle is required for each movie playback.
When increasing the value of Number Of Decoders by one, you must also increase the value of Number of Loaders in the File System Config group by one.
Note that two decoders are used to play an "alpha movie".
8
Number Of Max Entries Total number of movies that can be registered with player handles when using the concatenated playback function.
They are shared among all the player handles.
4
Do Not Initialize On Awake checkbox
When this is selected, the plugin is not automatically initialized on Awake.
To change the initialization parameters dynamically from a script, select it.
When this is selected, manual initialization with the CriWare.CriWareInitializer::Initialize function is always required.
Do Not Destroy On Load checkbox
When this is not selected, the library is terminated at a scene change.
Select this checkbox when you want to play sound across scenes or if you do not need to change the initialization settings.
Only one CRIWARE Library Initializer exists in the entire application.
If the CRIWARE Library Initializer is set for multiple scenes and the scenes are changed, the Hierarchy window may show two CRIWARE Library Initializers. The second CRIWARE Library Initializer is an empty and invalid object. It is harmless because it is released when the scene is released.

Attention
If another CRIWARE component is used before CriWareInitializer is created, the library will be initialized with the default parameters, and the parameters specified in CriWareInitializer will not take effect.
To make sure that the parameters specified in CriWareInitializer are used for initialization, use the following steps.
  • Place the CriWareInitializer component in the first scene after the application is started.
  • Set [Execution Order] so that CriWareInitializer.cs is executed earlier than the other scripts.
  • Select the Do Not Destroy On Load checkbox to maintain the initialized status after a scene change.


About the Number of Initialization Parameters Necessary for FileSystem

The minimum values for each initialization parameter under [Initialize FileSystem] vary depending on the usage of Atom/Mana.
Note:
When using "CRI Assets", the loading of CRI Assets with the "OnMemory" DeployType does not consume any FileSystem resources.
For details, refer to Setting the "Deploy Type" .

Number of Loaders

The minimum value is obtained from the sum of the following items:
  • Audio playback via normal Atom functions (mainly for reading the ACB files)
    • ONE (i.e., multiple ACB files are read in order with one CriFsLoader)
  • Maximum number of simultaneous streaming playbacks
    • number used for StreamingVoice
  • number of movies to play back simultaneously
    • same number as "Number of Decoders"

Number of Binders

"Number of Binders" is the maximum number of AWB files that can be loaded simultaneously.

Number of Installers

The number of parallel processes used for installation (e.g. CriWare.CriFsUtility.Install) is required.

About how to set each initialization parameter

Since there are so many parameters mentioned above, you may wonder which one should you start from. We recommend the following steps to make a basic setting.

Atom

  • Set [Initialize Atom] / [Voice Pool Config] to the maximum number of sounds that can be played simultaneously in the application
    • Set [Standard VoicePoolConfig] / [Memory Voices] to the number of simultaneous memory playback
    • Set [Standard VoicePoolConfig] / [Streaming Voices] to the number of simultaneous streaming playback
  • Increase [Initialize FileSystem] / [Number of Loaders] by the amount of increased [Standard VoicePoolConfig] / [StreamingVoices]
  • If streaming playback will be performed, increase [Initialize FileSystem] / [Number of Binders] by the maximum number of simultaneous loadings of AWB files expected.
  • Set [Initialize Atom] / [Max Virtual Voices] so that it is greater than the sum of all VoicePool in [Initialize Atom]

Mana

  • If the number of audio tracks in movies played simultaneously in the application exceeds 4, increase [Initialize Atom] / [Max Virtual Voices] by the exceed number
  • Set [Initialize FileSystem] / [Number of Binders] to the number of Cue Sheets to be loaded at the same time in the application
  • Set the maximum number of videos that can be played simultaneously in the application to [Initialize Mana] / [Number Of Decoders]
  • Be aware that alpha movies use 2 decoders each. Therefore, in the example below, the number of video playbacks is the same, but the number of decoders being used is different.
    • Non-alpha movie x 6 = 6 (Number Of Decoders)
    • Alpha movie x 5 + non-alpha movie x 1 = 11 (Number Of Decoders)
Note:
  • Even when each parameter is allocated with padding, there is no impact on the performance, it only slightly increases the memory footprint.
  • Depending on the Cue configuration, a single Cue may use multiple Voices.
    • This is because a voice only consumes the number of waveforms allocated in the Cue.
    • For example, in the following case, when different waveforms overlap at the time indicated by the seek bar, four voices are consumed.
      cri4u_component_initalizer_setting_voicecount.png