env_microphone
Class hierarchy |
---|
CEnvMicrophone |
envmicrophone.cpp
|
env_microphone
is a point entity available in all Source 2 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. 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.
Flags
Swallows sounds routed through speakers : [16]
Hears explosions : [32]
Ignores non-attenuated sounds : [64]
Keyvalues
- Name
(targetname)
<string> - The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Measure Target
(target)
<targetname> - If the speaker is in Measuring mode, this is the name of the entity where the sound level is to be measured.
- Speaker target
(SpeakerName)
<targetname> - The name of an info_target entity through which to play any sounds heard by this microphone. If specified, the microphone will consider itself in Speaker mode.
- Listen Filter
(ListenFilter)
<filter> - The name of an filter entity which specifies the only entities the microphone can hear. Sounds emitted by other entities will not be heard.
- Speaker DSP Preset
(speaker_dsp_preset)
<choices> - Only useful in Speaker mode. If specified, when the microphone is enabled, it'll set the global dsp_speaker preset to this value. Sounds played back through speakers will then be affected by the selected DSP.
Value Description 0
Use Default 50
1 NO EFFECT 51
2 (DUPLICATE OF 1) 52
3 (DUPLICATE OF 1) 53
4 (DUPLICATE OF 1) 54
5 (DUPLICATE OF 1) 55
6 SPEAKER, LOUDER 56
7 SPEAKER VERY SMALL 57
8 LOUDSPEAKER, ECHO 58
9 SPEAKER SMALL 59
10 SPEAKER TINY
- Listen For Sound Type
(SoundType)
<choices>
Value Description 1
Combat 2
Player 3
Danger 4
Bullet Impacts
- Sensitivity (0-10)
(Sensitivity)
<float> - Microphone sensitivity, 0=deaf, 1=default, 10=extremely sensitive). Only applicable in Measuring mode.
- Smoothing (0-1)
(SmoothFactor)
<float> - Smoothing factor, 0=no smoothing, 1=maximum smoothing). Only applicable in Measuring mode.
- Maximum hearing range (0=infinite)
(MaxRange)
<float> - Sounds beyond this range won't be heard, irrelevant of attenuation.
- Warning:setting this to zero (or a value > 1024) when the microphone is in Speaker mode can be very bad for performance!!
- Start Disabled
(StartDisabled)
<boolean> - Stay dormant until activated (with the
Enable
input).
Inputs
SetSpeakerName
<targetname>- Set the microphone to output through a different speaker entity.
EnableDisable:
Enable / Disable
- Enable/disable this entity from performing its task. It might also disappear from view.
Outputs
SoundLevel
<float>- Fired in Measuring mode whenever the sound level changes.
OnRoutedSound
- Fired whenever a sound is routed out through the specified speaker (if any).
OnHeardSound
- Fired whenever this microphone hears any sound it cares about.