Sound:getFrames

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


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

Arguments

NameTypeDefaultDescription
countnumbernil The 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.
srcOffsetnumber0 A frame offset to apply to the sound when reading frames.

Returns

NameTypeDescription
ttable A table containing audio frames.
countnumber The number of frames read.

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

Arguments

NameTypeDefaultDescription
ttable An existing table to read frames into.
countnumbernil The 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.
srcOffsetnumber0 A frame offset to apply to the sound when reading frames.
dstOffsetnumber0 An offset to apply to the destination when writing frames (indices for tables, bytes for Blobs, frames for Sounds).

Returns

NameTypeDescription
ttable A table containing audio frames.
countnumber The number of frames read.

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

Arguments

NameTypeDefaultDescription
blobBlob A Blob to read frames into.
countnumbernil The 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.
srcOffsetnumber0 A frame offset to apply to the sound when reading frames.
dstOffsetnumber0 An offset to apply to the destination when writing frames (indices for tables, bytes for Blobs, frames for Sounds).

Returns

NameTypeDescription
countnumber The number of frames read.

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

Arguments

NameTypeDefaultDescription
soundSound Another Sound to copy frames into.
countnumbernil The 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.
srcOffsetnumber0 A frame offset to apply to the sound when reading frames.
dstOffsetnumber0 An offset to apply to the destination when writing frames (indices for tables, bytes for Blobs, frames for Sounds).

Returns

NameTypeDescription
countnumber The number of frames read.

See also