SoundData:slice

Available since LÖVE 12.0
This function is not supported in earlier versions.

Creates a new copy of a section of this SoundData.

Function

Synopsis

data = SoundData:slice( start, samplecount )

Arguments

number start
The first sample the given SoundData to copy from.
number samplecount (-1)
The total number of samples to copy to the new SoundData. The default value of -1 copies all samples.

Returns

SoundData data
The new SoundData containing a copy of the specified section of the original SoundData.

Notes

Samples start from zero. If a SoundData has multiple channels, each sample contains data for all channels.

See Also

Other Languages