
VoiceReact
Make Enemies Hear Your Voice
Voice-reactive gameplay system for Unity. Create horror and stealth games where speaking into your microphone alerts nearby enemies. Complete with distance-based hearing, volume detection, and multiplayer support.
// Attach to player - detects voice activity
voiceController.OnSpeechStart.AddListener(() => {
Debug.Log("Player started speaking!");
});
// Attach to enemies - makes them hear the player
voiceListener.OnPlayerHeard.AddListener((position, volume) => {
enemyAI.Investigate(position);
Debug.Log($"Heard player at {volume} dB");
});Key Features
Enemy Hearing System
Complete NPC hearing solution - attach VoiceListener to enemies and they'll react to player voice based on distance and volume.
Distance-Based Detection
Dynamic hearing ranges scale with voice volume - whispers have short range, shouts travel far. Optional line-of-sight occlusion.
Detection Presets
Zero-configuration setup with sensitivity presets: Very Sensitive for horror games, Balanced for general use, Less Sensitive for noisy environments.
Multiple Audio Sources
Works with Unity Microphone, Dissonance VoIP for multiplayer, or custom audio providers through a flexible interface.
Multiplayer Ready
Generic network adapter interface works with any networking library - Netcode, Mirror, Photon, Fish-Net, and more.
Speech-to-Text (Optional)
Whisper integration for voice commands and transcription without adding dependencies to the core system.
How It Works
1. Add VoiceReactController to Player
Attach VoiceReactController to your player GameObject. Select a Detection Preset (Very Sensitive for horror, Balanced for general use) and you're ready to go - no calibration needed.
// Access the controller
VoiceReactController voiceController = GetComponent<VoiceReactController>();
// Check if player is speaking
if (voiceController.IsPlayerSpeaking) {
// Show speaking indicator, alert enemies, etc.
}
// Get normalized volume for UI
float volume = voiceController.NormalizedVolume; // 0-12. Add VoiceListener to Enemies
Attach VoiceListener to any GameObject that should react to player voice. Set the base hearing range, and VoiceReactManager automatically coordinates distance checks and volume scaling.
// VoiceListener automatically detects the VoiceReactController
// Just hook up the events
voiceListener.OnPlayerHeard.AddListener((position, decibelLevel) => {
// Enemy heard the player - investigate the position
enemyAI.Alert(position);
});
voiceListener.OnPlayerLost.AddListener(() => {
// Player stopped speaking or moved out of range
enemyAI.ReturnToPatrol();
});3. Configure Events & Optional Features
Use UnityEvents for visual scripting or C# events for code. Add optional features like speech-to-text for voice commands or networking adapters for multiplayer.
// Optional: Get speech transcription
voiceController.EnableSpeechToText(whisperModel);
voiceController.OnTranscriptionReady.AddListener(text => {
if (text.Contains("open door")) {
door.Open();
}
});
// Optional: Sync voice across network
voiceController.SetNetworkAdapter(new MyNetworkAdapter());Frequently Asked Questions
What is VoiceReact and what games is it best for?
VoiceReact is a voice-reactive gameplay system for Unity that makes enemies and NPCs react to player voice input through their microphone. It's perfect for horror games (where speaking alerts monsters), stealth games (where noise matters), voice-controlled puzzles, and multiplayer proximity chat systems. The distance-based hearing system means whispers have short range while shouts travel far.
How difficult is VoiceReact to set up in my Unity project?
VoiceReact is designed for zero-configuration setup. Attach VoiceReactController to your player, attach VoiceListener to enemies, and select a detection preset (Very Sensitive for horror, Balanced for general use, Less Sensitive for noisy environments). No manual calibration or threshold tuning required. The system includes sensitivity presets that work out of the box.
Does VoiceReact work with multiplayer games?
Yes! VoiceReact includes a generic network adapter interface that works with any Unity networking library - Netcode for GameObjects, Mirror, Photon, Fish-Net, and more. You can sync voice events across the network so remote players' voices can be detected by NPCs in the game world. The system also supports Dissonance VoIP for seamless integration with voice chat.
Can I use VoiceReact for voice commands or speech-to-text?
Yes! VoiceReact has optional Whisper integration for speech-to-text transcription. This allows you to implement voice commands like 'open door' or 'cast fireball' without adding dependencies to the core voice detection system. The transcription feature is completely optional and can be enabled when needed.
How does the distance-based hearing system work?
VoiceReact dynamically scales hearing ranges based on player volume. Attach VoiceListener components to enemies and set a base hearing range. When the player whispers, enemies can only hear within a short distance (20% of base range). Normal speech reaches medium distance (50%), while shouting reaches the full base range or beyond (200%). You can also enable line-of-sight occlusion to block sound through walls.
What Unity versions and platforms does VoiceReact support?
VoiceReact supports Unity 2021.3 LTS and newer. It works on Windows, macOS, Linux, WebGL, iOS, and Android. The system uses Unity's Microphone API by default but also supports custom audio providers, so you can integrate with platform-specific audio systems or VoIP solutions like Dissonance.
Can I try VoiceReact before purchasing?
VoiceReact is currently in active development and will be available on the Unity Asset Store soon. Documentation is available now at peekgames.dev/docs/voicereact with complete API references, code examples, and integration guides. Follow our updates for launch announcements and early access opportunities.