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

Output Port More...

Inherits CriDisposable.

Classes

struct  Config
 Config structure used to create the output port More...
 

Public Types

enum  Type : System.Int32 { Audio = 0, Vibration = 1 }
 Output port type More...
 

Public Member Functions

Int32 CalculateWorkSize (CriAtomExOutputPort.Config config)
 Calculating the work area size required for the creation of the output port object More...
 
 CriAtomExOutputPort (Config config)
 Creating the output port object More...
 
override void Dispose ()
 Discarding the output port object More...
 
void SetAsrRackId (Int32 rackId)
 Specification of ASR Rack ID More...
 
void SetVibrationChannelLevel (Int32 channel, Single level)
 Setting the channel level of the output port vibration type More...
 
void SetMonauralMix (Boolean monauralMix)
 With/Without monaural downmix for output port of vibration type More...
 
bool IsDestroyable ()
 Discard the output port object More...
 

Public Attributes

const uint MaxNameLength = 64
 Maximum length of output port name More...
 

Properties

bool isAvailable [get]
 Whether the output port object is valid More...
 

Detailed Description

Output Port

Description:
The output port is an object that makes it easier to manage and control audio output destinations.
This is useful when playing on a device's secondary output, or when using platform-specific playback functions.

Member Enumeration Documentation

enum Type : System.Int32
strong

Output port type

Description:
This value indicates the type of the output port.
See also
CriWare.CriAtomExOutputPort.Config
Enumerator
Audio 

Sound Type

Description:
Output port type for normal audio playback.
Vibration 

Vibration type

Description:
Output port type used to output audio-based vibrations.

Constructor & Destructor Documentation

CriAtomExOutputPort ( Config  config)
inline

Creating the output port object

Parameters
configConfig structure used to create the output port
Returns
Output port object
Description:
Create an output port object.
Output ports are linked to ASR Racks, and Voices for which an output port is specified will be played in the ASR Rack linked to that output port.
CriAtomExOutputPort CreateOutputPort(int rackId) {
var outputPortConfig = CriAtomExOutputPort.Config.Default();
outputPortConfig.name = "SampleOutputPort1";
var outputPort = new CriAtomExOutputPort(outputPortConfig);
// Set the AsrRack ID
outputPort.SetAsrRackId(rackId);
return outputPort;
}
Note:
The output port object set in the ACF file will be automatically created in the ACF when the ACF file is
registered using CriAtomEx.RegisterAcf, so it is not necessary to use this function to create new objects.
The output port object created like this can be obtained by CriWare.CriAtomExAcf.GetOutputPort.
This function should be used when an additional output port object is required by the application.
If successful, this function returns the output port object that was created.
If it fails, null is returned.
Note:
The output port object created by this function is assigned the following ASR Rack ID based on the type specified in CriWare.CriAtomExOutputPort.Config.type:
Before using the output port object, be sure to set the appropriate ASR Rack with CriWare.CriAtomExOutputPort.SetAsrRackId.

Be sure to discard objects created with this function using CriWare.CriAtomExOutputPort.Dispose.
See also
CriWare.CriAtomExOutputPort.Config, CriWare.CriAtomExOutputPort.Dispose, CriWare.CriAtomExAsrRack.rackId, CriWare.CriAtomExAcf.GetOutputPort, CriWare.CriAtomExPlayer.AddOutputPort, CriWare.CriAtomExPlayer.AddPreferredOutputPort

Member Function Documentation

Int32 CalculateWorkSize ( CriAtomExOutputPort.Config  config)
inline

Calculating the work area size required for the creation of the output port object

Parameters
configConfig structure used to create the output port
Returns
Work area size
Description:
Calculate the size of the work area required to create the output port object.
The returned value corresponds to the size of unmanaged memory allocated when calling the constructor of this class.

If the calculation of the work area size fails, this function returns -1.
Please check the error callback message to find out why the work area size calculation failed.
Note:
The length of the output port name specified in CriWare.CriAtomExOutputPort.Config.name
must be less than or equal to CriWare.CriAtomExOutputPort.MaxNameLength.
See also
CriWare.CriAtomExOutputPort.CriAtomExOutputPort
override void Dispose ( )
inline

Discarding the output port object

Description:
Discard the output port object
Note:
Output port objects that have been added to a player using the following functions cannot be directly destroyed:

You can destroy an output port object by first removing it from the player, using the functions below:
See also
CriWare.CriAtomExOutputPort.CriAtomExOutputPort, CriWare.CriAtomExOutputPort.isAvailable, CriWare.CriAtomExOutputPort.IsDestroyable
void SetAsrRackId ( Int32  rackId)
inline

Specification of ASR Rack ID

Parameters
rackIdASR Rack ID
Description:
Specify the ASR Rack as the output port.
A Voice for which an output port is specified will be played via the ASR Rack specified for that output port.
Note:
The appropriate ASR Rack must always be specified with this function, both for output port objects created during ACF file registration (CriWare.CriAtomExAcf.GetOutputPort)
or with CriWare.CriAtomExOutputPort.CriAtomExOutputPort. .

There may be restrictions on the ASR Rack that can be specified depending on the type of output port and other factors.
Please refer to the manual for details.
Note:
Current playback will not be affected when the ASR rack ID of the output port is changed by this function.
See also
CriWare.CriAtomExAsrRack.rackId, CriWare.CriAtomExAcf.GetOutputPort
void SetVibrationChannelLevel ( Int32  channel,
Single  level 
)
inline

Setting the channel level of the output port vibration type

Parameters
channelChannel index (0 = L, 1 = R)
levelLevel (0 ~ 2.0)
Description:
Set the output level to each channel of the output device of vibration type.
Note:
The output port of vibration type operates on 2 channels and a -3dB downmix is applied if the final output device is mono.
The value set with this function will be reflected immediately, even while audio is playing.
See also
CriWare.CriAtomExOutputPort.SetMonauralMix
void SetMonauralMix ( Boolean  monauralMix)
inline

With/Without monaural downmix for output port of vibration type

Parameters
monauralMixWith monaural mix (CRI_TRUE = Enabled, CRI_FALSE = Disabled)
Description:
The output port of vibration type operates on 2 channels, so if the input data has more than 2 channels,
or 3D pan is set, the output will be transmitted to the left and right of the vibration device.
By enabling monaural mixing, you can eliminate these effects by downmixing to monaural before outputting to the vibration device.
You can also use CriWare.CriAtomExOutputPort.SetVibrationChannelLevel to set the level sent to the vibration device after the monaural mixing.
Note:
The value set by this function is immediately reflected, even during the audio playback.
See also
CriWare.CriAtomExOutputPort.SetVibrationChannelLevel
bool IsDestroyable ( )
inline

Discard the output port object

Returns
Whether it can be discarded
Description:
Determine whether the output port object can be discarded.
If true is returned, the object can be discarded by calling CriWare.CriAtomExOutputPort.Dispose .
If false is returned, the output port object must first be removed from the player with one of the functions below:
See also
CriWare.CriAtomExOutputPort.Dispose

Member Data Documentation

const uint MaxNameLength = 64

Maximum length of output port name

Description:
Maximum string length that can be specified as the name in CriWare.CriAtomExOutputPort.Config.name .
See also
CriWare.CriAtomExOutputPort.Config

Property Documentation

bool isAvailable
get

Whether the output port object is valid

Returns
Whether the object is valid
Description:
Determine if the output port object is valid.
It basically checks if the native handle held inside the object has been disposed.
See also
CriWare.CriAtomExOutputPort.Dispose

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