pxt-calliope/docs/reference/music/set-built-in-speaker-enabled.md
Juri Wolf 5f7a8e5301
Updates for V4 (#197)
* update yotta defaults for 16kb devices

* refactor deprecated blocks

* updates for button events

* update button events

* update refference

* update docs

* update docs

* update button event blocks

* update docs

* update block id
2022-08-10 09:36:19 -07:00

38 lines
937 B
Markdown

# set Built In Speaker Enabled
Enable the speaker on the @boardname@ to play music and sounds.
```sig
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.
### ~ reminder
![works with micro:bit V2 only image](/static/v2/v2-only.png)
This block requires the [micro:bit V2](/device/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](/types/boolean) value that is ``true`` to enable the built-in speaker, or ``false`` to send sounds to the pitch pin.
## Example #example
Enable the built-in speaker play sounds.
```blocks
music.setBuiltInSpeakerEnabled(true)
```
## See also
[analog-set-pitch-pin](/reference/pins/analog-set-pitch-pin)
```package
music
```