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.
Luau
voicechat.play(path: string, legacyMode: string?) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Workspace-relative audio file path. |
legacyMode | string? | 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
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