CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
CriAtomExAsr Class Reference

A class that controls the bus output of the Atom sound renderer. More...

Classes

struct  BusAnalyzerInfo
 Level measurement information More...
 

Static Public Member Functions

static void AttachBusAnalyzer (string busName, int interval, int peakHoldTime)
 Adds the level measurement function More...
 
static void AttachBusAnalyzer (int interval, int peakHoldTime)
 Adds the level measurement feature to all DSP buses More...
 
static void DetachBusAnalyzer (string busName)
 Removes the level measurement function More...
 
static void DetachBusAnalyzer ()
 Removes the level measurement feature from all DSP buses More...
 
static void GetBusAnalyzerInfo (string busName, out BusAnalyzerInfo info)
 Gets the level measurement result More...
 
static void GetBusAnalyzerInfo (int busId, out BusAnalyzerInfo info)
 
static void SetBusVolume (string busName, float volume)
 Sets the volume of the DSP bus More...
 
static void SetBusVolume (int busId, float volume)
 
static void SetBusSendLevel (string busName, string sendTo, float level)
 Sets the send level of the DSP bus More...
 
static void SetBusSendLevel (int busId, int sendTo, float level)
 
static void SetBusMatrix (string busName, int inputChannels, int outputChannels, float[] matrix)
 Sets the level matrix for the DSP bus More...
 
static void SetBusMatrix (int busId, int inputChannels, int outputChannels, float[] matrix)
 
static void SetEffectBypass (string busName, string effectName, bool bypass)
 DSP bus effect Bypass setting More...
 
static void SetEffectParameter (string busName, string effectName, uint parameterIndex, float parameterValue)
 Sets the DSP bus effect operating parameter More...
 
static float GetEffectParameter (string busName, string effectName, uint parameterIndex)
 Gets the DSP bus effect operating parameter More...
 
static bool RegisterEffectInterface (IntPtr afx_interface)
 Registers the user-defined effect interface More...
 
static void UnregisterEffectInterface (IntPtr afx_interface)
 Unregisters the user-defined effects interface More...
 
static void GetBusVolume (string busName, out float volume)
 Getting the volume of the Bus More...
 
static void EnableBinauralizer (Boolean enabled)
 Enable the binauralizer More...
 
static bool IsEnabledBinauralizer ()
 Get the enabled status of the binauralizer More...
 
static int GetPcmOutput (int outputChannels, int outputSamples, float[][] buffer)
 Gets the PCM output More...
 
static int GetNumBufferedPcmOutputSamples ()
 Gets the number of output PCM samples available More...
 
static void SetPcmBufferSize (int numSamples)
 Sets the size of the buffer for the output of the PCM samples More...
 
static void PauseOutputVoice (bool sw)
 Pause/resume all playback More...
 

Detailed Description

A class that controls the bus output of the Atom sound renderer.

Description:
In this class, you can change the volume or measure the level by operating the bus output of the Atom sound renderer.

Member Function Documentation

static void AttachBusAnalyzer ( string  busName,
int  interval,
int  peakHoldTime 
)
inlinestatic

Adds the level measurement function

Parameters
busNameDSP bus name
intervalMeasurement interval (ms)
peakHoldTimeHold time of the peak hold level (ms)
Description:
Adds the level measurement function to the DSP bus and starts the level measurement.
After calling this function, you can get the RMS level (sound pressure), peak level (maximum amplitude), and peak hold level by calling the CriAtomExAsr::GetBusAnalyzerInfo function. In order to measure the level of multiple DSP buses, this function must be called for each DSP bus.
See also
CriAtomExAsr::GetBusAnalyzerInfo, CriAtomExAsr::DetachBusAnalyzer
static void AttachBusAnalyzer ( int  interval,
int  peakHoldTime 
)
inlinestatic

Adds the level measurement feature to all DSP buses

Parameters
intervalMeasurement interval (ms)
peakHoldTimeHold time of the peak hold level (ms)
Description:
Adds the level measurement function to the DSP bus and starts the level measurement.
After calling this function, you can get the RMS level (sound pressure), peak level (maximum amplitude), and peak hold level by calling the CriAtomExAsr::GetBusAnalyzerInfo function.
See also
CriAtomExAsr::GetBusAnalyzerInfo, CriAtomExAsr::DetachBusAnalyzer
static void DetachBusAnalyzer ( string  busName)
inlinestatic

Removes the level measurement function

Parameters
busNameDSP bus name
Description:
Removes the level measurement function from the specified DSP bus.
See also
CriAtomExAsr::AttachBusAnalyzer
static void DetachBusAnalyzer ( )
inlinestatic

Removes the level measurement feature from all DSP buses

Description:
Removes the level measurement feature from all DSP buses.
See also
CriAtomExAsr::AttachBusAnalyzer
static void GetBusAnalyzerInfo ( string  busName,
out BusAnalyzerInfo  info 
)
inlinestatic

