ComputerCraft

ComputerCraft

21M Downloads

Issue with playSound with speaker peripheral

DigDugFTW opened this issue ยท 3 comments

commented

Just writing this because in the 1.12.1 beta build 20 there is an issue with the play sound is being played,
specifically with the playSound method.

  1. Sound continues to play even when the speaker is broken.
  2. When a new sound is being played the older one isn't stopped, instead it is played with the other sound.
    ..This could be good, so I think you should just add a clearSound method.. as it might not be a bad thing to over lap sounds.
commented

I think this is largely covered by #301. We've discussed some potential solutions to this, but I don't think anyone's come up with a "clean" solution yet.

With respect to overlapping sounds, it's tricky. There are definitely some times you want to play multiple sounds at once (for instance, playing multiple notes/chords at the same time). Sadly, the server doesn't know how long each sound lasts for, so we can't do something more complex like "only allow one 5 second long piece at a time", not that I'm sure that'd be a nice solution.

commented

See #301, as Squid mentioned. TL;DR stopping a sound while it's playing is a thorny issue. Could you close and we can continue there?

commented

I think I read somewhere that /playSound clear or something similar was added, so it's possible you could just implement that... I'm probably just over simplifying though.