LipSync Integration

This page describes how to set up the Dialogue System with Rogo Digital's LipSync Pro and LipSync Lite. (LipSync Pro or LipSync Lite is required. LipSync is no longer available to license on the Asset Store, but the Dialogue System maintains integration for existing LipSync users.)

LipSync copyright © Rogo Digital.

LipSync Setup

Follow these steps to set up the Dialogue System with LipSync.

  • Import the package Third Party Support ► LipSync Support. This will unpack files into the folder Assets ► Pixel Crushers ► Dialogue System ► Third Party Support ► LipSync Support.
  • If you're using LipSync Lite (without Eye Controller), delete the file Assets ► Pixel Crushers ► Dialogue System ► Third Party Support ► LipSync Support ► Scripts ► SequencerCommandEyeControl.cs.
  • Configure your character(s) with LipSync as described in the LipSync Quick Start guide.
  • Use the LipSync() sequencer command in sequences, such as in the Sequence field of your dialogue entries. You can also take advantage of the entrytag keyword (see Entrytags).
  • Use the SetEmotion() sequencer command to set the LipSync character's current emotion.
  • Use the EyeControl() sequencer command to set the EyeController to look at targets.

Exporting Helper Text Files

When processing audio, LipSync Pro can use text files to improve the quality of the resulting animation. These text files should be in the same folders as their corresponding audio files. The Dialogue System can export text files from your dialogue database's conversations. If you want to export text files, use these steps:

  1. Name audio files in your project according to each dialogue entry's entrytag.
  2. Open a scene that contains a Dialogue Manager. The exporter will use the database assigned to this Dialogue Manager.
  3. Select menu item Tools → Pixel Crushers → Dialogue System → Third Party → LipSync Pro Support → Export Text for LipSync....
  4. Click OK to export. When the export is done, the Console window will contain a report of all text files generated.

Example Scene

The Example folder contains an example scene that uses LipSync. In this scene, Private Hart is disguised as Abraham Lincoln. His lines use the LipSync() sequencer command, such as:

LipSync(Hart1)

The LipSync Data files are in a Resources subfolder. They reference audio clips in an Audio subfolder.

Sequencer Commands

You can use the following sequencer commands in your dialogue entries' Sequence fields to interface with LipSync.

LipSync()

Syntax: LipSync(lipSyncData[, subject[, nowait]])

Description: Plays a LipSync data file.

Parameters:

  • lipSyncData: The name of a LipSync Data file in a Resources folder.
  • subject: (Optional) The GameObject through which to play the LipSync Data. Must have a LipSync component. Default: speaker.
  • nowait: If present and nowait, the sequencer command doesn't wait for LipSync to finish playing.

Example:

  • LipSync(Greetings/Hello) (Plays the LipSync data Resources/Greetings/Hello through the speaker's LipSync component)

Note: You can configure the Sequence field to automatically set up LipSync() commands when you drag an audio file into it:

To use drag-n-drop, the LipSync data files and audio files must use the same names. The LipSync data files must be in Resources, but the audio files can be anywhere in your project. Drag the audio file into the Sequence field.

SetEmotion()

Syntax: SetEmotion(emotion[, blendTime[, subject]])

Description: Sets a LipSync character's emotion.

Parameters:

  • emotion: The name of an emotion defined on the LipSync component. In general, you should omit the word "Emotion" shown in the LipSync inspector. For example, for "Happy Emotion", just specify "Happy".
  • blendTime: Duration over which to transition to the emotion. Default: 0.3 seconds.
  • subject: (Optional) The GameObject that has the LipSync component. Default: speaker.

Examples:

  • SetEmotion(Happy, 0.5, Wife) (Sets Wife's emotion to "Happy Emotion", blending to that emotion state over 0.5 seconds)

EyeControl()

Syntax: EyeControl([target[, lookAmount[, subject]]])

Description: Sets an EyeController target.

Parameters:

  • target: (Optional) The GameObject to look at. If preceded by "tag:", the Auto Target Tag to use. Default: listener.
  • lookAmount: (Optional) The amount to look at the target.
  • subject: (Optional) The GameObject on which to set the eye controller. Default: speaker.

Examples:

  • SetEyeControl() (Sets the speaker's EyeController to look at the listener)
  • SetEyeControl(Husband, , Wife) (Sets Wife's EyeController to look at Husband)

<< Third Party Integration