env_microphone

From Source Entities
Jump to navigation Jump to search

Code classes:

Env microphone.png

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: Csgo-small.pngDoes 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: P1.pngBe careful when targeting the env_microphone classname; the entity is created by prop_portals.

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_microphones are forced to use the same preset at the same time. This is because the entity just sets a ConVar called dsp_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: Csgo-small.pngWeird Tunnel
  • 3: Metal Reverb
  • 4: L4d2-small.pngP2.pngCsgo-small.pngMetal Reverb 2
  • 5: L4d2-small.pngP2.pngCsgo-small.pngMetal Reverb 3
  • 6: Tunnel Reverb
  • 7: L4d2-small.pngP2.pngCsgo-small.pngAiry Reverb
  • 8: L4d2-small.pngP2.pngCsgo-small.pngAiry Reverb 2
  • 9: L4d2-small.pngP2.pngCsgo-small.pngSmall Reverb
  • 10: L4d2-small.pngP2.pngCsgo-small.pngSmall Reverb 2
  • 11: L4d2-small.pngP2.pngCsgo-small.pngSmall Reverb 3
  • 12: Tunnel Reverb 2
  • 13: Tunnel Reverb 3
  • 14: L4d2-small.pngP2.pngCsgo-small.pngMuffled
  • 15: L4d2-small.pngP2.pngCsgo-small.pngMuffled 2
  • 16: Distant Muffled Echo
  • 20: Close Echo
  • 21: L4d2-small.pngP2.pngCsgo-small.pngRepeating Echo
  • 22: L4d2-small.pngP2.pngCsgo-small.pngRepeating Echo 2
  • 23: Weird Reverb
  • 24: L4d2-small.pngP2.pngCsgo-small.pngRepeating Echo 3
  • 30: L4d2-small.pngP2.pngCsgo-small.pngMuffled 4
  • 31: L4d2-small.pngP2.pngCsgo-small.pngMuffled 5
  • 32: L4d2-small.pngP2.pngCsgo-small.pngMuffled 6
  • 37: Ear Ringing
  • 38: Radio
  • 40: Close Echo + Reverb
  • 44: L4d2-small.pngP2.pngCsgo-small.pngWeird
  • 45: L4d2-small.pngP2.pngCsgo-small.pngWeird 2
  • 46: L4d2-small.pngP2.pngCsgo-small.pngVolume 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.