AudioStream:read

Edit

Reads data from the AudioStream.




Arguments

NameTypeDefaultDescription
countnumbernil The number of frames to read. When nil, reads all of the data in the stream.

Returns

NameTypeDescription
table{number} A table of audio samples.

Arguments

NameTypeDefaultDescription
countnumbernil The number of frames to read. When nil, reads all of the data in the stream.
soundSound A Sound to write the audio to.
offsetnumber0 An offset to start writing into the destination (frames for Sounds, bytes for Blobs).

Returns

NameTypeDescription
nnumber The number of audio frames that were actually read.

Arguments

NameTypeDefaultDescription
countnumbernil The number of frames to read. When nil, reads all of the data in the stream.
blobBlob A Blob to write the audio to.
offsetnumber0 An offset to start writing into the destination (frames for Sounds, bytes for Blobs).

Returns

NameTypeDescription
nnumber The number of audio frames that were actually read.

Notes

When writing to a Blob or Sound, count is clamped, using the size of the destination and the offset parameter.

Only one thread can read from the stream at a time.

See also