Gets the level measurement result

Parameters
busNameDSP bus name
infoLevel measurement result
Description:
Gets the result of the level measurement function from the DSP bus.
See also
CriAtomExAsr::AttachBusAnalyzer
static void GetBusAnalyzerInfo ( int  busId,
out BusAnalyzerInfo  info 
)
inlinestatic
Deprecated:
This is a deprecated API that will be removed. Please consider using CriAtomExAsr.GetBusAnalyzerInfo(string busName, out BusAnalyzerInfo info) instead.
static void SetBusVolume ( string  busName,
float  volume 
)
inlinestatic

Sets the volume of the DSP bus

Parameters
busNameDSP bus name
volumeVolume value
Description:
Sets the volume of the DSP bus.
This is valid for the send destinations whose send type is post-volume or post-pan.

For the volume value, specify a real value in the range of 0.0f to 1.0f.
The volume value is a scale factor for the amplitude of the sound data (the unit is not decibel).
For example, if you specify 1.0f, the original sound is played at its unmodified volume.
If you specify 0.5f, the sound is played at the volume by halving the amplitude (-6dB) of the original waveform.
If you specify 0.0f, the sound is muted (silent).
The default volume is the value set on CRI Atom Craft.
static void SetBusVolume ( int  busId,
float  volume 
)
inlinestatic
Deprecated:
This is a deprecated API that will be removed. Please consider using CriAtomExAsr.SetBusVolume(string busName, float volume) instead.
static void SetBusSendLevel ( string  busName,
string  sendTo,
float  level 
)
inlinestatic

Sets the send level of the DSP bus

Parameters
busNameDSP bus name
sendToSend destination DSP bus name
levelLevel value
Description:
Sets the level for sending sound data to the send destination DSP bus.

Specify a real value in the range of 0.0f to 1.0f for the level value.
The level value is a scale factor for the amplitude of sound data (in decibels).
For example, if you set it to 1.0f, the sound is played at its original level.
If you specify 0.5f, the sound is played at the volume by halving the amplitude (-6dB) of the original waveform.
If you specify 0.0f, the sound is muted (silent).
The default level is the value set on CRI Atom Craft.
static void SetBusSendLevel ( int  busId,
int  sendTo,
float  level 
)
inlinestatic
Deprecated:
This is a deprecated API that will be removed. Please consider using CriAtomExAsr.SetBusSendLevel(string busName, string sendTo, float level) instead.
static void SetBusMatrix ( string  busName,
int  inputChannels,
int  outputChannels,
float[]  matrix 
)
inlinestatic

Sets the level matrix for the DSP bus

Parameters
busNameDSP bus name
inputChannelsThe number of input channels
outputChannelsThe number of output channels
matrixAn array of level values that represents the level matrix in one dimension
Description:
Sets the level matrix of the DSP bus.
Valid for the send destination whose send type is post-pan.

The level matrix is a mechanism for specifying which speaker outputs the sound of each channel of the sound data at which volume.
matrix is an array of [input_channels * output_channels].
You set the level sent from the input channel ch_in to the output channel ch_out inmatrix[ch_in * output_channels + ch_out].
The default of the level matrix is the identity matrix.

Specify a real value in the range of 0.0f to 1.0f for the level value.
The level value is a scale factor for the amplitude of sound data (in decibels).
For example, if you set it to 1.0f, the sound is played at its original level.
If you specify 0.5f, the sound is played at the volume by halving the amplitude (-6dB) of the original waveform.
If you specify 0.0f, the sound is muted (silent).
static void SetBusMatrix ( int  busId,
int  inputChannels,
int  outputChannels,
float[]  matrix 
)
inlinestatic
Deprecated:
This is a deprecated API that will be removed. Please consider using CriAtomExAsr.SetBusMatrix(string busName, int inputChannels, int outputChannels, float[] matrix) instead.
static void SetEffectBypass ( string  busName,
string  effectName,
bool  bypass 
)
inlinestatic

DSP bus effect Bypass setting

Parameters
busNameBus name
effectNameEffect name
bypassBypass setting (True: bypass, False: not bypass)
Description:
Sets the Bypass of the effect.
Bypassed effects will be passed through during sound processing.
Before bypassing an effect, a DSP bus setting must be attached before calling this function.
Which effect is on which bus depends on the DSP bus settings you attached.
The function fails if there is no effect with the specified ID on the specified bus.
Note:
If you set Bypass while the sound is played, a noise may occur.
static void SetEffectParameter ( string  busName,
string  effectName,
uint  parameterIndex,
float  parameterValue 
)
inlinestatic

Sets the DSP bus effect operating parameter

Parameters
busNameBus name
effectNameEffect name
parameterIndexEffect run-time parameter index
parameterValueEffect run-time parameter settings
Description:
Sets the operating parameters of the DSP bus effect.

