BlueGit

blue-star ggj-2020

Files

ggj-2020 / Assets / Oculus / LipSync / Scripts / OVRLipSyncContextCanned.cs

OVRLipSyncContextCanned.cs

Project Import
timfa Tim Falken · pushed by timfa · 6 years ago
b77834a1 History
OVRLipSyncContextCanned.cs 2.0 KiB Download Raw
1/************************************************************************************
2Filename : OVRLipSyncContextCanned.cs
3Content : Interface to Oculus Lip-Sync engine
4Created : August 6th, 2015
5Copyright : Copyright Facebook Technologies, LLC and its affiliates.
6 All rights reserved.
7
8Licensed under the Oculus Audio SDK License Version 3.3 (the "License");
9you may not use the Oculus Audio SDK except in compliance with the License,
10which is provided at the time of installation or download, or which
11otherwise accompanies this software in either electronic or hard copy form.
12
13You may obtain a copy of the License at
14
15https://developer.oculus.com/licenses/audio-3.3/
16
17Unless required by applicable law or agreed to in writing, the Oculus Audio SDK
18distributed under the License is distributed on an "AS IS" BASIS,
19WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20See the License for the specific language governing permissions and
21limitations under the License.
22************************************************************************************/
23using UnityEngine;
24
25
26[RequireComponent(typeof(AudioSource))]
27
28//-------------------------------------------------------------------------------------
29// ***** OVRLipSyncContextCanned
30//
31/// <summary>
32/// OVRLipSyncContextCanned drives a canned phoneme sequence based on a pre-generated asset.
33///
34/// </summary>
35public class OVRLipSyncContextCanned : OVRLipSyncContextBase
36{
37 [Tooltip("Pre-computed viseme sequence asset. Compute from audio in Unity with Tools -> Oculus -> Generate Lip Sync Assets.")]
38 public OVRLipSyncSequence currentSequence;
39
40 /// <summary>
41 /// Run processes that need to be updated in game thread
42 /// </summary>
43 void Update()
44 {
45 if (audioSource.isPlaying && currentSequence != null)
46 {
47 OVRLipSync.Frame currentFrame = currentSequence.GetFrameAtTime(audioSource.time);
48 this.Frame.CopyInput(currentFrame);
49 }
50 }
51}