|
Drag[en]gine Script Module DragonScript 1.32.1
|
Base class for lip synchronization. More...
Classes | |
| enum | Viseme |
| Visemes. More... | |
| class | VisemeResult |
| Viseme result. More... | |
Public Member Functions | |
| void | forEachVisemeResult (Block ablock) |
| Visit viseme results with block. | |
| void | forEachVisemeSubsetResult (Block ablock) |
| Visit viseme subset results with block. | |
| float | getJawOpeness () |
| Get jaw openess in range 0 to 1. | |
| OneEuroFilter | getJawOpenessFilter () |
| Jaw openess filter. | |
| float | getJawOpenessSmooth () |
| Smoothed jaw openess in range 0 to 1. | |
| float | getUpdateInterval () |
| Update interval in seconds. | |
| VisemeResult | getVisemeResult (Viseme viseme) |
| Viseme result. | |
| LipSync | new () |
| Create lip sync. | |
| void | setJawOpeness (float value) |
| Set jaw openess in range 0 to 1. | |
| void | setJawOpenessSmooth (float value) |
| Set smoothed jaw openess in range 0 to 1. | |
| void | setNoiseFloor (float noiseFloor) |
| Set noise floor in RMS (root mean square) amplitude. | |
| void | setUpdateInterval (float updateInterval) |
| Set update interval in seconds. | |
Public Attributes | |
| AudioAnalyzer | pAudioAnalyzer |
| float | pJawOpeness |
| OneEuroFilter | pJawOpenessFilter |
| float | pNoiseFloor |
| Dictionary | pVisemeResults |
Protected Member Functions | |
| void | normalizeVisemes () |
| Normalize viseme weights. | |
| void | setJawOpenessFromVisemeSubset () |
| Set jaw openess from viseme subset results. | |
| void | setVisemeFullFromSubset () |
| Set full viseme results from viseme subset results. | |
| void | setVisemeSubsetFromFull () |
| Set viseme subset results from full viseme results. | |
| void | setVisemeSubsetFromJawOpeness () |
| Set viseme subset from jaw openess. | |
Base class for lip synchronization.
Lip synchronization analyzes user voice audio and provides either a mouth openess value for jaw flapping or viseme weights for more detailed mouth shapes. See subclass documentation to know which result data they provide. All subclasses are required to fill in all possible values so the user can choose which category of lip sync he wants to use.
This is the most basic form of lip synchronization best used for characters lacking complex mouth pose abilities. Typical example of this are beast type characters with elongated snouts. In this case designing convincing mouth shapes can be difficult unless the character is of a cartoon type where mouth shapes are often very squishy. Apply the #getJawOpenessSmooth() to the character jaw bone.
This subset represents basic mouth shapes that can be easily distinguished. These viseme are provided:
The most detailed mode providing full set of viseme weights. This is best used for characters with complex mouth pose abilities.
Lip synchronization uses an instance of AudioAnalyzer to analyze the audio. The subclasses configure the analyzer for their specific needs. The user is responsible to set the audio source if he does not want to use the default microphone.
| void Dragengine.Audio.LipSync.LipSync.forEachVisemeResult | ( | Block | ablock | ) |
Visit viseme results with block.
Block receives one argument of type VisemeResult.
| void Dragengine.Audio.LipSync.LipSync.forEachVisemeSubsetResult | ( | Block | ablock | ) |
Visit viseme subset results with block.
Block receives one argument of type VisemeResult.
| float Dragengine.Audio.LipSync.LipSync.getJawOpeness | ( | ) |
Get jaw openess in range 0 to 1.
| OneEuroFilter Dragengine.Audio.LipSync.LipSync.getJawOpenessFilter | ( | ) |
Jaw openess filter.
| float Dragengine.Audio.LipSync.LipSync.getJawOpenessSmooth | ( | ) |
Smoothed jaw openess in range 0 to 1.
Use this value for animating the character jaw bone.
| float Dragengine.Audio.LipSync.LipSync.getUpdateInterval | ( | ) |
Update interval in seconds.
| VisemeResult Dragengine.Audio.LipSync.LipSync.getVisemeResult | ( | Viseme | viseme | ) |
Viseme result.
| LipSync Dragengine.Audio.LipSync.LipSync.new | ( | ) |
Create lip sync.
Reimplemented in Dragengine.Audio.LipSync.LipSyncJawFlaping, and Dragengine.Audio.LipSync.LipSyncSpectrogram.
|
protected |
Normalize viseme weights.
| void Dragengine.Audio.LipSync.LipSync.setJawOpeness | ( | float | value | ) |
Set jaw openess in range 0 to 1.
|
protected |
Set jaw openess from viseme subset results.
| void Dragengine.Audio.LipSync.LipSync.setJawOpenessSmooth | ( | float | value | ) |
Set smoothed jaw openess in range 0 to 1.
| void Dragengine.Audio.LipSync.LipSync.setNoiseFloor | ( | float | noiseFloor | ) |
Set noise floor in RMS (root mean square) amplitude.
| void Dragengine.Audio.LipSync.LipSync.setUpdateInterval | ( | float | updateInterval | ) |
Set update interval in seconds.
|
protected |
Set full viseme results from viseme subset results.
|
protected |
Set viseme subset results from full viseme results.
|
protected |
Set viseme subset from jaw openess.
| AudioAnalyzer Dragengine.Audio.LipSync.LipSync.pAudioAnalyzer |
| float Dragengine.Audio.LipSync.LipSync.pJawOpeness |
| OneEuroFilter Dragengine.Audio.LipSync.LipSync.pJawOpenessFilter |
| float Dragengine.Audio.LipSync.LipSync.pNoiseFloor |
| Dictionary Dragengine.Audio.LipSync.LipSync.pVisemeResults |