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

Atom linked mouth shape analysis module More...

Inheritance diagram for CriLipsAtomAnalyzer:
ICriLipsAnalyzeModule

Classes

struct  Config
 Configuration for creating Atom sound analysis module More...
 

Public Types

enum  DataReadoutMode
 External data read operation type More...
 

Public Member Functions

 CriLipsAtomAnalyzer (int maxSamplingRate=48000)
 Creating AtomAnalyzer handle (specifying the maximum sampling rate) More...
 
 CriLipsAtomAnalyzer (Config config)
 Creating AtomAnalyzer handle (specifying configurations) More...
 
override void Dispose ()
 Discards the LipsAtomAnalyzer handle More...
 
bool AttachToAtomExPlayer (CriAtomExPlayer player)
 Attaches to the AtomExPlayer More...
 
bool DetachFromAtomExPlayer ()
 Detaches from the AtomExPlayer More...
 
bool DetachFromAtomExPlayer (bool forceStop)
 
bool SetSamplingRate (int samplingRate)
 Sets the sampling frequency More...
 
int GetSamplingRate ()
 Get the sampling frequency More...
 
bool SetSilenceThreshold (float volume)
 Sets the silence determination volume threshold More...
 
void GetInfo (out CriLipsMouth.Info info)
 Gets the mouth shape information More...
 
void GetMorphTargetBlendAmountAsJapanese (out CriLipsMouth.MorphTargetBlendAmountAsJapanese morph)
 Gets the Japanese 5 vowel morph target blend amount More...
 
void GetOpenInfo (out CriLipsMouth.OpenInfo openInfo)
 Obtaining the 1-dimensional mouth shape information More...
 
float GetVolume ()
 Gets volume More...
 
float GetSilenceThreshold ()
 Gets the silence determination volume threshold More...
 
void GetInfoAtSilence (out CriLipsMouth.Info info)
 Gets the mouth shape information in the closed state More...
 
bool IsAtSilence ()
 Check if there is no voice and the mouth is closed More...
 
bool IsAtSilenceForMouthOpen ()
 Check if there is no voice and the mouth is closed (1-dimensional) More...
 
bool AttachToDspBus (string busName)
 Attaches to the DSP bus More...
 
bool DetachFromDspBus ()
 Detaches from the DSP bus More...
 
bool IsMorphTargetBlendAmountInterpolative ()
 Whether the blend amount is interpolative More...
 

Detailed Description

Atom linked mouth shape analysis module

Description:
The module to analyze sound in cooperation with the AtomExPlayer and DSP bus.
You can analyze the sound played back using the Atom library and get the mouth shape information.

Member Enumeration Documentation

enum DataReadoutMode
strong

External data read operation type

Description:
Data type used to specify the behavior of reading lip-sync data included in an Atom Cue Sheet binary.
It is used to decide whether to perform real-time analysis according to the presence of pre-analyzed lip-sync data corresponding to the waveform data being played.
  • ProcessIfNoData: Reads lip-sync data if exists; performs real-time analysis if data does not exist.
  • SilentIfNoData: Reads lip-sync data if exists; treats as silence otherwise. No real-time analysis will be performed.
  • ProcessAlways: Real-time analysis will always be performed regardless of the presence of lip-sync data.
See also
CriLipsAtomAnalyzer::Config, CriLipsAtomAnalyzer::CriLipsAtomAnalyzer

Constructor & Destructor Documentation

CriLipsAtomAnalyzer ( int  maxSamplingRate = 48000)
inline

Creating AtomAnalyzer handle (specifying the maximum sampling rate)

Parameters
maxSamplingRateMaximum sampling rate
Returns
AtomAnalyzer handle
Description:
Creates LipAtomAnalyzer which is a mouth shape analysis module that works with Atom.
It is created in a state where the waveform data of the sampling rate specified by the argument can be analyzed.
When passing the waveform data with a sampling rate lower than that specified when creating the handle, call CriLipsAtomAnalyzer::SetSamplingRate .
Note:
Calling CriLipsAtomAnalyzer::GetInfo without attaching to the AtomExPlayer etc. obtains the shape information with "mouth closed.
Note:
Be sure to initialize the plug-in before calling this function.
See also
CriLipsAtomAnalyzer::Dispose, CriLipsAtomAnalyzer::GetInfo
CriLipsAtomAnalyzer ( Config  config)
inline

