# Audio

## Overview

The **Audio module** provides a way for a content author to embed a sound effect or background audio in the page. The sounds embedded with the **Audio module** must, unless they autoplay, be played via the flow controller nodes.

## Audio Properties

### **Details** (required)

*Asset, defaults to a whooshing sound effect*

Allows the selection of an audio file from the asset manager this is the asset that will be played by the module.

### **Loops**

*Checkbox, default `disabled`*

If enabled, shows the audio will loop back to the beginning after it reaches the end of the audio.

### **Autoplay**

*Checkbox, default `disabled`*

If enabled, attempts to play the audio immediate when the module loads

{% hint style="warning" %}
[Browser limitations](https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide) may block autoplay when a user first visits your page. A play button will appear if autoplay is blocked, requiring the user to click to begin playback. For a workaround, see Force Autoplay.
{% endhint %}

## Broadcasters

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2Fpzyj42ZQgXUOGI2vnfzv%2FScreenshot%202024-04-16%20at%208.11.56%E2%80%AFAM.png?alt=media&#x26;token=22de3a5b-17ac-4294-8459-45dd326d58bc" alt=""><figcaption><p>On Timestamp Update Broadcast Node</p></figcaption></figure>

### On Timestamp Update

Fires when the audio playback advances to a new timestamp.

| Output    | Description                                     | Type   |
| --------- | ----------------------------------------------- | ------ |
| timestamp | The current timestamp of the audio in seconds   | number |
| duration  | The total duration of the audio file in seconds | number |

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2FCkPcgFT0qsdDEfXxGNS7%2Fimage.png?alt=media&#x26;token=9ef64925-1a4f-4000-aabd-637af30fc662" alt=""><figcaption><p>On Complete Broadcast Node</p></figcaption></figure>

### **On Complete**

Fires when the audio has played through to the end. Does not trigger for looping audio.

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2FJo1BXPKDkTIPnEkIedoc%2Fimage.png?alt=media&#x26;token=4e5a3448-8e4d-41d0-941b-640d196c5586" alt=""><figcaption><p>On Pause Broadcast Node</p></figcaption></figure>

### **On Pause**

Fires when audio playback has been paused.

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2Ftwu5HsFXlbILYmB3me7G%2Fimage.png?alt=media&#x26;token=16a05afe-5a09-48f2-9497-a6f83ee79fed" alt=""><figcaption><p>On Play Broadcast Node</p></figcaption></figure>

### On Play

Fires when audio playback has started or resumed.

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2FxjyL3jwfuY9SeSKUnzqz%2Fimage.png?alt=media&#x26;token=838e1e2b-79ac-41eb-a0c3-42ad761af5fc" alt=""><figcaption><p>On Start Broadcast Node</p></figcaption></figure>

### **On Start**

Fires when audio playback starts. Does not fire when a paused audio file is resumed.

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2F7KRbFBAm3kEbHpfGEaiM%2Fimage.png?alt=media&#x26;token=11127105-f00a-4de8-9837-4e1f0a269324" alt=""><figcaption><p>On Unmute Broadcast Node</p></figcaption></figure>

### **On Unmute**

Fires when audio playback volume has been unmuted.

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2FL4OPouxFOaRcHQXCzrFF%2Fimage.png?alt=media&#x26;token=6d59d942-57ff-40da-806a-b08f82ca078e" alt=""><figcaption><p>On Mute Broadcast Node</p></figcaption></figure>

### **On Mute**

Fires when the audio playback volume has been set to zero.

***

## Listeners

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2FLO8gNPTLwy9Eo0OoMzbW%2Fimage.png?alt=media&#x26;token=7542ab9f-9ddf-4a1c-809d-28e843174036" alt=""><figcaption><p>Mute Listener Node</p></figcaption></figure>

### **Mute**

When triggered, sets the audio playback volume to the zero.

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2FniFbiFPba3GUSubyIlf2%2Fimage.png?alt=media&#x26;token=ec38d684-d14e-44ff-ab77-6fba3b327dee" alt=""><figcaption><p>Pause Listener Node</p></figcaption></figure>

### **Pause**

When triggered, pauses audio playback.

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2FGEMRSy7Wv8dqesFmdS6K%2Fimage.png?alt=media&#x26;token=a7cea444-7574-4216-893e-c72dc5340060" alt=""><figcaption><p>Play Listener Node</p></figcaption></figure>

### **Play**

When triggered, starts audio playback.

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2F8d1UxORZSoT58CUqB6P3%2Fimage.png?alt=media&#x26;token=bf552a45-ffc9-4562-b1fa-ab227449e3e5" alt=""><figcaption><p>Unmute Listener Node</p></figcaption></figure>

### **Unmute**

When triggered, sets the audio playback volume to the previous level.

***

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2FV1AtLEyadO7sUwhSgs9C%2Fimage.png?alt=media&#x26;token=96f7dd6c-a4b5-46a6-b319-b1cef03a486a" alt=""><figcaption></figcaption></figure>

### Set Source

When triggered, sets the current source of the audio module to the specified URL.

| Input      | Description                       | Type   |
| ---------- | --------------------------------- | ------ |
| Source URL | The URL of the source audio file. | string |
