I've been developing a mod that mimic enemy AI hearing players talking through proximity voice and radios. During testing on dedicated servers, I've run into an intermittent issue with VoNComponent.OnVoNUsed().
When everything is working normally, holding PTT without speaking generates very few callbacks, while actually speaking generates approximately 64–68 callbacks per second.
However, sometimes the VON system gets into a state where simply holding PTT without saying anything generates the same 64–68 callbacks per second as actual speech. I've reproduced this even with the microphone hardware-muted.
The issue affects both proximity VON and radio transmissions. Once it occurs, my mod cannot distinguish the flawed PTT from actual speech, causing AI to investigate players or dropped radios even though nobody is talking.
I've tried different callback timing thresholds, delays, and filtering methods, but none reliably distinguish speech from the flawed PTT once this condition occurs.
As far as I can determine, the current scripting API doesn't expose microphone amplitude, voice activity detection, or any indication of whether the transmitted audio actually contains speech. I am no season modder and fumble through this but is worth me pursuing after all the work I put in to be stopped by one thing.
So I have a few questions...
Is OnVoNUsed() intended to indicate actual transmitted voice activity, or simply that the VON system is transmitting?
Could the intermittent high callback rate during silent PTT indicate an issue with some type of engine silence detection?
Would it be possible to expose a reliable voice-activity indicator or microphone amplitude through the Enfusion scripting API?
This limitation makes it difficult to develop reliable AI voice-detection mods, especially on dedicated servers where false detections can directly affect gameplay. If there is currently a method get around this please let me know, or expose other controls that will make it possible.
Attached is my mod when it is actually working.