Env microphone (Source 2): Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
[[File:env_microphone.png|left]] | [[File:env_microphone.png|left]] | ||
{{CD|CEnvMicrophone|file1=envmicrophone.cpp}} | {{CD|CEnvMicrophone|file1=envmicrophone.cpp}} | ||
{{this is a|point entity|name=env_microphone|engine= | {{this is a|point entity|name=env_microphone|engine=Source 2}} 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== | ==Flags== | ||
Latest revision as of 12:36, 11 May 2025
| CEnvMicrophone |
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>[ 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
- 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!!
- 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.
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.
