Audio
Insert an audio file and add all kinds of actions related to audio: auto play in the background, create a custom player, trigger an action at a specific time, synchronize your audio to another component, etc.
Insert an audio file
To insert an audio file, import it in the Media window. Here is the list of accepted formats: .MP3; .WAV; .WMA; .AAC; .M4A.
To add it into your app, you can add it directly or insert an Audio component and choose this file as source.
Insert an Audio component and add an audio file in Source. You can also add an audio file directly in your screen: an Audio component is automatically created.
💡 To keep your audio file throughout the application (background audio), insert your Audio component at the Project level.
The audio component is a non-graphical component
You can create a custom player using the synchronization and the Scrolling Area component. Learn more: Create audio player with progress bar.
Component characteristics
Properties
- Autoplay: when the screen/status is displayed, the audio file starts automatically
- Loop: at the end of the track, the audio starts again
- Auto stop when playing new sound
- Start: set the start of your audio to create a specific track. The unit is seconds.
- End: set the end of your audio to create a specific track. The unit is seconds.
- Volume: choose the default volume (1 being the initial volume of the audio) and the volume range as part of a sync.
- Rate: choose the default rate (1 being the initial rate of the audio) and the rate range within a sync.
💡 If you have a single audio file that you want to split into several tracks, instead of splitting it into several files via an external software, reuse your file several times and each time set the beginning and end of the track.
Data binding
You can bind the Source property to a data source to dynamically change the audio file being played. This allows you to update the audio content based on data from databases, APIs, or user interactions without manually selecting a new file.
To bind the audio source:
- Select the Audio component
- In the Properties panel, locate the Source property
- Tap/Click the binding icon next to Source
- Choose your data source and map it to an audio field
The bound data should point to a valid audio file URL or resource identifier.
Exposed properties
The Audio component exposes the following data that can be bound to other components:
- Current value: The current playback time in seconds (e.g., 15.5 for 15.5 seconds elapsed)
- Duration: The total duration of the audio file in seconds
- Is playing: Boolean indicating whether the audio is currently playing (true) or not (false)
These properties are useful for creating custom audio players with progress bars, time displays, or play/pause buttons that reflect the actual playback state.
Triggers
Select your audio and add an action. Here is the list of available triggers:
- Starting play
- Pause playing
- Stopping play
- Finish playing
Actions
Select a trigger and choose the Interact with a component > Audio.
Here are the actions of the Audio component:
- Play/Pause
- Play
- Pause
- Stop
- Forward
- Rewind
- Restart from beginning
- Set volume
- Increase volume
- Decrease volume
- Set rate
- Increase rate
- Decrease rate
Create markers of time
To trigger an action at a specific time, create markers to define times on your audio file for which you want to associate particular actions.
Enter the Audio component and create markers. Use the audio player to browse the audio and select the time to mark.
Once your markers are created, they become available in the list of triggers.
⚠️ Beware that many web browsers (Firefox, Chrome) block autoplay audio files when they start without user interaction. Learn more: Autoplay Blocking in Web Browser
Synchronize audio with another component
Synchronize your audio with any other component (Timer, Audio, Gallery…). You can synchronize:
- Time
- Volume
- Rate
- Markers
Define these parameters from the properties of the Synchronization component.
Silent mode on iOS
On iOS devices (iPhone/iPad), the physical silent switch (located on the side of the device) can prevent sound from playing, unless you enabled the Audio background option.
Background audio
In the Project Properties, you can enable the Background Audio option to allow audio to continue playing even when the user temporarily leaves the app (on mobile) or navigates between different scenes.
This is useful for maintaining background music or continuous audio in a music app, audio guide, or podcast.