Sound:getFrames

Edit

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





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.

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.

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.

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