cancel
Showing results for 
Search instead for 
Did you mean: 

Avatars mouth movement

pintiliciuc_oct
Honored Guest
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);
}

2 REPLIES 2

Digibix
Protege
The avatar mouth movement currently works only on Android....

treeviewstudios
Protege

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?