Skip to content

Api > AudioClip > Create()


AudioClip.Create(string name, number lengthSamples, number channels, number frequency)⚓︎

Creates a user AudioClip with a name and with the given length in samples, channels and frequency.

Parameters:⚓︎

Name Type Description
name string Name of clip.
lengthSamples number Number of sample frames.
channels number Number of channels per frame.
frequency number Sample frequency of clip.

Returns:⚓︎

type Description
AudioClip AudioClip A reference to the created AudioClip.

Usage⚓︎

---@type string
local name;

---@type number
local lengthSamples;

---@type number
local channels;

---@type number
local frequency;


local val0 = AudioClip:Create(name, lengthSamples, channels, frequency)