The Don't Scream Audio Manager script provides functionality to manage microphone input in Unity. It includes features for selecting a microphone, monitoring volume levels, and detecting audio peaks.
- Microphone selection via dropdown menu.
- Real-time volume monitoring with a slider and label.
- Threshold crossing detection for volume levels.
- Audio peak detection for sudden spikes in volume.
- Attach the
MicrophoneManagerscript to a GameObject in your Unity scene. - Assign UI elements to the script's public variables:
microphoneDropdown: A TMP_Dropdown UI element for selecting microphones.volumeSlider: A Slider UI element for displaying volume levels.volumeLabel: A TMP_Text UI element for displaying volume information.
- Adjust sensitivity and threshold settings in the Inspector as needed.
- Run the scene.
- Launch the Unity scene.
- Use the dropdown menu to select an available microphone.
- Adjust the volume slider to monitor microphone input volume.
- Threshold crossing events and audio peak detections will trigger corresponding actions, which can be customized in the script.
- Ensure microphone permissions are granted on the target platform (especially for mobile).
- Customize peak detection and volume threshold settings to suit your application's requirements.
- Consider optimizing sensitivity settings for different microphone setups and environments.
- Unity 3D (compatible with Unity 20XX)
- TextMeshPro (TMP) package for UI elements
This project is licensed under the Creative Commons Attribution 4.0 International Public License. You are free to use, distribute, remix, adapt, and build upon this work, even commercially, as long as you credit the original creator.
This script was developed by [Daniel Chakarov/Sleeping Impulse].