Which effect is on which bus depends on the DSP bus settings you attached.
The function fails if there is no effect with the specified ID on the specified bus.
static float GetEffectParameter ( string  busName,
string  effectName,
uint  parameterIndex 
)
inlinestatic

Gets the DSP bus effect operating parameter

Parameters
busNameBus name
effectNameEffect name
parameterIndexEffect run-time parameter index
Description:
Gets the operating parameter value of the DSP bus effect.

Which effect is on which bus depends on the DSP bus settings you attached.
The function fails if there is no effect with the specified ID on the specified bus.
static bool RegisterEffectInterface ( IntPtr  afx_interface)
inlinestatic

Registers the user-defined effect interface

Parameters
afx_interfaceInterface with version information for user-defined effects
Returns
Was the registration successful? (True: registration successful, False: registration failed)
Description:
Registers the user-defined effects interface with ASR.
The effects for which the user-defined effects interface has been registered can be used when attaching the DSP bus settings.
If the following conditions are met, the registration of the user-defined effects interface fails and an error callback is returned:
  • A user defined effect interface with the same effect name is already registered
  • It is different from the user-defined effects interface used by Atom
  • The maximum number of user-defined effect interface registrations is reached
Note:
This API can be used only when registering an user-defined effect in CRI ADX Audio Effect Plugin SDK.
Be sure to call this function after calling CriAtomPlugin::InitializeLibrary and before calling CriAtomEx::AttachDspBusSetting .
Once registered, the interface pointer continues to be referenced until CriAtomEx::DetachDspBusSetting is called.
If you want to unregister the interface while using the library, use CriAtomExAsr::UnregisterEffectInterface.
See also
CriAtomExAsr::UnregisterEffectInterface, CriAtomEx::AttachDspBusSetting, CriAtomEx::DetachDspBusSetting
static void UnregisterEffectInterface ( IntPtr  afx_interface)
inlinestatic

Unregisters the user-defined effects interface

Parameters
afx_interfaceInterface with version information for user-defined effects
Description:
Unregister the user-defined effect interface.
Unregistered effects will no longer be available when attaching the DSP bus settings.
You cannot unregister a user-defined effect interface that has not been registered (error callback is returned).
Note:
This API can be used only when unregistering an effect in CRI ADX Audio Effect Plugin SDK.
See also
CriAtomExAsr::RegisterEffectInterface
static void GetBusVolume ( string  busName,
out float  volume 
)
inlinestatic

Getting the volume of the Bus

Parameters
busNameBus name
volumeVolume value
Description:
Gets the volume of the bus.

The raw volume value will be returned.
The default value of the volume is the value set in CRI Atom Craft.
static void EnableBinauralizer ( Boolean  enabled)
inlinestatic

Enable the binauralizer

Parameters
enabledEnabled flag
Description:
Specify the enabled binauralizer.
Note:
The Binauralizer can only be used with ASR Racks with CriAtomEx.SoundRendererType set to Spatial.
A spatializer of your choice can be used if registered in the binauralizer's spatializer interface.
If no spatializer is registered, Atom's built-in spatializer will be used.

static bool IsEnabledBinauralizer ( )
inlinestatic

Get the enabled status of the binauralizer

Returns
Enabled status
Description:
Gets the enabled/disabled status of the binauralizer.

static int GetPcmOutput ( int  outputChannels,
int  outputSamples,
float  buffer[][] 
)
inlinestatic

Gets the PCM output

Parameters
outputChannelsNumber of channels to acquire
outputSamplesNumber of PCM samples to acquire
bufferBuffer for writing PCM samples
Returns
Number of PCM samples acquired
Description:
Gets the PCM samples output by Atom.
Note:
This function is for execution in the Editor only.
It works only if the user PCM output mode is enabled and initialized.
static int GetNumBufferedPcmOutputSamples ( )
inlinestatic

Gets the number of output PCM samples available

Returns
Number of PCM output samples that can be acquired
Description:
Gets the number of PCM samples that will be output from the available Atom.
Note:
This function is for execution in the Editor only.
It works only if the user PCM output mode is enabled and initialized.
static void SetPcmBufferSize ( int  numSamples)
inlinestatic

Sets the size of the buffer for the output of the PCM samples

Parameters
numSamplesSize of the buffer containing the PCM samples output
Description:
Sets the size of the buffer used by Atom for the PCM sample data.
A small size will reduce the latency of the output obtained via CriWare.CriAtomExAsr::GetPcmOutput . However, it may cause audio interruptions and other issues if the calling rate is insufficient.
Note:
This function is for execution in the Editor only.
It works only if the user PCM output mode is enabled and initialized.
static void PauseOutputVoice ( bool  sw)
inlinestatic

Pause/resume all playback

Parameters
swTrue: Pause the audio, False: Resume the audio
Description:
Pause or resume all playback via the ADX library.
Specify whether to pause or resume with the flag.

This function is mainly used to:
  • Pause the audio throughout the game

The documentation for this class was generated from the following file: