Extension activity 2: Adding sound asset to the app
Last updated
Was this helpful?
Last updated
Was this helpful?
For an additional enhancement, let's integrate a sound asset into the app. Follow these straightforward steps to incorporate a sound file along with the button component.
Navigate to the left panel (Panel 1) and click on the Media
tab. Drag and drop the Sound
component onto the screen. Note that the sound component is non-visible, so you won't see any changes on the screen.
Upload a WAV sound file, similar to how you uploaded the image file.
Locate the sound file (
switch-1.wav
) within the Media folder.
Click on Sound1
in the Components
tree. From the Properties
panel, select the uploaded sound file as the Source
.
Switch to the Blocks
tab and click on Sound1
. Drag the call Sound1.Play
block.
Move the Play
block inside both the if
and else
parts of the existing code. The final code should resemble the image below:
All done!!!