Analysis Text Preprocessing

The analysis text can be modified by an external Python script before being sent into FaceFX analysis.  To achieve this, create a function that accepts and returns a Unicode text string and register it as the "analysistextpreprocessor" callback.

  • Inserting Text Tags - The ability to add text tags via Python script has lots of potential to improve the quality of untweaked analysis results.  There is a wealth of information in the text that can be used to determine the emotional state of the character automatically and assist in creating an appropriate animation.  Curve or Event  text tags can be used to send curves or events into the analysis actor, which can be passed onto the final animation or filtered in the analysis actor.
  • Replacing Proper Nouns - Using the correct spelling of the proper nouns in your game dialog may not yield optimal lip-sync results.  A game set in Worcester, Massachusetts might consider replacing "Worcester" with "Woostah" for example.
  • Transliteration - If you are trying to analyze audio in a language other than English, French, German, Italian, Spanish, Korean, or Japanese, your options are to analyze without text using the closest available language, or transliterating the text before sending it into analysis.  The analysis text preprocessor could be used to transliterate the text automatically.


The following example will register a callback that adds an event for the "Negative" animation in the "_TextEvents" animation group before any occurrence of the words "no", "not", or "don't".  The Negative animation is used by the Default analysis actor to do a small head shake.

import re
def myAnalysisTextPreProcessor(analysisText):
return re.sub("\s(?P<word>no|not|don't)\W", " {\"_TextEvents|Negative\"} \g<word> ", analysisText);
FxStudio.registerCallback("analysistextpreprocessor", myAnalysisTextPreProcessor);

Version Number: