Skip to content

Api > AudioSource > GetOutputData()


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:⚓︎

Name Type Description
length number The length of the samples to be returned. Length must be a power of 2.
channel number The channel to sample from.

Returns:⚓︎

type Description
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)