scratchfoundation / scratch-vm

Virtual Machine used to represent, run, and maintain the state of programs for Scratch 3.0
http://scratchfoundation.github.io/scratch-vm/
BSD 3-Clause "New" or "Revised" License
1.2k stars 1.49k forks source link

Multiple clones playing same audio clip produces a stutter effect #2255

Open skyistumbling opened 5 years ago

skyistumbling commented 5 years ago

When you have multiple clones playing the exact same audio clip at the same time via the "Play sound () until done" block, it produces an stuttering sound by what we think is the audio engine restarting the sound on an interval; what should of course be happening is both of the clones over lapping the audio clip.

Example image

We know @ericrosenbaum has an similar post to this https://github.com/LLK/scratch-audio/issues/51, and in said post he mentions something about an problem with giving clones their own AudioPlayers concerning performance and what not.

If you want an more head on example of this bug then check out my lad's project, https://scratch.mit.edu/projects/317813961/ pardon the satire

ExpertNoob1019 commented 2 months ago

i dunno, i have this same issue and a possible idea i have is to make a seperate sprite play the sound, then make a list of all the clones you want to play the sound, and in the other sprite, do an "forever, if length of insert list name here > 0 then: set volume to 100, else: set volume to 0" but im looking for a slightly easier way