Creating AtomAnalyzer handle (specifying configurations)

Parameters
configConfig structure
Returns
AtomAnalyzer handle
Description:
Creates LipAtomAnalyzer which is a mouth shape analysis module that works with Atom.
When passing the waveform data with a sampling rate lower than that specified in the configuration when creating the handle, please call CriLipsAtomAnalyzer::SetSamplingRate .
Note:
Calling CriLipsAtomAnalyzer::GetInfo without attaching to the AtomExPlayer etc. obtains the shape information with "mouth closed.
Note:
Be sure to initialize the plug-in before calling this function.

The lip-sync analysis uses the ADX2 filter callback inside the plug-in.
Therefore, if there are any filter callbacks registered with CriAtomSource, they are unregistered.
In addition, if a filter callback is registered with CriAtomSource while performing the lip-sync analysis,
the lip-sync analysis stops.
See also
CriLipsAtomAnalyzer::Dispose, CriLipsAtomAnalyzer::GetInfo

Member Function Documentation

override void Dispose ( )
inline

Discards the LipsAtomAnalyzer handle

Description:
Discards the LipsAtomAnalyzer handle.
When this function is called, all the resources allocated in the DLL when creating the LipsAtomAnalyzer handle are released.
See also
CriLipsAtomAnalyzer::CriLipsAtomAnalyzer
bool AttachToAtomExPlayer ( CriAtomExPlayer  player)
inline

Attaches to the AtomExPlayer

Parameters
playerCriAtomExPlayer handle
Returns
true if successfully attached, false otherwise
Description:
Attach the analyzer to the AtomExPlayer to be analyzed.
After calling this function, the audio played by the AtomExPlayer will be analyzed and mouth shape information can be obtained.
Calling this function clears the internal state.
Note:
If it is already attached to the AtomExPlayer or a DSP bus when this function is called, the detachment will be performed internally.
See also
CriLipsAtomAnalyzer::DetachFromAtomExPlayer
bool DetachFromAtomExPlayer ( )
inline

Detaches from the AtomExPlayer

Returns
True if the detachment was successful, false otherwise
Description:
Detaches (removes) the analyzer from an AtomExPlayer.
Calling this function clears the internal state.
See also
CriLipsAtomAnalyzer::AttachToAtomExPlayer
bool DetachFromAtomExPlayer ( bool  forceStop)
inline
Deprecated:
This is a deprecated function scheduled for deletion. Please consider using CriLipsAtomAnalyzer.DetachFromAtomExPlayer - which takes no parameters - instead.
bool SetSamplingRate ( int  samplingRate)
inline

Sets the sampling frequency

Parameters
samplingRateSampling frequency
Returns
True if the setting succeeded, false if it failed
Description:
Sets the sampling frequency of the sound data to be analyzed.
Set the sampling frequency of the waveform data before playing the sound on the AtomExPlayer.
Calling this function clears the internal state.
The sampling frequency that can be analyzed is 16000Hz or more and less than the maximum sampling rate specified at initialization.
See also
CriLipsAtomAnalyzer::AttachToAtomExPlayer, CriLipsAtomAnalyzer.GetSamplingRate
int GetSamplingRate ( )
inline

Get the sampling frequency

Returns
Sampling frequency
Description:
Gets the sampling frequency of the audio data to be analyzed
(which was set by CriLipsAtomAnalyzer.SetSamplingRate)
Note:
If the retrieval fails, false is returned.
See also
CriLipsAtomAnalyzer.SetSamplingRate
bool SetSilenceThreshold ( float  volume)
inline

Sets the silence determination volume threshold

Parameters
volumeMaximum volume (dB)
Returns
True if the setting succeeded, false if it failed
Description:
Set the maximum volume (dB) equal to or smaller than 0, for which the sample to be analyzed that is output from the AtomExPlayer is considered as silent.
The default when creating a handle is -40dB.
void GetInfo ( out CriLipsMouth.Info  info)
inline

Gets the mouth shape information

