LuaSTG-x Core API
|
Public Member Functions | |
function | clone () |
function | createFromFile (local path, local bufferSize, local type) |
function | createFromLocalFile (local path, local bufferSize, local type) |
function | createFromSoundData (local soundData, local bufferSize, local type) |
function | createFromStream (local s, local bufferSize, local type) |
function | createFromStringData (local str, local bufferSize, local type) |
function | getBitDepth () |
function | getBufferSize () |
function | getBytesPerFrame () |
function | getChannelCount () |
function | getDecoderTypeFromPath (local path) |
function | getDuration () |
function | getLoopingEnd () |
function | getLoopingStart () |
function | getSampleRate () |
function | getTotalFrames () |
function | isFinished () |
function | isSeekable () |
function | rewind () |
function | seek (local frameOffset) |
function | seekTime (local seconds) |
function | tell () |
function clone | ( | ) |
Creates a deep of itself. The sound stream can (and should) be
rewound, and does not have to be at the same place.
return A new Decoder object.
path | string |
bufferSize | number |
type | number |
path | string |
bufferSize | number |
type | number |
soundData | audio.SoundData |
bufferSize | number |
type | number |
s | audio.Stream |
bufferSize | number |
type | number |
str | string |
bufferSize | number |
type | number |
function getBitDepth | ( | ) |
Gets the number of bits per sample. Supported values are 8 or 16.
return Either 8, 16, or 0 if unsupported.
function getBufferSize | ( | ) |
Gets the size of the buffer (NOT the size of the entire stream).
return The size of the buffer.
function getBytesPerFrame | ( | ) |
function getChannelCount | ( | ) |
Gets the number of channels in a stream. Supported values are 1 (mono) or 2 (stereo).
return Either 1 for mono, 2 for stereo, or 0 on errors.
function getDuration | ( | ) |
Gets the estimated total duration of the stream. in seconds. May return
-1 if the duration cannot be determined.
function getLoopingEnd | ( | ) |
function getLoopingStart | ( | ) |
function getSampleRate | ( | ) |
Gets the sample rate for the Decoder, that is, samples per second.
return The sample rate, eg. 44100.
function getTotalFrames | ( | ) |
function isFinished | ( | ) |
Checks whether a stream has more data to decode or not. Use
rewind to start the stream again.
return False if there is more data, true on EOF.
function isSeekable | ( | ) |
Checks whether a stream is seekable.
return True if seekable, false otherwise.
function rewind | ( | ) |
Rewinds the stream to the start.
return True if success, false on fail/unsupported.
Seeks to the specified position, if possible.
param frameOffset The position in the stream in frames.
return True if success, false on fail/unsupported.
frameOffset | number |
Seeks to the specified position, if possible.
param seconds The position in the stream in seconds.
return True if success, false on fail/unsupported.
seconds | number |
function tell | ( | ) |
brief Tells the current frame offset.
return The current frame offset.