Moai SDK
2.0
|
Inherits MOAILuaObject.
Function List | |
getData | |
getInfo | |
load | |
prepareBuffer | |
setData | |
setRawData | |
|
Retrieve every sample data in buffer.
function getData ( MOAIUntzSampleBuffer self )
MOAIUntzSampleBuffer | self |
|
Returns attributes of sample buffer.
function getInfo ( MOAIUntzSampleBuffer self )
MOAIUntzSampleBuffer | self |
|
Loads a sound from disk.
function load ( MOAIUntzSampleBuffer self, string filename )
MOAIUntzSampleBuffer | self |
string | filename |
|
Allocate internal memory for sample buffer.
function prepareBuffer ( MOAIUntzSampleBuffer self, number channels, number frames, number sampleRate )
MOAIUntzSampleBuffer | self |
number | channels number of channels (mono=1, stereo=2) |
number | frames number of total frames of sample |
number | sampleRate sample rate in Hz (44100 or else) |
|
Write sample data into buffer.
function setData ( MOAIUntzSampleBuffer self, table data, number startIndex )
MOAIUntzSampleBuffer | self |
table | data array of sample data number ( -1 ~ 1 as sample level ) |
number | startIndex index of sample buffer to start copying from (1 for the first sample) |
|
Write raw sample data (array of 16bit short value) into buffer.
function setRawData ( MOAIUntzSampleBuffer self, string raw, number of, number index )
MOAIUntzSampleBuffer | self |
string | raw binary data that contains array of network byte ordered 16bit short value |
number | of bytes to read |
number | index of sample buffer start copying from (1 for the first sample) |