voicechat. sendaudiopackets Asynchronous
Generate a sine tone and submit a burst of 10 ms audio frames through the active voice sender. Use this to test an audible frequency without preparing a file.
Luau
voicechat.sendaudiopackets(
sample_frequency: number,
packet_count: number,
amplitude: number?
) -> numberParameters
| Parameter | Type | Description |
|---|---|---|
sample_frequency | number | Tone frequency from 1 through 3900 Hz. |
packet_count | number | Positive integer count of 10 ms frames, stored as an unsigned 32-bit value. |
amplitude | number? | Optional level above zero through 1; defaults to 0.25. |
Returns
numberThe number of frames queued.
Usage notes
The burst is submitted at the next valid processed voice frame. All requested frames are submitted together; the call returns before encoding or transmission.
The count storage limit comes from Kawaii, not Roblox. Very large bursts can stall the outgoing audio callback. stop() or a new tone request can interrupt a burst.
The current voice session must be active and Roblox must allow publishing. Extra packets may be dropped or paced by WebRTC or remote receivers.
Example
Luau
voicechat.sendaudiopackets(440, 20, 0.2) -- Twenty 10 ms frames in one burst
print(voicechat.getstatus().tonepacketsremaining)