Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound duplicate if a player dies and respawn near a active radio block #80

Open
vico93 opened this issue Aug 13, 2020 · 4 comments
Open

Comments

@vico93
Copy link

vico93 commented Aug 13, 2020

Minecraft 1.12.2
Forge 14.23.5.2854
OpenFM-1.12.2-0.1.0.19

If a player dies near a playing radio block and respawn near (if the radio is next to the bed for example), OR dies, respawn in world spawn and gets teleported to near the radio, the audio gets duplicated. One audio can be controlled stopping the radio block, but the other not and keeps playing regardless of the radio block playing or not. To mitigate it any player who dies near a playing radio block need to exit the server and rejoin so only the active audio stay.

@TheAirBlow
Copy link

Mod starts playback when the RadioTileEntity.startStream() is called, and it is called when:

  1. The RadioTileEntity is instantiated
  2. When the client receives a Sync/Play/StreamURL packets

The first one is probably the issue. We have to stop all music threads when we respawn, and it would probably fix it.
Basically, the RadioTileEntity gets reloaded when we respawn (I think), and the old AudioPlayer never gets unloaded, so we get duplicated AudioPlayer

@vico93
Copy link
Author

vico93 commented Jul 7, 2022

So happy to see this mod still getting attention. Honestly i even forgot that i created this issue 2 years ago xD.

I hope someday i could see this mod ported to Fabric (and for modern versions of Minecraft)...

@TheAirBlow
Copy link

TheAirBlow commented Jul 9, 2022

So happy to see this mod still getting attention. Honestly i even forgot that i created this issue 2 years ago xD.

I hope someday i could see this mod ported to Fabric (and for modern versions of Minecraft)...

I am currently rewriting this mod completely. Would be still 1.12.2 forge, but after that I would probably port it to 1.14 and higher.

The Radio Tuner is fully implemented with a lot of new features:

  1. Select multiple speakers at the same time
  2. Speaker can only be connected to one radio
  3. Selected speakers are highlighed with a nice animation
  4. Allow for removing speakers instead of adding
  5. Allow for getting information about how many speakers are connected

Sadly I am currently stuck at NBT syncronisation, but it would probably be done soon.
I found a nice library that converts any audio format to Opus (it can be played very easily), which would make this mod support a lot more more formats. It's called LavaPlayer.

@vico93
Copy link
Author

vico93 commented Jul 14, 2022

So happy to see this mod still getting attention. Honestly i even forgot that i created this issue 2 years ago xD.
I hope someday i could see this mod ported to Fabric (and for modern versions of Minecraft)...

I am currently rewriting this mod completely. Would be still 1.12.2 forge, but after that I would probably port it to 1.14 and higher.

The Radio Tuner is fully implemented with a lot of new features:

  1. Select multiple speakers at the same time
  2. Speaker can only be connected to one radio
  3. Selected speakers are highlighed with a nice animation
  4. Allow for removing speakers instead of adding
  5. Allow for getting information about how many speakers are connected

Sadly I am currently stuck at NBT syncronisation, but it would probably be done soon. I found a nice library that converts any audio format to Opus (it can be played very easily), which would make this mod support a lot more more formats. It's called LavaPlayer.

Oh looking so much forward for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants