Content Creators
Audio streaming

Audio streaming

You can stream audio from a URL. This is useful to play music directly from an internet radio, or stream a conference into your scene.

The audio in the source must be in one of the following formats: .mp3, ogg, or aac. The source must also be an https URL (http URLs aren’t supported), and the source should have CORS policies (Cross Origin Resource Sharing) that permit externally accessing it. If this is not the case, you might need to set up a server to act as a proxy and expose the stream in a valid way.

šŸ“” Note: To instead play a pre-recorded sound in your scene, see Sounds .

To add an audio stream into your scene, simply add an AudioStream component to an entity:

const streamEntity = engine.addEntity()

AudioStream.create(streamEntity, {
  url: '',
  playing: true,
  volume: 0.8,
šŸ“” Note: The streamed sound isn’t positional, it will be heard at a consistent volume throughout your entire scene. If a player steps out of the scene, they will not hear the streaming at all.

Set the volume of the AudioStream component by changing its volume property.

Switch the AudioStream component on or off by setting its playing property to true or false.

šŸ“” Note: Not all streaming services allow you to play their audio outside their site. The following are some examples that work in Decentraland:

RAVE = ā€˜ā€™ << not working
DELTA = ā€˜ā€™
GRAFFITI = ā€˜ā€™
SIGNS = ā€˜ā€™ << not working
JAZZ = ā€˜ā€™ << not working