The Audio API is off by default — turn it on in Studio settings
The Audio API in Roblox Studio lets you write code that controls sound playback, volume, and effects in your game. It is disabled by default, which means your scripts cannot access these audio functions until you enable it. You turn it on through the Studio settings menu in about one minute.
Once enabled, the Audio API gives your Lua scripts access to classes like Sound, SoundGroup, and audio effects. This matters if you want to play music when a player enters a zone, adjust volume based on distance, or mute sound during cutscenes — anything beyond placing a sound object and letting it play on loop.
Key Takeaways
- Open File > Settings, then find the Audio API toggle under the Lua Globals section and turn it on.
- After enabling it, restart Studio or reload your place for the change to take effect.
- The Audio API is a beta feature, so Roblox may change how it works in future updates.
- Your scripts can now use Sound objects and audio methods like Play(), Stop(), and SetVolume() without errors.
- Players do not need to enable anything on their end — the setting only affects what you can do while building.
Step-by-step: enabling the Audio API
Start with Roblox Studio open and your place loaded. Click File in the top menu bar, then select Settings from the dropdown.
The Settings window opens. On the left side, you will see a list of categories. Click Lua Globals. In the main panel on the right, scroll down until you find AudioApi. The toggle next to it will be off (grayed out). Click it to turn it on.
Close the Settings window. Roblox recommends restarting Studio or reloading your place to make sure the change takes effect. You can reload by pressing Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac), or by closing and reopening the place file.
What you can do once the Audio API is enabled
With the Audio API on, your scripts can create and control Sound objects without errors. You can write code that plays a sound when a player touches a part, stops music when they leave a region, or adjusts volume based on how far away they are from the sound source.
Common tasks include calling Sound:Play() to start playback, Sound:Stop() to halt it, and Sound:SetVolume() to change how loud it is. You can also use SoundGroup to control multiple sounds at once — for example, muting all ambient sounds while dialogue plays.
The API also supports audio effects like reverb and compression, though those are more advanced. Start with basic playback and volume control, then explore effects once you are comfortable with the fundamentals.
Common mistakes when using the Audio API
The most frequent error is forgetting to enable the API before writing audio code. If your script references a Sound object and Studio shows an error about an unknown global or method, check that the Audio API toggle is actually on — it is straightforward to miss in the settings menu.
Another mistake is trying to use audio methods on objects that are not Sound instances. The Audio API only works on Sound objects and SoundGroup objects. If you try to call Play() on a Part or a Humanoid, your script will fail.
Also remember that the Audio API is still in beta. Roblox occasionally changes how it works or adds new features. If your code stops working after a Studio update, check the Roblox developer documentation to see if the syntax changed.
Testing your audio code in Studio
After enabling the API, you can test audio playback right in the Studio editor. Create a Sound object inside a Part, write a script that calls Play() on it, and run the game in Studio using the Play button. You should hear the sound play when the condition in your script is met.
Use the Output window (View > Output) to check for errors. If your audio code has a problem, the error message will appear there. Common messages include "attempt to call a nil value" (usually meaning the Audio API is still off) or "attempt to index nil with 'Play'" (meaning the Sound object does not exist where your script is looking for it).
Audio API vs. the older sound system
Before the Audio API, Roblox games used Sound objects placed directly in the workspace or in parts, and they played automatically or when triggered by straightforward events. That system still works, but it gives you less control — you cannot easily adjust volume mid-playback or layer multiple sounds together.
The Audio API is the newer, more flexible approach. It lets you write code that treats sound like any other game element: create it, modify it, and destroy it as needed. If you are starting a new project and want fine-grained audio control, use the Audio API. If you are working on an older game, the old system may be sufficient.
Frequently Asked Questions
Do players need to enable the Audio API to hear sound in my game?
No. The Audio API setting only affects what you can do in Studio while building. Once your game is published, all players hear the audio you created — they do not need to change any settings.
Will my game break if Roblox changes the Audio API?
Possibly, but Roblox usually gives developers notice before making breaking changes to beta features. Check the developer documentation and the Roblox blog regularly if you use the Audio API heavily. For now, it is stable enough for most games.
Can I use the Audio API in LocalScripts and ServerScripts?
Yes, but audio playback works best in LocalScripts because sound is heard by individual players. A ServerScript can create and control Sound objects, but each player hears it based on their own client, so use LocalScripts for most audio work.
What if the Audio API toggle is grayed out and I cannot click it?
Make sure you are running the latest version of Roblox Studio. If it is up to date and the toggle is still grayed out, try restarting Studio completely. If it remains grayed out, the feature may not be available in your region or account type — check the Roblox developer forum for your specific situation.