set Built In Speaker Enabled

Enable the speaker on the micro:bit to play music and sounds.

music.setBuiltInSpeakerEnabled(false)

The microbit v2 has a speaker on the board itself. You can enable the built-in speaker to play sounds instead having them an external speaker connected to the pitch pin.

works with micro:bit V2 only image

This block requires the micro:bit V2 hardware. If you use this block with a micro:bit v1 board, you will see the 927 error code on the screen.

Parameters

  • enabled: a boolean value that is true to enable the built-in speaker, or false to send sounds to the pitch pin.

Example

Enable the built-in speaker play sounds.

music.setBuiltInSpeakerEnabled(true)

See also

analog-set-pitch-pin

music