Enable the Audio API in three steps
The Audio API in Roblox Studio lets you create, play, and control sound programmatically — meaning you can trigger sounds from scripts instead of placing them manually in the workspace. To use it, you need to turn on a beta feature in Studio settings.
Open Roblox Studio and go to File > Settings. In the left sidebar, click Beta Features. Find Enable AudioAPI in the list and toggle it on. Close and reopen Studio for the change to take effect.
Once enabled, you can access audio functions through scripts using the Sound class and related methods. The API works in both LocalScripts and server-side Scripts, though the context matters for what players hear.
Key Takeaways
- The Audio API is a beta feature that must be enabled in Studio settings under Beta Features.
- After enabling it, you restart Studio before the API becomes available to your scripts.
- You control sounds through the Sound class in scripts, not by placing Sound objects in the workspace.
- LocalScripts in the client hear sounds differently than server-side scripts, so placement and script type affect what players experience.
Where to find the Audio API toggle
The Audio API toggle lives in Studio's beta features section because it is still under development. Roblox adds features here while testing them with developers before making them standard.
To reach it: open any place in Studio, then click File in the top menu. Select Settings from the dropdown. The Settings window opens as a separate panel. On the left side, you will see a list of categories — click Beta Features. Scroll through the list until you see Enable AudioAPI, then click the toggle switch next to it to turn it on.
The toggle switches to blue when active. Close the Settings window and fully close Studio (not just the place). When you reopen Studio and load a place, the Audio API is ready to use in scripts.
What the Audio API lets you do
With the Audio API enabled, you can create sounds entirely through code. Instead of dragging a Sound object into the workspace, you write a script that generates a sound, sets its properties, and plays it — all without manual setup in the explorer.
Common tasks include playing a sound when a player touches a part, looping background music, adjusting volume based on distance, stopping a sound after a certain time, or triggering different sounds based on game events. You can also read properties like whether a sound is currently playing or how far through it you are.
The API is particularly useful for dynamic audio — situations where you do not know in advance which sounds you need or when they will play. For static sounds that always play in the same place, placing a Sound object in the workspace is often simpler.
LocalScripts versus server scripts and audio
Where you put your audio script matters. A LocalScript in the player's character or in StarterPlayer runs only on that player's device, so only that player hears the sound. A script in ServerScriptService runs on the server, and the sound plays for all players near the sound's location.
If you want a sound to play only for one player — like a UI sound when they click a button — use a LocalScript. If you want all players in the game to hear a sound — like an explosion or a door opening — use a server-side script. The Audio API works the same way in both, but the audience changes.
Keep in mind that server-side sounds use the 3D audio system, meaning volume decreases with distance. Client-side sounds in a LocalScript do not have distance falloff unless you code it yourself.
Common setup for your first audio script
Once the Audio API is enabled, create a new LocalScript in StarterPlayer > StarterCharacterScripts. This script runs when a player's character loads. At the top of the script, you can create a sound object and set its basic properties:
Type: local sound = Instance.new("Sound") to create a new sound. Then set the parent so it exists in the game world: sound.Parent = script.Parent. Set the SoundId to an audio file: sound.SoundId = "rbxassetid://[ID_NUMBER]". Replace [ID_NUMBER] with the actual ID of a sound from the Roblox catalog. Finally, play it: sound:Play().
You can find sound IDs by searching the Roblox catalog or by copying the ID from a sound you have already placed in the workspace. Test your script by running the game — if the Audio API is enabled, the sound should play when your character spawns.
Troubleshooting if audio does not play
If you enable the Audio API but sounds do not play, check three things first. Verify that you restarted Studio after toggling the feature on — the change does not take effect until you close and reopen the application. Check that your SoundId is correct by testing it on a Sound object placed in the workspace; if it does not work there, the ID is invalid. Make sure your script is actually running by adding a print statement before the sound plays — if the print does not appear in the output, the script itself is not executing.
Also confirm that your game's audio is not muted in Studio. In the top toolbar, look for a speaker icon — if it has a line through it, click it to unmute. If you are testing in a LocalScript, remember that only your client hears the sound, so other players in the game will not hear it even if it works for you.
When to use the Audio API versus placing sounds manually
Use the Audio API when you need sounds to respond to game logic — a sound that plays only under certain conditions, a sound that changes based on player actions, or a sound that you generate at runtime. It is also cleaner for games with many sounds, since you manage them all in code rather than cluttering the workspace.
Place Sound objects manually in the workspace when you have a fixed set of sounds that always play in the same locations, like ambient music in a specific area or a door opening sound attached to a door part. Manual placement is faster for simple cases and does not require scripting knowledge.
Many games use both approaches: manual sounds for static audio and the Audio API for dynamic audio triggered by gameplay.
Frequently Asked Questions
Do I need the Audio API enabled to use sounds in Roblox Studio at all?
No. You can place Sound objects directly in the workspace and play them without enabling the Audio API. The API is only necessary if you want to create and control sounds through scripts. If you only use the Sound object from the Insert menu, you do not need to enable it.
Will my game break if I disable the Audio API after using it?
Any scripts that use the Audio API will stop working if you disable the feature. Sounds created through code will not play. If you have manually placed Sound objects in the workspace, those will continue to work. Before disabling the API, convert any critical audio to manual Sound objects or accept that those sounds will not play.
Can I use the Audio API in published games?
Yes, once you publish a game to Roblox, the Audio API works for all players. The beta feature toggle only affects Studio — it does not prevent published games from using the API. Your scripts will function normally when players join your game.
What sound file formats does the Audio API support?
The Audio API uses Roblox sound IDs, not direct file uploads. You upload audio files to Roblox through the Creator Dashboard, which converts them to sound IDs. The platform supports MP3, WAV, and OGG formats. You then reference the sound ID in your script using the SoundId property.
Can I play multiple sounds at the same time with the Audio API?
Yes. Create multiple Sound objects in your script, each with its own SoundId and parent. Call :Play() on each one, and they will play simultaneously. You can also adjust their volumes independently or stop them individually using :Stop() or :Pause().