Garry's Mod

Garry's Mod

103 ratings
Dynamic Sound
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun, Realism
File Size
Posted
20.104 KB
4 Jan, 2022 @ 10:02pm
1 Change Note ( view )

Subscribe to download
Dynamic Sound

Description
Reupload of an old addon. Been looking for it for years after it was removed but fortunately I found it within some old gmod files. Use this at your own risk as it can be buggy, but it's fun to experiment and play around with nonetheless. It would be great for someone to pick this up and refine it into a more usable addon.

Highly recommend binding "snd_restart" to a key for when audio bugs out.

Original description:

This add-on overrides GMod's Lua's sound library and the EmitSound for entities and provides sound that travels, adding a delay effect. This can be provide neat audio effects with the Fireworks addon, or SWEPS. There are some limitations because of how addons work in GMod. Only addons that utilize the sound library in GMOD's Lua will have the traveling sound delay. Explosions made from barrels, and other physical props will be heard instantly.

This add-on also provides the Doppler effect for sounds. When an object is emitting sound and is approaching a listener, the pitch of the sound will be higher, and if an object is moving away, the pitch of the sound will be lower.

To turn off dynamic sound temporarily, change the console variable "dyn_sound" to 0 (Default: 1[On])
To turn off the doppler effect temporarily, change the console variable "dyn_sound_doppler" to 0 (Default: 1[On])

To change how fast sound travels, change the console variable "dyn_sound_speed" (Default: 8932[8,932]). (The speed of sound in Source units divided by two)

To increase the range of sounds, change the console variable "dyn_sound_lvlscale" (Default: 1)
2 would be two times the range
.5 would be half the range

Please note that sound travels to the player before it is heard. If you want to use cameras, use the "Ear" tool and left click the camera. This will make sound travel to the camera before it is heard.

A useful command to know is "stopsounds", there will be times where sounds still play even when the entity is removed, if that happens "stopsounds" will stop that sound, and all other sounds playing too.

LIMITATIONS:
Entities that are found in the Source engine. (FIXED)
Nuke Pack 4 calls surface.PlaySound(), that basically means the sound plays at the player's position, thus sound is heard instantly.

BUGS:
On Servers, shared sounds play twice, the only way to fix it is to ask the developer of that add-on to emit the sound server or client-side. This is a minor problem and you should be able to cope with it."

tags: live sound delay echo sonic boom sound speed sound wave doppler effect atmosphere
23 Comments
ariral gaming 24 Feb @ 6:20am 
peak idea so sad its buggy
Nickers 24 Aug, 2023 @ 10:49am 
This addon is broken, whenever it is enabled some sound will continually play after starting.
What TM 10 Jul, 2023 @ 12:05pm 
is there a mod that muffles the noise when your behind a wall or door?
Øylevision 14 May, 2023 @ 11:11am 
Alright. I'll have to figure out how to do it then. It's really simple though.
Giant African Land Snail  [author] 12 May, 2023 @ 12:30pm 
@Max I didn't upload this with the intent of updating or maintaining it as it's outside my ability. I wanted to have it in the workshop for people to play with or tweak/use for other or new mods.
Giant African Land Snail  [author] 12 May, 2023 @ 12:28pm 
@Øylevision No way!!! Upload it dude! That would be fantastic.
Øylevision 9 May, 2023 @ 6:19am 
I made a mod like this but without the doppler using AI, and it's compatible with arc9 simfphys and stuff like that. AI is cool man
Øylevision 5 May, 2023 @ 8:22am 
Man, I wish sound was treated the same as physics objects in all video games. It's governed by the same laws after all. It'll probably become a standard sometime in the future.
Øylevision 5 May, 2023 @ 8:19am 
Think of when you're walking, and then you turn around to have look behind you, because you could have swore you heard somebody else's footsteps around your back, but it turned out to just be sound doing it's thing.
Øylevision 5 May, 2023 @ 8:15am 
I actually think sound is one of the most amazing phenomenas in our world