Sound Effect¶
PiCar-X has a built-in speaker that can be used for audio experiments. Ezblock allows users to enter text to make the PiCar-X speak, or make specific sound effects. In this tutorial, the PiCar-X will make the sound of a gun firing after a 3-second countdown, using a do/while function.
TIPS

Use the say block with a text block to write a sentence for the PiCar-X to say. The say block can be used with text or numbers.

The number block.

Using the repeat block will repeatedly execute the same statement, which reduces the size of the code.

The mathematical operation block can perform typical mathematical functions, such as ”+”, “-”, “x”, and “÷ “.

The play sound effects - with volume - % block has preset sound effects, such as a siren sound, a gun sound, and others. The range of the volume can be set from 0 to 100.
EXAMPLE
Note
You can write the program according to the following picture, please refer to the tutorial: How to Create a New Project?.
Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly.
