Skip to main content

Welcome to AudioLink

In simple terms, AudioLink gives you a simple API to manage Roblox's Audio API.

warning

AudioLink is in a pre-alpha state. It is not yet ready for production. Use at your own risk!


Core Concepts​

AudioLink revolves around Channels and Members. When a player (or audio source) joins a channel, their voice data is automatically routed to all other eligible members in that channel.

  • BaseChannel: The foundation of all channels. Handles internal channel functionality. Should not be used unless you're creating a custom channel type.
  • ProximityChannel: A 3D spatial voice channel that uses AudioEmitter and AudioListener instances to attenuate sound based on distance. This can be used to recreate roblox's default voice chat.
  • DirectChannel: A global, non-spatial voice channel where everyone can hear everyone else at a constant volume. Useful for FPS games, voice call systems, walkie talkies, etc.

Channel Joining and who each player/member can hear/speak to is fully server-authoritative.


Quick Start​

Getting started is incredibly simple.

1. Disable Default Voice​

If you are planning on using AudioLink for anything related to voice chat, You'll want to set VoiceChatService.UseDefaultVoice 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.

2. 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",
Priority = 1
})

-- Add players to the channel as they join
game.Players.PlayerAdded:Connect(function(player)
lobbyChannel:AddPlayer(player)
end)

3. Client Initialization​

-- That's it for the client, just require it and it works!
local AudioLink = require(path.to.AudioLink.Client)