Integration: Oculus LipSync

Unity SDK / Integration Guides / Oculus LipSync

👍

Don't forget to generate your didimos with support for Oculus LipSync animation. See Built for Oculus LipSync

In order to animate your didimo with Oculus LipSync, you will need to have the Oculus Integration package installed.

Setup

If you don't have the Oculus Integration package installed yet, you can do so now.

📘

Install

  1. Add the Oculus Integration package to your account through Unity's Asset Store
  2. Download and install the Oculus Integration package, through Unity's Package Manager. It should be listed under Packages: My Assets. Refresh the Package Manager if required.
  3. Follow the instructions to update Oculus and restart Unity

You may be asked to update some tools related to Oculus and restart Unity BEFORE the plugin will be installed. If you restart - check to see if the plugin still needs to be installed. A successful install will result in an Oculus folder in the Assets folder.

If you don't have the Oculus Module of our Unity SDK, it's recommendable to install it as well. You just need to add the Oculus folder to our SDK folder.

Preset Example Scene

There is an example scene that is already set up to work out of the box that you can explore.

📘

Run Example

  1. Download and install the Unity SDK using our Quick Start Guide
  2. Open the OculusTestApplication scene in Assets/Didimo/Oculus/Examples/Scenes/OculusTestApplication.unity
  3. Create a build for your oculus device using this scene
  4. Explore the scene with the didimo using LipSync

Create your own scene

You can also set up your own scene to test LipSync. There are only a few components required:

📘

Create your Scene

  1. Download and install the Unity SDK using our Quick Start Guide
  2. Create or open a scene with a didimo in it
  3. Add the following Oculus components to an object on the scene: OVRLipSyncContext, OVRLipSyncMicInput
  4. Add the following Unity component: AudioSource
  5. Add our script OculusSceneLipSync script to your didimo available in our Oculus module and map the components to the variables on the editor.
674

If you do not have our Oculus module installed, our OculusSceneLipSync script won't be available, but you can create your own version of this script as well:

// LipSync Variables
public OVRLipSyncContextBase lipSyncContext;
public OVRLipSyncMicInput lipSyncMicInput;
public AudioSource lipSyncAudioSource;

// Animate the didimo
private void Update() {
  OVRLipSync.Frame frame = lipSyncContext.GetCurrentPhonemeFrame();
  if (frame == null) return;
  for (int i = 0; i < visemeNames.Length; i++)
  {
    string visemeName = visemeNames[i];
    float visemeWeight = frame.Visemes[i];
    didimoComponents.PoseController.SetWeightForPose("oculus", visemeName, visemeWeight);
  }
}