In other languages

Help the wiki!

The Scratch Wiki is made by and for Scratchers. Do you want to contribute?

Learn more about joining as an editor!

See discussions in the Community Portal

Loudness (block)

This article is about the block. For more information on the value this block reports, see Loudness (value).
Loudness
2.0 Loudness.png
Category Sensing
Type Reporter

The Loudness block is a Sensing block and a Reporter block. The block reports how loud the noise is that a microphone receives, on a scale of 0 to 100.

To use this block, a microphone must be used, and so a message will appear on the screen, asking for permission to use the microphone. If you deny it, the block will report a loudness of 0 or -1. If you do not have a microphone, earbuds inserted into the microphone port work too.

This block can be displayed as a Stage monitor.

Example Uses

This block is more precise than the Loud? block; instead of simply reporting if a noise is loud or not, the Loudness block will report how loud the noise is. Therefore, when accuracy is needed with measuring noises' volume, this block is the better choice.

Some common uses for the Loudness block:

  • Voice analyzers- users can make sprites react to a certain level of loudness.
wait until <key [space v] pressed?>
if <(loudness) > (30)> then // when the loudness is over 30 this will activate the <loud> block
  say [You are a very loud and outgoing person. You like to speak up when there is the need.] for (5) secs
else
  say [You are a timid person, but one to be wary of. There is more than meets the eye.] for (5) secs
end 
forever
turn cw (loudness) degrees
  • Setting a microphone's size to a noise's loudness
forever
set size to ((loudness) + (100))%

See Also

  • This page was last modified on 24 June 2016, at 23:38.