Sound:getFrames

Reads frames from the Sound into a table, Blob, or another Sound.

t, count = Sound:getFrames(count, srcOffset)

Arguments

NameTypeDefaultDescription
countnumbernilThe number of frames to read. If nil, reads as many frames as possible. Compressed sounds will automatically be decoded. Reading from a stream will ignore the source offset and read the oldest frames.
srcOffsetnumber0A frame offset to apply to the sound when reading frames.

Returns

NameTypeDescription
ttableA table containing audio frames.
countnumberThe number of frames read.

t, count = Sound:getFrames(t, count, srcOffset, dstOffset)

Arguments

NameTypeDefaultDescription
ttableAn existing table to read frames into.
countnumbernilThe number of frames to read. If nil, reads as many frames as possible. Compressed sounds will automatically be decoded. Reading from a stream will ignore the source offset and read the oldest frames.
srcOffsetnumber0A frame offset to apply to the sound when reading frames.
dstOffsetnumber0An offset to apply to the destination when writing frames (indices for tables, bytes for Blobs, frames for Sounds).

Returns

NameTypeDescription
ttableA table containing audio frames.
countnumberThe number of frames read.

count = Sound:getFrames(blob, count, srcOffset, dstOffset)

Arguments

NameTypeDefaultDescription
blobBlobA Blob to read frames into.
countnumbernilThe number of frames to read. If nil, reads as many frames as possible. Compressed sounds will automatically be decoded. Reading from a stream will ignore the source offset and read the oldest frames.
srcOffsetnumber0A frame offset to apply to the sound when reading frames.
dstOffsetnumber0An offset to apply to the destination when writing frames (indices for tables, bytes for Blobs, frames for Sounds).

Returns

NameTypeDescription
countnumberThe number of frames read.

count = Sound:getFrames(sound, count, srcOffset, dstOffset)

Arguments

NameTypeDefaultDescription
soundSoundAnother Sound to copy frames into.
countnumbernilThe number of frames to read. If nil, reads as many frames as possible. Compressed sounds will automatically be decoded. Reading from a stream will ignore the source offset and read the oldest frames.
srcOffsetnumber0A frame offset to apply to the sound when reading frames.
dstOffsetnumber0An offset to apply to the destination when writing frames (indices for tables, bytes for Blobs, frames for Sounds).

Returns

NameTypeDescription
countnumberThe number of frames read.

See also