Component reference
Files components

Audio component

9min

Description

The Audio component allows you to add audio sources to entities within your scene. By default, audio is spatialized, meaning it emanates from a specific location in the scene and changes volume based on the listener's position.

When you add the Audio component to an entity, it includes two components:

  • Positional Audio: Controls how the audio behaves in the spatial environment.
  • Media: Configures the media source file settings and playback options.
Document image



Positional Audio component

The Positional Audio component determines how the audio is spatialized within the 3D environment. It controls how the sound diminishes over distance and how it is emitted directionally.

⚠️ Combination with the Media component

The Positional Audio settings are ignored if Is Music is enabled in the Media component.

Properties

Property

Description

Distance Model

Determines how the audio volume decreases over distance. Options include: Linear, Inverse, and Exponential.

Rolloff Factor

Adjusts the rate at which the audio volume decreases according to the selected distance model. A higher value results in a steeper decrease in volume over distance.

Max Distance

*Only supported with Linear Distance Model. The maximum distance (in meters) at which the audio can be heard. Beyond this distance, the audio is silent.

Cone Inner Angle

The angle (in degrees) of the inner cone in which the audio is at full volume. This defines the area directly in front of the audio source where the sound is loudest.

Cone Outer Angle

The angle (in degrees) of the outer cone where the audio begins to decrease in volume. Outside this angle, the sound diminishes according to the Cone Outer Gain.

Cone Outer Gain

A value between 0.0 and 1.0 that determines the volume of the audio outside the outer cone. A value of 0.0 means the audio is silent outside the cone, and 1.0 means no decrease in volume.

Usage notes

  • Directional audio: Use the cone properties to simulate sound emitting directionally from the source, like a spotlight for sound.
  • Distance attenuation: Adjust the Distance Model, Rolloff Factor, and Max Distance to control how sound fades with distance.
  • Orientation: The entity's forward direction determines where the cone is aimed. Ensure the entity is rotated correctly.


Media component

The Media component manages the audio source file, playback options, and synchronization settings.

Properties

Property

Description

Volume

Sets the playback volume of the audio, ranging from 0 (silent) to 100 (full volume).

Start Time

The time (in minutes) from which the audio should start playing.

Is Music

When enabled, the audio plays uniformly throughout the scene, ignoring positional audio settings. The sound is not spatialized and is heard equally everywhere. Note: When Is Music is enabled, your guests can independently control the audio volume of the entity across the scene; they can manage volume via their Settings menu inside a Location.

Controls

Displays playback controls (e.g., play, pause, stop) in the scene, allowing users to interact with the audio.

Autoplay

When enabled, the audio starts playing automatically when the scene loads.

Synchronize

Synchronizes audio playback across all users in the scene. All users hear the audio at the same playback position.

Source Path

Specifies the audio file(s) to play. Depending on the Play mode, you can provide a single file or a list of files. Options include:

  • Single: Plays a single specified audio file.
  • Random: Randomly selects and plays an audio file from your multiple source paths.
  • Sequential: Plays multiple audio files from your source paths in a specified order.

Usage notes

  • Background music: Enable Is Music to play non-spatialized audio, ideal for background music that doesn't change based on the listener's position.
  • User interaction: Enable Controls to allow users to play, pause, or stop the audio manually.
  • Automatic playback: Use Autoplay to start the audio without user intervention when the scene loads.
  • Shared experience: Enable Synchronize to ensure all users hear the audio simultaneously, useful for events or guided experiences.

Important details

  • Interaction with Positional Audio: If Is Music is unchecked, the audio will be spatialized according to the Positional Audio settings.