![header-lesson-02](assets/header-lesson-02.png)

# Using the Speaker

This section will focus on the speaker or buzzer on the micro:bit to play a built-in melody. The speaker is more like a primitive speaker (a **piezoelectric buzzer**) on an old PC. It will not play the range of sounds a regular speaker will play, but it is works for most projects.

![microbit-buzzer](assets/microbit-buzzer.png)

Select the "Music" drawer in the Toolbox.

![makecode-music-01](assets/makecode-music-01.png)

This drawer has many blocks that can be used to code the speaker. You can play specific tones, create melodies and change the volume. We will focus on playing a built-in melody.

![makecode-music-02](assets/makecode-music-02.png)

Scroll down and find the `play <melody dadadum> block`. Make sure to scroll down and select this block. The other `play` block closer to the top is used for custom melodies.

![makecode-music-03](assets/makecode-music-03.png)

Place the `play` block in the `forever` block.

![makecode-music-04](assets/makecode-music-04.png)

Choose the dropdown menu to choose any of the built-in melodies.

![makecode-music-05](assets/makecode-music-05.png)

In this example, `melody nyan` is selected.

![makecode-music-06](assets/makecode-music-06.png)

The micro:bit is now ready to be flashed with code. Press the download button to transfer the code to the micro:bit.

