|
Drag[en]gine Script Module DragonScript 1.35
|
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.
References getUpdateInterval().
Referenced by Dragengine.Audio.LipSync.LipSyncSpectrogram.calculateVisemes(), and normalizeVisemes().
| void Dragengine.Audio.LipSync.LipSync.forEachVisemeSubsetResult | ( | Block | ablock | ) |
Visit viseme subset results with block.
Block receives one argument of type VisemeResult.
References setUpdateInterval().
Referenced by normalizeVisemes().
| float Dragengine.Audio.LipSync.LipSync.getJawOpeness | ( | ) |
Get jaw openess in range 0 to 1.
References pJawOpenessFilter, and pNoiseFloor.
Referenced by setVisemeSubsetFromJawOpeness().
| OneEuroFilter Dragengine.Audio.LipSync.LipSync.getJawOpenessFilter | ( | ) |
Jaw openess filter.
References pNoiseFloor.
Referenced by Dragengine.Audio.LipSync.LipSyncJawFlaping.new(), and normalizeVisemes().
| float Dragengine.Audio.LipSync.LipSync.getJawOpenessSmooth | ( | ) |
Smoothed jaw openess in range 0 to 1.
Use this value for animating the character jaw bone.
Referenced by normalizeVisemes().
| float Dragengine.Audio.LipSync.LipSync.getUpdateInterval | ( | ) |
Update interval in seconds.
References pAudioAnalyzer, pJawOpeness, pJawOpenessFilter, pNoiseFloor, and pVisemeResults.
Referenced by forEachVisemeResult().
| VisemeResult Dragengine.Audio.LipSync.LipSync.getVisemeResult | ( | Viseme | viseme | ) |
| LipSync Dragengine.Audio.LipSync.LipSync.new | ( | ) |
Create lip sync.
Reimplemented in Dragengine.Audio.LipSync.LipSyncJawFlaping, and Dragengine.Audio.LipSync.LipSyncSpectrogram.
|
protected |
Normalize viseme weights.
References forEachVisemeResult(), forEachVisemeSubsetResult(), getJawOpenessFilter(), getJawOpenessSmooth(), getVisemeResult(), normalizeVisemes(), pAudioAnalyzer, pJawOpeness, pJawOpenessFilter, pVisemeResults, setJawOpenessFromVisemeSubset(), setJawOpenessSmooth(), setVisemeFullFromSubset(), setVisemeSubsetFromFull(), and setVisemeSubsetFromJawOpeness().
Referenced by Dragengine.Audio.LipSync.LipSyncSpectrogram.calculateVisemes(), and normalizeVisemes().
| void Dragengine.Audio.LipSync.LipSync.setJawOpeness | ( | float | value | ) |
Set jaw openess in range 0 to 1.
References pVisemeResults.
Referenced by setVisemeSubsetFromFull(), and Dragengine.Audio.LipSync.LipSyncJawFlaping.updateLipSync().
|
protected |
Set jaw openess from viseme subset results.
Referenced by Dragengine.Audio.LipSync.LipSyncSpectrogram.calculateVisemes(), and normalizeVisemes().
| void Dragengine.Audio.LipSync.LipSync.setJawOpenessSmooth | ( | float | value | ) |
Set smoothed jaw openess in range 0 to 1.
References pAudioAnalyzer.
Referenced by normalizeVisemes().
| void Dragengine.Audio.LipSync.LipSync.setNoiseFloor | ( | float | noiseFloor | ) |
Set noise floor in RMS (root mean square) amplitude.
Referenced by getVisemeResult().
| void Dragengine.Audio.LipSync.LipSync.setUpdateInterval | ( | float | updateInterval | ) |
Set update interval in seconds.
Referenced by forEachVisemeSubsetResult().
|
protected |
Set full viseme results from viseme subset results.
Referenced by normalizeVisemes(), and Dragengine.Audio.LipSync.LipSyncJawFlaping.updateLipSync().
|
protected |
Set viseme subset results from full viseme results.
References pJawOpeness, and setJawOpeness().
Referenced by Dragengine.Audio.LipSync.LipSyncSpectrogram.calculateVisemes(), and normalizeVisemes().
|
protected |
Set viseme subset from jaw openess.
References getJawOpeness(), and pJawOpeness.
Referenced by normalizeVisemes(), and Dragengine.Audio.LipSync.LipSyncJawFlaping.updateLipSync().
| AudioAnalyzer Dragengine.Audio.LipSync.LipSync.pAudioAnalyzer |
Referenced by getUpdateInterval(), normalizeVisemes(), and setJawOpenessSmooth().
| float Dragengine.Audio.LipSync.LipSync.pJawOpeness |
Referenced by getUpdateInterval(), normalizeVisemes(), setVisemeSubsetFromFull(), and setVisemeSubsetFromJawOpeness().
| OneEuroFilter Dragengine.Audio.LipSync.LipSync.pJawOpenessFilter |
Referenced by getJawOpeness(), getUpdateInterval(), and normalizeVisemes().
| float Dragengine.Audio.LipSync.LipSync.pNoiseFloor |
Referenced by getJawOpeness(), getJawOpenessFilter(), getUpdateInterval(), and getVisemeResult().
| Dictionary Dragengine.Audio.LipSync.LipSync.pVisemeResults |
Referenced by getUpdateInterval(), normalizeVisemes(), and setJawOpeness().