Skip to content

Commit

Permalink
Merge pull request #118 from inworld-ai/yjProj
Browse files Browse the repository at this point in the history
Upgrade methods for audio test
  • Loading branch information
Juniverse authored Jan 31, 2025
2 parents d1201b4 + 496489f commit f923075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Runtime/Scripts/Audio/AudioModules/PlayerVoiceDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public void OnCalibrate()
float rms = CalculateRMS();
if (rms > m_BackgroundNoise)
m_BackgroundNoise = rms;
m_CalibratingTime += Time.fixedUnscaledDeltaTime;
// YAN: Remove the first frame as the fixedDeltaTime is extremely high.
if (Time.fixedUnscaledDeltaTime < m_BufferSeconds)
m_CalibratingTime += Time.fixedUnscaledDeltaTime;
if (m_CalibratingTime >= m_BufferSeconds)
OnStopCalibration();
}
Expand Down
2 changes: 2 additions & 0 deletions Runtime/Scripts/Audio/AudioModules/WebGLCaptureModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Inworld.Entities;
using UnityEngine;

#if !UNITY_ANDROID
namespace Inworld.Audio
{
public class WebGLCaptureModule : InworldAudioModule, IMicrophoneHandler, ICollectAudioHandler
Expand Down Expand Up @@ -185,3 +186,4 @@ static void OnWebGLInitialized(string json)
}
}
}
#endif

0 comments on commit f923075

Please sign in to comment.