Skip to content

Api > Room > TryCreateOrUpdateChannel()


Room.TryCreateOrUpdateChannel(number channelID, MLAudioChannelPolicy channelPolicy)⚓︎

Create a channel with the given channel policy if it doesn't exist. Otherwise, updates the channel policy. Changes become active not immediately but when the server executes this operation (approximately RTT/2).

Parameters:⚓︎

Name Type Description
channelID number Channel ID range [0 - 255].
channelPolicy MLAudioChannelPolicy Channel policy to be used for this channel.

Returns:⚓︎

type Description
boolean true if operation could be sent to the server, otherwise false, also return false if channel policy is null.

Usage⚓︎

---@type number
local channelID;

---@type MLAudioChannelPolicy
local channelPolicy;


local val0 = Room:TryCreateOrUpdateChannel(channelID, channelPolicy)