env_microphone
Jump to navigation
Jump to search
| CEnvMicrophone |
env_microphone is a point entity available in all
Source 2 games.
- The
{{{engine}}}parameter is inconsistent with the name defined by the {{source2}} template. This can most likely be fixed by setting the value of the{{{engine}}}parameter toSource 2.
If a parameter is consistent but you're still seeing this warning, it may be an issue with the template itself. Please discuss it on the template's talk page.
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
- 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 0Use Default 501 NO EFFECT 512 (DUPLICATE OF 1) 523 (DUPLICATE OF 1) 534 (DUPLICATE OF 1) 545 (DUPLICATE OF 1) 556 SPEAKER, LOUDER 567 SPEAKER VERY SMALL 578 LOUDSPEAKER, ECHO 589 SPEAKER SMALL 5910 SPEAKER TINY
- Listen For Sound Type (SoundType) <choices>
Value Description 1Combat 2Player 3Danger 4Bullet 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!!
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentnameortarget).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Start Disabled (StartDisabled) <boolean>
- Stay dormant until activated (with the
Enableinput).
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.
Base:
- RunScriptFile
- Load and execute a script file.
- RunScriptCode
- Execute a fragment of script code.
- CallScriptFunction
- Call a script function.
- CallPrivateScriptFunction
- Calls a script function from this entity's private script scope.
- CallGlobalScriptFunction
- Calls a script function in the global script scope.
- Kill
- Removes this entity from the world.
- KillHierarchy
- Removes this entity and all its children from the world.
- AddOutput
- Adds an entity I/O connection to this entity. Parameter format: OutputName→TargetName→InputName→Parameter→Delay→MaxRefires
- FireUser1 to FireUser4
- Fires the respective
OnUseroutputs; see User Inputs and Outputs.
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.
