Posted November 26, 20204 yr Is it possible to mute external ITickableSounds? I'm using the PlaySoundEvent and neither setting the resultSound to null nor setting it to a new custom sound with volume 0 stops the current sounds. My primary problem comes from Minecarts, I can mute them but I have to break them an place them again in order to work, (or set the master volume to 0 and back). I've also tried SoundEngine#stopAllSounds(), SoundEngine#stop(sound), SoundHandler#stop(), etc.. Edited November 26, 20204 yr by LeoBeliik
November 26, 20204 yr The minecart tickable sound should be able to be set to null within PlaySoundEvent with no issues at least from my testing. How are you checking what sounds are being played and which ones to mute, and is this after they begin playing the sound or before the sound is initially loaded? Where are you calling the SoundEngine and SoundHandler methods as well?
November 26, 20204 yr This is after the sound starts playing, I'm using the PlaySoundEvent to determine witch sounds are playing and either setting the result null or using a custom class that extends ITickableSound and setting the volume to 0. and I tried using the event.getManager().stop() for SoundEngine and event.getManager().sndHandler for SoundHandler, this inside the PlaySoundEvent class. Edited November 26, 20204 yr by LeoBeliik
November 27, 20204 yr 1 hour ago, LeoBeliik said: This is after the sound starts playing, I'm using the PlaySoundEvent to determine witch sounds are playing and either setting the result null or using a custom class that extends ITickableSound and setting the volume to 0. and I tried using the event.getManager().stop() for SoundEngine and event.getManager().sndHandler for SoundHandler, this inside the PlaySoundEvent class. Using SoundEngine or SoundHandler inside the event will not do anything as the sound hasn't started playing yet. Can you debug with a breakpoint to check whether the result is actually being set to null or not?
November 27, 20204 yr Ok, that was a good idea, so the sound is properly mutted, the problem seems to be that minecarts wont trigger the PlaySoundEvent once they're placed, until they're broken or out of render.. So is any other even I could use for this?
November 27, 20204 yr Ok Ok, so I managed to stop the sound, what I've done is stop it using the SoundEngine.stop() when I'm adding the sound to the muted sounds. My problem now is I can't make it play again when I unmute the sound.. but that's for another topic that I'll open if I can't figure out. Thanks for your help 👍
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.