Avatars mouth movement — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Avatars mouth movement

Hello, i am having trouble getting the avatars mouths to move. I have the following code.  Enable Mouth Vertex Animations is also enabled on the avatar. Also, i am using Photon Voice for this.

private void Update() {           
if (this._voipAudioSource.clip == null) {
return;
}

this._currentUpdateTime += Time.deltaTime;
if (this._currentUpdateTime >= this._updateStep) {
this._currentUpdateTime = 0f;
this._voipAudioSource.clip.GetData(this._clipSampleData,
this._voipAudioSource.timeSamples); //I read 1024 samples, which is about 80 ms on a 44khz stereo clip, beginning at the current sample position of the clip.
this._clipLoudness = 0f;
foreach (var sample in this._clipSampleData) {
this._clipLoudness += Mathf.Abs(sample);
}

this._clipLoudness /= this._sampleDataLength; //clipLoudness is what you are looking for
DebugHelper.Log("Loudness: " + this._clipLoudness * VOIP_SCALE);
if (this._ovrAvatar != null) {
this._ovrAvatar.VoiceAmplitude = Mathf.Clamp(this._clipLoudness * VOIP_SCALE, 0f, 1f);
}
}
} private void OnAudioFilterRead(float[] data, int channels) {
this._ovrAvatar.UpdateVoiceVisualization(data);
}

Comments

  • DigibixDigibix Posts: 17 Oculus Start Member
    The avatar mouth movement currently works only on Android....
  • treeviewstudiostreeviewstudios Posts: 39
    Brain Burst
    digibix said:
    The avatar mouth movement currently works only on Android....
    Any idea when its going to be on PC?, no way to force it right?
Sign In or Register to comment.