Scratch-blocks: Using "Delete All Blocks" plays too many sounds at once

Created on 19 May 2016  路  7Comments  路  Source: LLK/scratch-blocks

To test, load the horizontal playground and click "Sprinkles!"

Then right-click and select "Delete X blocks".

You'll hear a grating noise. This is the sound of every block being deleted, the noise plays once for every deleted block.

It only plays the sound once for each block stack - using "Spaghetti!" (despite saying to delete nearly 4000 blocks) only plays the sound a few times.

bug

Most helpful comment

A rate-limiter has been added to Blockly's develop branch which resolves this issue.
https://github.com/google/blockly/commit/006bb36b89ab3e9cd4aa3b0cf3143e0f8c4b0ae3

All 7 comments

Great catch. We haven't been using the right-click menus in our prototypes so this went unnoticed.

@thisandagain Where exactly is the delete noise handled? I might be able to fix it.

Even something like "only play one delete noise every 0.1 seconds" could help fix the problem.

@thisandagain Sounds good. I'm not sure if that change affects it, but it's good to have an idea of what I'm looking at :smiley:
Recloning the repo now.

EDIT: Apparently that PR was merged a while ago. Still useful though

Hmm... Two things I notice.

First, the sounds get faster as more blocks are deleted.

  • Click "Sprinkles!"
  • Right-click and select "Delete 100 Blocks".
  • You'll hear that it starts off slow and gets faster.

Second, if you're on a separate tab, you'll only hear 1 sound at a time.

  • Click "Sprinkles!"
  • Right-click and select "Delete 100 Blocks".
  • Switch to another tab.
  • Listen - you'll only hear one sound at a time.
  • Not only that, but only one block is being deleted at a time.

Just addressed this in https://github.com/google/blockly/pull/374 (very small change required). If that pull request gets accepted in upstream blockly the change should flow down on next pull from upstream into scratch blocks.

A rate-limiter has been added to Blockly's develop branch which resolves this issue.
https://github.com/google/blockly/commit/006bb36b89ab3e9cd4aa3b0cf3143e0f8c4b0ae3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

towerofnix picture towerofnix  路  5Comments

tmickel picture tmickel  路  3Comments

towerofnix picture towerofnix  路  6Comments

thisandagain picture thisandagain  路  6Comments

bfunc picture bfunc  路  5Comments