Two years in the making, multiple iterations, AudioLink is finally out.
Warning: AudioLink is currently in a Pre-Alpha state. It is under active development and not yet intended for production environments. Use at your own risk.
What is AudioLink?
AudioLink is a framework designed to simplify working with Roblox’s new AudioAPI (well, new when I started my first iteration of this framework in 2024
).
AudioLink provides a very simple API for creating channels, and inviting members to these channels. Different channels can work in different ways, for example, the DirectChannel allows for direct communication between its channel members as if they were sitting next to each other. The ProximityChannel is exactly what it’s called: it allows for 3D spatial communication between channel members, just like Roblox’s default voice chat.
Players (and non-entity speakers/listeners) can be placed into multiple channels together. One of the most common usecases of being able to be in multiple channels, is a walkie talkie system. Gone are the days where you had to research the entire audio API to figure out how to get that to work! Now it’s as simple as placing players with walkie talkies equipped into a DirectChannel together, and kicking them out when they unequip them.
Technical Stuff
You can check out the api here: AudioLink
Here’s a graph of how the client-side audiopipeline functions. It may be a bit outdated, but it explains the general idea of how exactly everything gets wired up.
It’s not exactly 1:1 with how the system currently works, but it’s very close.
Server Authority
AudioLink’s client never needs to send any data to the server (besides replica requesting the initial data fire). The client only ever reacts to changes initiated by the server, and sets up wiring to the designated channel members in response.
Additionally, AudioLink automatically generates controls whose voice replicates to who (via AudioDeviceInput:SetUserIdAccessList(userIds)). This means audio stream replication is entirely cut off unless the players are in a mutual channel. Therefore, exploiters can’t listen to players in channels they don’t have access to (unlike vanilla voice chat).
Under the hood, Replica is used for replication. AudioLink is setup in a way that the server only replicates channels that the local player is currently in. if a player is not in a channel, or has been removed from a channel, replication is cut off. This prevents exploiters from reading who is in what channel.
These functionalities may not sound important, but for competitive games, exploiters could gain competitive advantages from knowing what channels exist and who is in them, and also being able to directly listen to players who they should not be able to hear.
Addon API
AudioLink has extensive addon support (it has an official API, but it’s also very hackable). Right off the bat, there are three addons builtin:
- DefaultChannelAddon - Because AudioLink disables the default player proximity voice chat, this addon sets up a proximity channel and automatically puts every player into it, to imitate default voice chat.
- SpeakingState - This addon just prints whenever players start or stop speaking. This can be built on to make live voice chat indicators commonly seen in major voice chat games.
- WarnIfEnableDefaultVoice - This addon just prints a warning into the console if it detects signs of
VoiceChatService.EnableDefaultVoicebeing active. I didn’t feel the need to hardcode this warning, so I made it as an easily removable addon.
Getting Started
mirrored from the docs: Introduction | AudioLink
Getting started is incredibly simple.
1. Download Source
You can either clone the Github repo or grab this rbxmx and throw it into ReplicatedStorage. The entire codebase, both server and client, are bundled together for simplicity sake.
Download from Github: GitHub - Nazuh2/audiolink · GitHub
Direct Download: audiolink.rbxmx (258.2 KB)
2. Disable Default Voice
If you are planning on using AudioLink for anything related to voice chat, You’ll want to set VoiceChatService.EnableDefaultVoice to false. AudioLink may not work correctly with this enabled, and you’ll see a warning in the console telling you to disable this property at runtime.
3. Server Initialization
On the server, simply require the Server module. This will automatically set up the Replica-based network and bind AudioDeviceInput instances to players as they join.
-- AudioLink will initialize automatically on require.
local AudioLink = require(path.to.AudioLink.Server)
-- Create a global channel for your lobby
local lobbyChannel = AudioLink.Channels.DirectChannel.new({
Id = "LobbyChannel",
-- In the case a player is in multiple mutual channels with another player
-- the channel with the highest priority will be the one used for communication
-- between those two players.
Priority = 1
})
-- Add players to the channel as they join
game.Players.PlayerAdded:Connect(function(player)
lobbyChannel:AddPlayer(player)
end)
4. Client Initialization
-- That's it for the client, just require it and it works!
local AudioLink = require(path.to.AudioLink.Client)
–
Roadmap
- Release Free Walkie Talkie addon
- Release Channel Effect addon (allows for applying audio effects like reverb, channel-wide)
- Release Local Effect addon (allows for changing how the local player hears other players)
- Release Player-specific effects addon (addon that allows applying certain audio effects to a single player)
- Release PTT/Toggle mic addon
- Release Audio Settings addon - This addon will introduce a gui that allows you to change player specific audio volume, ptt controls, and much more.
