Getting env_microphone to work with player voices

If you’ve played half life 2, the first thing of note that you see is Dr. Breen talking through a gigantic screen. This is done using the entity env_microphone which records sounds in an area and then replaying them through an info_target. However this is entirely selective and while it works with general sounds, it does not work with player voice communication. I’m wondering if it’s at all possible to use lua to remedy this situation, or perhaps create a similar entity to do it.

I am first and foremost a mapper, and have very little lua knowledge, but any little bits would help.

Btw, in the map I have set up I have 8 different env_microphone entities. One for each screen.


Wow, I haven’t heard of this before and this sounds really useful. What you could try:

ents.Create to create an “info_target”

Entity:SetPos() the info_target to where you want the sound to play

Entity:SetName() the info_target to something like “stiffy_microphone_target”
Then using

ents.Create to create an “env_microphone”

Entity:Fire(“SetSpeakerTarget”, “stiffy_microphone_target”) on the microphone ent to set the playback target
should get you on the right track (untested)

I don’t think you can do it with voice because it is never actually transmitted in the game world.

I already have all that stuff in my mic, it’s just not working with voice. Probably due to the reason robotboy listed

Would it be possible to get it transmitted through the game world? or no?

Not as far as I know.

Could you not use PlayerCanHearPlayerVoice with a custom entity range check?

I’m sure you could but that’d get really expensive fast.

Just cache the ent result and update it per second