Is there a way to temporarily mute all game sounds and music through scripting?
Its important that the sounds and music would be reverted back to normal afterwards.
Temporarily mute all sounds and music?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- Ozymandias81
- Posts: 2063
- Joined: Thu Jul 04, 2013 8:01 am
- Graphics Processor: nVidia with Vulkan support
- Location: Mount Olympus, Mars
- Contact:
Re: Temporarily mute all sounds and music?
Uhm maybe a cryptic combination between [wiki]SoundVolume[/wiki] and [wiki]SetMusicVolume[/wiki]?
Not sure if it should work, and I also wonder if it's possible something different though (CCMDs or ZScript)....
[EDIT]: Check what we did for Blade of Agony, for example...
Not sure if it should work, and I also wonder if it's possible something different though (CCMDs or ZScript)....
[EDIT]: Check what we did for Blade of Agony, for example...
- Spaceman333
- Posts: 622
- Joined: Thu Oct 13, 2016 8:40 pm
Re: Temporarily mute all sounds and music?
With the method you're using in your mod, does it break the user's own music volume setting that they had set in the options menu?Ozymandias81 wrote:Uhm maybe a cryptic combination between [wiki]SoundVolume[/wiki] and [wiki]SetMusicVolume[/wiki]?
Not sure if it should work, and I also wonder if it's possible something different though (CCMDs or ZScript)....
[EDIT]: Check what we did for Blade of Agony, for example...
Meanwhile, I've thought of two new ideas I could try, but they're both a bit crazy. I'd like to hear if either of them would be a grave mistake:
1. Overload all sound channels with an empty sound file 35 times per second, essentially forcing all other sounds to fail from playing.
2. Spawn a https://zdoom.org/wiki/Classes:SectorSilencer actor and make it follow the player's position every tick.
- Spaceman333
- Posts: 622
- Joined: Thu Oct 13, 2016 8:40 pm
Re: Temporarily mute all sounds and music?
Turns out SetMusicVolume's value is seperate from the Global Music volume settings, so it turned out to be perfect! Yay!
Thank you for that one Ozymandias81.
Sadly, the SoundVolume only works for one sound channel per one TID. Essentially I'd need to iterate through every possible TID (I think there were 9999 of those?) 8 times for every sound channel per every. ingame. tic. Basically that would result in the worst possible performance bottleneck ever.
My other attempts at using a SectorSilencer and overloading all sound channels with a dummy sound failed too, so I'm a bit shit out of luck in regards to muting all sounds.
Man, this sucks.
I really like how the slomo works function wise, but the choppy sound issue really harms it in a very bad way. I could use any ideas to mute all the sound that could fix the issue. Music was successfully muted so half the battle was won, only muting the sound still remains an issue. Any help would be greatly appreciated.
Here's the latest version of the slomo mod for those who want to see where things are at:
http://www.filedropper.com/slomobullettime
Thank you for that one Ozymandias81.
Sadly, the SoundVolume only works for one sound channel per one TID. Essentially I'd need to iterate through every possible TID (I think there were 9999 of those?) 8 times for every sound channel per every. ingame. tic. Basically that would result in the worst possible performance bottleneck ever.
My other attempts at using a SectorSilencer and overloading all sound channels with a dummy sound failed too, so I'm a bit shit out of luck in regards to muting all sounds.
Man, this sucks.
I really like how the slomo works function wise, but the choppy sound issue really harms it in a very bad way. I could use any ideas to mute all the sound that could fix the issue. Music was successfully muted so half the battle was won, only muting the sound still remains an issue. Any help would be greatly appreciated.
Here's the latest version of the slomo mod for those who want to see where things are at:
http://www.filedropper.com/slomobullettime