Esempio n. 1
0
 protected void UpdateForward()
 {
     for (int i = 0; i < targetBlendValues.Length; ++i)
     {
         targetBlendValues[i] = 0.0f;
     }
     if (recognizeResult != null)
     {
         targetBlendValues[vowelToIndexDict[recognizeResult]] = 1.0f;
     }
     blendValuesSum = 0.0f;
     for (int j = 0; j < currentBlendValues.Length; ++j)
     {
         blendValuesSum += currentBlendValues[j];
     }
     for (int k = 0; k < currentBlendValues.Length; ++k)
     {
         if (propertyIndexs[k] != -1)
         {
             currentBlendValues[k] = Mathf.MoveTowards(currentBlendValues[k], targetBlendValues[k], moveTowardsSpeed * Time.deltaTime);
             targetBlendShapeObject.SetBlendShapeWeight(propertyIndexs[k], Mathf.Lerp(propertyMinValue, propertyMaxValue, currentBlendValues[k]));
         }
     }
     visualization.Update(runtimeRecognizer.playingAudioSpectrum);
     if (recognizeText)
     {
         recognizeText.text = "RecognizeResult: " + recognizeResult;
     }
 }
Esempio n. 2
0
        protected virtual void UpdateForward()
        {
            // 更新左上角的音频频谱
            if (visualization != null)
            {
                visualization.Update(runtimeRecognizer.playingAudioSpectrum);
            }

            // 显示识别结果
            if (recognizeText)
            {
                recognizeText.text = "RecognizeResult: " + recognizeResult;
            }
        }