Add Audio
Introduction
Adding audio to your space is a great way to give your space some emotion. Music and sounds can be attached to an object and anyone near that object can then hear it.
There are four steps to add your music into the space:
- Enable the media plugin
- Find or add an object
- Upload your music file
- Attach a Media Source to the object
Enable the Media plugin
If the Media plugin is not enabled, you will need to enable it first. Go to File -> Manage plugins -> Media, and click "Install".
Find or add an object
Find or create an object in your space to attach the music to. It can be anything, but for this example we will just add a cube by going to Insert -> Shape -> Cube.
Upload your music file
Your music file should be in .mp3
format. Once you have your music file, upload
it by going to File -> Manage storage and selecting
in the top-right. Once it's uploaded, click on it in the file list, and select "Copy URL".
Attach a Media Source to the object
Now that you have the URL to your music copied, find the object you're attaching it to, right click it and select "Properties". Go to the bottom, and select Add a component -> Media Source - From URL. Scroll down again and select Add a component -> Media Destination - Audio as well.
You should now have two new sections in this object's properties, a "Media Source - From URL" and a "Media Destionation - Audio" section. Let's go through each property that we need and modify it:
- Source (URL): This is the URL to the media file to play. You can paste the URL you copied in step 3 into here.
- Loop: To continuously play the audio, make sure this is selected. If you would only like to play the audio once, make sure this is deselected.
- Autoplay: Enable this as well.
- Synchronized: If selected, all users' audio will be synchronized to play at the same time.
- Click to play: If selected, the audio will play when you click on the object.
And under the "Media Destination - Audio" section:
- Full volume radius: This is the distance around the object that it plays at full volume. For this example, set it to 10.
- Silence Radius: This is the distance where the audio can't be heard any more. For this example, set it to 20.
- Visualize: You can turn this on to get a quick visual glance of the audio's radius.
And you're done! Now everything is set up, the audio should begin playing automatically if your avatar is in range. If you don't hear it, you may need to press Play or just refresh the page the first time.