SoundData:getSample

Returns a single sample from the SoundData. Sample indices start at 0, and the returned value will be between -1 and 1.

value = SoundData:getSample(index)

Arguments

NameTypeDescription
indexnumberThe index of the sample to get.

Returns

NameTypeDescription
valuenumberA number indicating the value of the sample at the given index.

Notes

Note that samples for individual channels in stereo sounds are stored next to each other.

See also