Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by LeoBeliik

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?

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 by LeoBeliik

Oops double post, sorry

Edited by LeoBeliik

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?

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?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.