Skip to main content

7.2 Peripheral Function Control

Learn how to use Generators to play audio files and control playback through events

BRICKS TOOLS avatar
Written by BRICKS TOOLS
Updated over a week ago

Welcome to BRICKS.
This tutorial covers the second step in working with Generators: peripheral function control. By completing this chapter, you will easily master the fundamental use of Generators in the BRICKS Cloud Intelligent Display.


πŸ• Estimated time to complete this tutorial: 5–8 minutes

  • Step 1: Create a New Media Box

    In this lesson, we will insert two audio files related to the countdown and use events to trigger playback through Generators. First, create a new Media Box to store the audio files. From the APPLICATION page, click [ ← ] at the top-left to return, then select the [ MEDIA ] tab. Next, click [ New Box ] at the bottom-left corner to create a new Media Box.

    Create New Media box


    Name the new Media Box SoundBox, and click [ New Box ] again to confirm.

    Create New Media Box

  • Step 2: Upload Two Audio Files

    Search online for a ticking sound for the countdown and a bell sound for when the countdown ends. After creating the SoundBox Media Box, select [ Upload ] to add the audio files.

    Click Upload icon to upload meida


    Choose the files from your device and upload them into the Media Box.

    Browse files to upload
    Upload file to Media box

  • Step 3: Create Two Sound Playback Generators

    Generators also support audio playback. Create two new Generators, and in the Template field, select [ SoundPlayer ] to enable audio playback.

    Create new sound-layer generator


    For each Generator, go to the property panel on the left, locate the File Path field, and click the [ 🎧 ] icon to open the Media Box.

    Setting Generator Sound Player File Path


    Select the SoundBox you created earlier and assign the corresponding audio files. Make sure both SoundPlayer Generators are set up with the correct audio files.

    Select Media Asset

  • Step 4: Create Events to Trigger Sound Playback

    Find the countdown text element created in the previous lesson. In the property panel on the right, locate the event settings and select Before Value Change and On Press to trigger the countdown ticking sound and the countdown completion sound, respectively. The Before Value Change event is triggered when the text content changes. Since the countdown Generator updates the text Brick through a variable, the text automatically changes according to the countdown and fires the event.

    Setting Before Value Change & OnPress Event


    Use this event to trigger the ticking sound.

    Setting Sound Generator


    For the On Press event, configure it to play the other audio file for the countdown completion sound.

    Setting Sound player play event

  • Step 5: Preview on Device

    Save the application and preview it on a device. Check whether the ticking sound plays correctly during the countdown and whether tapping the text correctly triggers the completion sound. Don’t forget to turn on the device volume.

  • Congratulations! You have now learned the basic concepts of peripheral function control.


The next lesson will introduce the Event Flow Controller.

For any assistance, please click the chat icon in the bottom-right corner. Our team will respond to your questions as quickly as possible.

Did this answer your question?