We use cookies on this site to enhance your user experience

Sep 14 2018, 11:34 AM PST 5 min

While building a game that’s fun and engaging, it’s easy to overlook the importance of music. Music can help create an atmosphere, build suspense, or even bring life to your game’s characters.

Finding and Adding Music to Your Inventory

If you don’t have music of your own, you’re free to visit Roblox’s Audio Library which contains a great deal of music and sound effects. You can also upload your own audio files.

Roblox Audio Library

Inside the Roblox Audio Library, you can preview a file by clicking the small “play” icon.

If you click the item thumbnail, you’ll be taken to the page for that file. From there you can put it in your inventory and even comment on it.

Uploading Your Own Music

On Roblox, uploading audio files comes at a small cost — this accounts for the time it takes us to review every sound file that users upload. We do this to ensure the safety and integrity of our users and Roblox in general.

The cost depends upon the length of the audio file:

Length Cost
0-10 seconds R$ 20
10-30 seconds R$ 35
30 seconds - 2 minutes R$ 70
2 - 7 minutes R$ 350
Note that uploading and/or using music that you don’t own or have rights to is against Roblox's terms of service. Please ensure that you have permission to use any music you upload!

Once the file is in your inventory, you can visit the file’s Configure page by pressing the cog and choosing “Configure” from the drop-down menu. It has many options to help you customize your audio file:

  • Name: Allows you to configure the audio file’s name.
  • Description: A summary of the audio file.
  • Turn comments on/off: Choose whether or not this item is open for comments.
  • Genre: Classify your audio to help people find it.
  • Copying: Choose whether or not your permit other’s to copy this file.

Implementing Music

Music files can be used in places and can make them atmospheric, adding feeling and creating a mood. To add music to your place, do the following:

  • Find a music file (or upload one) to Roblox and get the asset ID (this is the number at the end of the URL).
  • Open Roblox Studio and open (edit) a place.
  • In the Explorer window, right-click Workspace, select Insert Object, and choose Sound.
  • Select the new sound in the tree hierarchy.
  • In the Properties window, for SoundId, enter http://www.roblox.com/asset/?id= plus the asset ID. For example, http://www.roblox.com/asset/?id=130764021.
  • Now insert a LocalScript into StarterGui, then open the script.
  • Delete all existing lines and enter the following code: Sound/Play|Workspace.Sound:Play().
  • Publish the game to Roblox.

Using Preload

In order for a sound file to be played within your place or game, it must first be downloaded to the client and loaded. Depending upon the size of the file, this can take some time. While it is downloading, you won’t be able to play it.

It is therefore recommended that sound files be preloaded so that they are available to play immediately when you want them to. You preload music using the ContentProvider/PreloadAsync|ContentProvider:PreloadAsync() function.

Tags:
  • sound