env_microphone
Jump to navigation
Jump to search
Code classes:
CEnvMicrophone
CPointEntity
CBaseEntity
(all ents)
env_microphone
is a point entity present in all Source games. It acts as a microphone.
- In "Speaker mode", it picks up sound and rebroadcasts it at a Speaker target. It ignores the Hears X spawnflags and does not fire the SoundLevel output. Bug:
Does not pick up weapon fire sounds.
- In "Measuring mode", it measures the sound level at a Measure target and outputs the sound level as a value between 0 and 1. It only hears sounds that match the Hears X spawnflags.
Not related to env_speaker
.
Note: Be careful when targeting the
env_microphone
classname; the entity is created by prop_portal
s.
Flags[edit | edit source]
- 1: Hears combat sounds
- 2: Hears world sounds
- 4: Hears player sounds
- 8: Hears bullet impacts
- 16: Swallows sounds routed through speakers - This means it will not listen to sounds coming though from any other
env_microphone
including itself.
- 32: Hears explosions
- 64: Ignores non-attenuated sounds - Ignores sounds set to play everywhere in the map, such as music.
Keyvalues[edit | edit source]
- Speaker target
(SpeakerName)
<target_destination>
- Name of an entity at which to play any sounds heard by this microphone. If specified, the microphone will consider itself in "Speaker mode".
!player
may be specified. - Measure target
(target)
<target_destination>
- If the speaker is not in "Speaker mode", this is the name of the entity where the sound level is to be measured. If not specified, the
env_microphone
uses itself as the target. - Listen Filter
(ListenFilter)
<filterclass>
- The name of a filter entity which specifies which entities the microphone can hear. Sounds emitted by other entities will be ignored.
- Speaker DSP Preset
(speaker_dsp_preset)
<choices>
- Only useful in Speaker mode. If specified, sounds played back through speakers will be affected by the selected DSP setting.
- Bug: Some echo and reverb effects will sound like they're being cut off early in quiet environments. The effects are only processed when sounds are being picked up and played back.
- Bug: All active
env_microphone
s are forced to use the same preset at the same time. This is because the entity just sets a ConVar calleddsp_speaker
which actually controls the preset. - Bug: DSP will not apply to some sounds.
- Tip: AddOutput is buggy with this keyvalue. It's better to change the
dsp_speaker
convar directly.- 0: Normal
- 2:
Weird Tunnel
- 3: Metal Reverb
- 4:
Metal Reverb 2
- 5:
Metal Reverb 3
- 6: Tunnel Reverb
- 7:
Airy Reverb
- 8:
Airy Reverb 2
- 9:
Small Reverb
- 10:
Small Reverb 2
- 11:
Small Reverb 3
- 12: Tunnel Reverb 2
- 13: Tunnel Reverb 3
- 14:
Muffled
- 15:
Muffled 2
- 16: Distant Muffled Echo
- 20: Close Echo
- 21:
Repeating Echo
- 22:
Repeating Echo 2
- 23: Weird Reverb
- 24:
Repeating Echo 3
- 30:
Muffled 4
- 31:
Muffled 5
- 32:
Muffled 6
- 37: Ear Ringing
- 38: Radio
- 40: Close Echo + Reverb
- 44:
Weird
- 45:
Weird 2
- 46:
Volume Modulate
- 55: Flange/Radio
- Sensitivity (0-10)
(Sensitivity)
<float>
- Sensitivity in measuring mode. 1 is normal, and anything between there and 10 causes SoundLevel's output to be even closer to 1.0.
- Smoothing (0-1)
(SmoothFactor)
<float>
- How much to smooth SoundLevel's output over time, so that it increases and decreases more gradually.
- Maximum hearing range (0=infinite)
(MaxRange)
<float>
- Sounds beyond this range won't be heard.
- Start Disabled
(StartDisabled)
<boolean>
- Stay inactive until Enabled.
Inputs[edit | edit source]
- SetSpeakerName
<target_destination>
- Sets Speaker target.
- Enable
- Makes the entity active.
- Disable
- Makes the entity inactive.
Outputs[edit | edit source]
- SoundLevel
<float>
- Fires in "Measuring mode" whenever the sound level changes. Automatically puts how loud the environment is (from 0 to 1) as the input parameter, unless overridden by the mapper.
- OnRoutedSound
- Fires in speaker mode whenever a sound is routed out through the specified Speaker target (if any).
- OnHeardSound
- Fires in measure mode whenever this microphone hears any sound it cares about.