voicechat.play Asynchronous

Start loading a workspace audio file and mix its playback into the current voice capture path. The call returns while decoding continues, so inspect getstatus for progress or an error.

Syntax
Luau
voicechat.play(path: string, legacyMode: string?) -> ()

Parameters

Function parameters
ParameterTypeDescription
pathstringWorkspace-relative audio file path.
legacyModestring?Optional compatibility string; when supplied it must be capture.

Returns

()

No values.

Usage notes

The path must be a nonempty workspace-relative string. Explicit nil in the second slot is rejected.

Requires the voice capture integration to be available in an active game session.

Example

Example
Luau
local path = "audio/intro.mp3" -- Supply this file in the workspace.
if voicechat.getstatus().available and isfile(path) then
    voicechat.play(path)
    print("Loading:", voicechat.getstatus().state)
end
Kawaii documentation