Skip to main content

AudioSource.GetOutputData(number length, number channel)

Provides a block of the currently playing source's output data.
The array given in the samples parameter will be filled with the requested data.

Parameters:

NameTypeDescription
lengthnumberThe length of the samples to be returned. Length must be a power of 2.
channelnumberThe channel to sample from.

Returns:

typeDescription
number[]The array populated with audio samples

Usage

---@type AudioSource
local audiosource;

---@type number
local length;

---@type number
local channel;


local val0 = audiosource.GetOutputData(length, channel)