Parameters
infoMouth shape information
Description:
Gets the mouth shape information obtained by analyzing the sound data played back by the attached AtomExPlayer.
See also
CriLipsAtomAnalyzer::AttachToAtomExPlayer

Implements ICriLipsAnalyzeModule.

void GetMorphTargetBlendAmountAsJapanese ( out CriLipsMouth.MorphTargetBlendAmountAsJapanese  morph)
inline

Gets the Japanese 5 vowel morph target blend amount

Parameters
morphJapanese 5 vowel morph target blend amount
Description:
Gets the Japanese 5 vowel morph target blend amount obtained by analyzing the sound data played back by the attached AtomExPlayer.
See also
CriLipsAtomAnalyzer::AttachToAtomExPlayer

Implements ICriLipsAnalyzeModule.

void GetOpenInfo ( out CriLipsMouth.OpenInfo  openInfo)
inline

Obtaining the 1-dimensional mouth shape information

Parameters
openInfoMouth shape information
Description:
Analyzes the audio data played by the attached AtomExPlayer
in order to obtain mouth shape information. This is specially for a model which has a 1-dimensional control for opening or closing the mouth.
See also
CriLipsAtomAnalyzer::AttachToAtomExPlayer

Implements ICriLipsAnalyzeModule.

float GetVolume ( )
inline

Gets volume

Returns
Volume of the analyzed sample (dB)
Description:
Gets the volume (dB) of the analyzed sample.
Note:
Returns a positive value if an error occurred.
See also
CriLipsAtomAnalyzer::AttachToAtomExPlayer

Implements ICriLipsAnalyzeModule.

float GetSilenceThreshold ( )
inline

Gets the silence determination volume threshold

Returns
Maximum volume (dB)
Description:
Acquires the maximum volume (dB) that determines the voice data analyzed by the function as silence.
Note:
Returns a value greater than 0 if an error occurred.

Implements ICriLipsAnalyzeModule.

void GetInfoAtSilence ( out CriLipsMouth.Info  info)
inline

Gets the mouth shape information in the closed state

Parameters
infoMouth shape information
Description:
Gets lips shape information after creating the handle or starting silent playback.

Implements ICriLipsAnalyzeModule.

bool IsAtSilence ( )
inline

Check if there is no voice and the mouth is closed

Returns
true when the mouth is closed; false otherwise
Description:
Whether the current state is "not being pronounced" (i.e. the mouth is closed).
See also
CriLipsAtomAnalyzer.IsAtSilenceForMouthOpen

Implements ICriLipsAnalyzeModule.

bool IsAtSilenceForMouthOpen ( )
inline

Check if there is no voice and the mouth is closed (1-dimensional)

Returns
true when the mouth is closed; false otherwise
Description:
Return whether the current state is silent (mouth closed).
Depending on the smoothing filtering parameter of the 1-dimensional lip-sync analysis process,
even if CriLipsAtomAnalyzer.IsAtSilence returns true,
this function may still determine that the mouth is opened and return false.
See also
CriLipsAtomAnalyzer.IsAtSilence

Implements ICriLipsAnalyzeModule.

bool AttachToDspBus ( string  busName)
inline

Attaches to the DSP bus

Parameters
busNameDSP bus name
Returns
true if successfully attached, false otherwise
Description:
Attaches the DSP bus analyzer to be analyzed.
After calling this function, the sound sent to the DSP bus is analyzed and the mouth shape information can be acquired.
Calling this function clears the internal state.
Note:
If it is already attached to the AtomExPlayer or the DSP bus at the time of calling this function, it is detached internally.
If the attached AtomExPlayer is being played, this function fails because the detachment cannot be done .
See also
CriLipsAtomAnalyzer::DetachFromDspBus
bool DetachFromDspBus ( )
inline

Detaches from the DSP bus

Returns
True if the detachment was successful, false otherwise
Description:
Detaches (removes) the analyzer from the attached DSP bus.
Calling this function clears the internal state.
See also
CriLipsAtomAnalyzer::AttachToDspBus
bool IsMorphTargetBlendAmountInterpolative ( )
inline

Whether the blend amount is interpolative

Returns
True when the amount of blend is interpolated, false otherwise
Description:
Whether the acquired blend amount is generated by interpolating between morph targets.

Implements ICriLipsAnalyzeModule.


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