Sound

The sound component plays a designated sound.

Set Source

There are a few ways you can set a sound source in your app:

  1. Upload a sound to your app. Be careful of the Thunkable 50 MB app size limit

  2. Provide a link to the sound. The link has to end in .mp3, .wav, etc

Volume

You can set a volume for the Sound component between 0 and 100.

Interruption Mode Android

The available options for Android are Duck Others and Do Not Mix.

Duck Others: This is the default option. If this option is set, your sound lowers the volume ("ducks") of audio from other apps while your audio plays.

Do Not Mix: If this option is set, your sound interrupts audio from other apps.

Interruption Mode iOS

The options for iOS are Duck Others, Mix With Others, and Do Not Mix.

Duck Others: If this option is set, your sound lowers the volume ("ducks") of audio from other apps while your selected audio plays.

Mix With Others: This is the default option. If this option is set, your sound is mixed with audio playing in background apps.

Do Not Mix: If this option is set, your selected sound interrupts audio from other apps.

Keep in mind that the outcome depends on the interruption mode set by the other app playing the audio.

Muted

If this switch is set to true, the sound is muted.

Blocks

Events

On Source Loaded

This block will be triggered when the source of a Sound component is loaded. It is recommended to use this block if changing a Sound component's source during app runtime.

If a given audio is already the source of a Sound component, and you use a block to set the same audio as the source of the Sound component, this block will not be triggered. We recommend using an if statement to say that if the audio is already the source of the Sound component, execute the action you would take when the source is loaded.

In the following screenshot, we want this audio to play when the Button is pressed. If this audio is already the source for the Sound component, we play the sound. If not, we set the audio to be the Sound's source. Once the source is loaded, we play the audio.

Ends

This block will be triggered when a sound stops playing.

On Error

This block will be triggered if there is an error with the Sound component.

Functions

Play

Use this block to play the selected sound from the drop-down menu.

Play from

This block plays the selected sound starting from the second you choose.

Play as Effect

Use this block to play the selected sound from the drop-down menu as an effect.

This sound can't be stopped or paused.

Pause

Use this block to pause the selected sound from the drop-down menu.

Resume

Use this block to resume the selected sound from the drop-down menu.

A sound can only be resumed if it has been paused.

Is Playing?

Returns true or false value for whether this sound is playing.

Is buffering?

Returns true or false value for whether this sound is loading.

duration

Returns the total duration of this sound in seconds.

time

Returns the sound's specific time in seconds.

Stop

Use this block to stop the selected sound from the drop-down menu.

Set/Get Source

Set the Sound's source using the drop-down menu or by using a Text block to specify a filename or a URL.

Get the name of the Sound source.

Set/Get Volume

Set the Sound volume to a value between 0 and 100.

Get the Sound volume.

Set/Get Interruption Mode

Set Sound Interruption Mode on Android/iOS to a value between Duck Others, Mix With Others and Do Not Mix.

Get the Interruption Mode on Android.

Get the Interruption Mode on iOS.

Set/Get muted

Mute or unmute the sound by setting the value to True or False.

Get the value (True or False) if the sound is muted.

Last updated