Package | org.si.sion.utils |
Class | public class PCMSample |
Inheritance | PCMSample ![]() |
Property | Defined By | ||
---|---|---|---|
baseNote : int MIDI note number of base frequency | PCMSample | ||
basicInfoChunkID : String = sinf [static] You should not change this property into "acid" ! | PCMSample | ||
beatCount : int beat count | PCMSample | ||
bitRate : int bit rate, this function is used only for saveWaveByteArray, 8 or 16 is avairable. | PCMSample | ||
bpm : Number beat per minutes | PCMSample | ||
channels : int channel count, 1 for monoral, 2 for stereo | PCMSample | ||
extendedInfoChunkID : String = SiON [static] extended chunk for SiON | PCMSample | ||
internalChannels : int [read-only] channel count of internal samples. | PCMSample | ||
internalSampleRate : Number [read-only] sample rate of internal samples. | PCMSample | ||
sampleLength : int [read-only] sample length | PCMSample | ||
sampleRate : Number sample rate [Hz] | PCMSample | ||
samples : Vector.<Number> [read-only] samples in Vector.<Number> with properties of sampleRate and channels. | PCMSample | ||
sampleType : int flags: 0x01 = oneshot, 0x02 = rootSet, 0x04 = stretch, 0x08 = diskbased | PCMSample | ||
timeSignatureDenominator : int denominator of time signature | PCMSample | ||
timeSignatureNumber : int number of time signature | PCMSample | ||
waveData : ByteArray [read-only] wave sample data of original wave file, this property is only available after loadWaveFromByteArray() or saveWaveAsByteArray(). | PCMSample | ||
waveDataBitRate : int [read-only] bit rate of original wave file, this property is only available after loadWaveFromByteArray() or saveWaveAsByteArray(). | PCMSample | ||
waveDataChannels : int [read-only] channel count of original wave file, this property is only available after loadWaveFromByteArray() or saveWaveAsByteArray(). | PCMSample | ||
waveDataChunks : * [read-only] chunks of wave file, this property is only available after loadWaveFromByteArray(). | PCMSample | ||
waveDataSampleRate : Number [read-only] sample rate of original wave file, this property is only available after loadWaveFromByteArray() or saveWaveAsByteArray(). | PCMSample |
Property | Defined By | ||
---|---|---|---|
_appendPosition : int append position | PCMSample | ||
_cache : Vector.<Number> converted sample cache | PCMSample | ||
_cacheChannels : int converted sample cache channel count | PCMSample | ||
_cacheSampleRate : Number converted sample cache sample rate | PCMSample | ||
_channels : int channel count of internal wave sample | PCMSample | ||
_extractPosition : Number extract position | PCMSample | ||
_outputBitRate : int bit rate of wave file | PCMSample | ||
_outputChannels : int channel count of output | PCMSample | ||
_outputSampleRate : Number sample rate of output | PCMSample | ||
_sampleRate : int sample rate of internal wave sample | PCMSample | ||
_samples : Vector.<Number> internal wave sample in 44.1kHz Number | PCMSample | ||
_waveData : ByteArrayExt = null wave data | PCMSample | ||
_waveDataBitRate : int wave data bit rate | PCMSample | ||
_waveDataChannels : int wave data channel count | PCMSample | ||
_waveDataChunks : * = null chunks of wave data | PCMSample | ||
_waveDataFormatID : int wave data format ID | PCMSample | ||
_waveDataSampleRate : Number wave data sample rate | PCMSample |
Method | Defined By | ||
---|---|---|---|
PCMSample(channels:int = 2, sampleRate:int = 44100, samples:Vector.<Number> = null) constructor | PCMSample | ||
appendSamples(src:Vector.<Number>, sampleCount:int = 0, srcOffset:int = 0):PCMSample append samples
| PCMSample | ||
appendSamplesFromByteArrayFloat(bytes:ByteArray, sampleCount:int = 0):PCMSample append samples from ByteArray float (2ch/44.1kHz), The internal format should be 2ch/44.1kHz. | PCMSample | ||
clear cache and waveData | PCMSample | ||
clear wave data cache | PCMSample | ||
extract(dst:Vector.<Number> = null, length:int = 0, offset:int = -1):Vector.<Number> extract to Vector.<Number>
| PCMSample | ||
loadFromVector(src:Vector.<Number>, srcChannels:int = 2, srcSampleRate:Number = 44100, linear:Boolean = true):PCMSample load sample from Vector.<Number>
| PCMSample | ||
loadWaveFromByteArray(waveFile:ByteArray):PCMSample load from wave file byteArray. | PCMSample | ||
readSTRCChunk(strcChunk:ByteArray):Array [static] Try to read mysterious "strc" chunk. | PCMSample | ||
saveWaveAsByteArray():ByteArray save wave file as byteArray. | PCMSample |
_appendPosition | property |
protected var _appendPosition:int
append position
_cache | property |
protected var _cache:Vector.<Number>
converted sample cache
_cacheChannels | property |
protected var _cacheChannels:int
converted sample cache channel count
_cacheSampleRate | property |
protected var _cacheSampleRate:Number
converted sample cache sample rate
_channels | property |
protected var _channels:int
channel count of internal wave sample
_extractPosition | property |
protected var _extractPosition:Number
extract position
_outputBitRate | property |
protected var _outputBitRate:int
bit rate of wave file
_outputChannels | property |
protected var _outputChannels:int
channel count of output
_outputSampleRate | property |
protected var _outputSampleRate:Number
sample rate of output
_sampleRate | property |
protected var _sampleRate:int
sample rate of internal wave sample
_samples | property |
protected var _samples:Vector.<Number>
internal wave sample in 44.1kHz Number
_waveData | property |
protected var _waveData:ByteArrayExt = null
wave data
_waveDataBitRate | property |
protected var _waveDataBitRate:int
wave data bit rate
_waveDataChannels | property |
protected var _waveDataChannels:int
wave data channel count
_waveDataChunks | property |
protected var _waveDataChunks:* = null
chunks of wave data
_waveDataFormatID | property |
protected var _waveDataFormatID:int
wave data format ID
_waveDataSampleRate | property |
protected var _waveDataSampleRate:Number
wave data sample rate
baseNote | property |
public var baseNote:int
MIDI note number of base frequency
basicInfoChunkID | property |
public static var basicInfoChunkID:String = sinf
You should not change this property into "acid" !
beatCount | property |
public var beatCount:int
beat count
bitRate | property |
bitRate:int
bit rate, this function is used only for saveWaveByteArray, 8 or 16 is avairable.
public function get bitRate():int
public function set bitRate(value:int):void
bpm | property |
public var bpm:Number
beat per minutes
channels | property |
channels:int
channel count, 1 for monoral, 2 for stereo
public function get channels():int
public function set channels(value:int):void
extendedInfoChunkID | property |
public static var extendedInfoChunkID:String = SiON
extended chunk for SiON
internalChannels | property |
internalChannels:int
[read-only] channel count of internal samples.
public function get internalChannels():int
internalSampleRate | property |
internalSampleRate:Number
[read-only] sample rate of internal samples.
public function get internalSampleRate():Number
sampleLength | property |
sampleLength:int
[read-only] sample length
public function get sampleLength():int
sampleRate | property |
sampleRate:Number
sample rate [Hz]
public function get sampleRate():Number
public function set sampleRate(value:Number):void
samples | property |
samples:Vector.<Number>
[read-only] samples in Vector.<Number> with properties of sampleRate and channels.
public function get samples():Vector.<Number>
sampleType | property |
public var sampleType:int
flags: 0x01 = oneshot, 0x02 = rootSet, 0x04 = stretch, 0x08 = diskbased
timeSignatureDenominator | property |
public var timeSignatureDenominator:int
denominator of time signature
timeSignatureNumber | property |
public var timeSignatureNumber:int
number of time signature
waveData | property |
waveData:ByteArray
[read-only] wave sample data of original wave file, this property is only available after loadWaveFromByteArray() or saveWaveAsByteArray().
public function get waveData():ByteArray
waveDataBitRate | property |
waveDataBitRate:int
[read-only] bit rate of original wave file, this property is only available after loadWaveFromByteArray() or saveWaveAsByteArray().
public function get waveDataBitRate():int
waveDataChannels | property |
waveDataChannels:int
[read-only] channel count of original wave file, this property is only available after loadWaveFromByteArray() or saveWaveAsByteArray().
public function get waveDataChannels():int
waveDataChunks | property |
waveDataChunks:*
[read-only] chunks of wave file, this property is only available after loadWaveFromByteArray().
public function get waveDataChunks():*
waveDataSampleRate | property |
waveDataSampleRate:Number
[read-only] sample rate of original wave file, this property is only available after loadWaveFromByteArray() or saveWaveAsByteArray().
public function get waveDataSampleRate():Number
PCMSample | () | Constructor |
public function PCMSample(channels:int = 2, sampleRate:int = 44100, samples:Vector.<Number> = null)
constructor
Parameterschannels:int (default = 2 )
| |
sampleRate:int (default = 44100 )
| |
samples:Vector.<Number> (default = null )
|
appendSamples | () | method |
public function appendSamples(src:Vector.<Number>, sampleCount:int = 0, srcOffset:int = 0):PCMSample
append samples
Parameters
src:Vector.<Number> — buffering source. This should be same format as internalSampleRate and internalChannels
| |
sampleCount:int (default = 0 ) — sample count to append. 0 appends all samples.
| |
srcOffset:int (default = 0 ) — position (in samples) start appending from.
|
PCMSample |
appendSamplesFromByteArrayFloat | () | method |
public function appendSamplesFromByteArrayFloat(bytes:ByteArray, sampleCount:int = 0):PCMSample
append samples from ByteArray float (2ch/44.1kHz), The internal format should be 2ch/44.1kHz.
Parameters
bytes:ByteArray — buffering source. The format should be float vector of 2ch/44.1kHz.
| |
sampleCount:int (default = 0 ) — sample count to append. 0 appends all samples.
|
PCMSample |
clearCache | () | method |
clearWaveDataCache | () | method |
extract | () | method |
public function extract(dst:Vector.<Number> = null, length:int = 0, offset:int = -1):Vector.<Number>
extract to Vector.<Number>
Parameters
dst:Vector.<Number> (default = null )
| |
length:int (default = 0 )
| |
offset:int (default = -1 )
|
Vector.<Number> —
|
loadFromVector | () | method |
public function loadFromVector(src:Vector.<Number>, srcChannels:int = 2, srcSampleRate:Number = 44100, linear:Boolean = true):PCMSample
load sample from Vector.<Number>
Parameters
src:Vector.<Number> — source vector of Number.
| |
srcChannels:int (default = 2 ) — channel count of source.
| |
srcSampleRate:Number (default = 44100 ) — sample rate of source.
| |
linear:Boolean (default = true ) — exchange sampling rate by linear interpolation, set false to use samples nearest by.
|
PCMSample |
loadWaveFromByteArray | () | method |
public function loadWaveFromByteArray(waveFile:ByteArray):PCMSample
load from wave file byteArray.
Parameters
waveFile:ByteArray — ByteArray of wave file.
|
PCMSample |
readSTRCChunk | () | method |
public static function readSTRCChunk(strcChunk:ByteArray):Array
Try to read mysterious "strc" chunk.
Parameters
strcChunk:ByteArray — strc chunk data.
|
Array — positions
|
saveWaveAsByteArray | () | method |
public function saveWaveAsByteArray():ByteArray
save wave file as byteArray.
ReturnsByteArray — waveFile ByteArray of wave file.
|