Playing a beep on the button press

In this recipe, we will learn how to play a beeping tone when the button is pressed. The previous recipes allowed us to interact with light using the buttons. This recipe will show you how to introduce button and sound interactions in your projects.