| Package | org.si.sion.utils | 
| Class | public class PCMSample | 
| Inheritance | PCMSample    flash.events.EventDispatcher | 
| 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:intappend position
| _cache | property | 
protected var _cache:Vector.<Number>converted sample cache
| _cacheChannels | property | 
protected var _cacheChannels:intconverted sample cache channel count
| _cacheSampleRate | property | 
protected var _cacheSampleRate:Numberconverted sample cache sample rate
| _channels | property | 
protected var _channels:intchannel count of internal wave sample
| _extractPosition | property | 
protected var _extractPosition:Numberextract position
| _outputBitRate | property | 
protected var _outputBitRate:intbit rate of wave file
| _outputChannels | property | 
protected var _outputChannels:intchannel count of output
| _outputSampleRate | property | 
protected var _outputSampleRate:Numbersample rate of output
| _sampleRate | property | 
protected var _sampleRate:intsample 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 = nullwave data
| _waveDataBitRate | property | 
protected var _waveDataBitRate:intwave data bit rate
| _waveDataChannels | property | 
protected var _waveDataChannels:intwave data channel count
| _waveDataChunks | property | 
protected var _waveDataChunks:* = nullchunks of wave data
| _waveDataFormatID | property | 
protected var _waveDataFormatID:intwave data format ID
| _waveDataSampleRate | property | 
protected var _waveDataSampleRate:Numberwave data sample rate
| baseNote | property | 
public var baseNote:intMIDI note number of base frequency
| basicInfoChunkID | property | 
public static var basicInfoChunkID:String = sinfYou should not change this property into "acid" !
| beatCount | property | 
public var beatCount:intbeat count
| bitRate | property | 
bitRate:intbit 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:Numberbeat per minutes
| channels | property | 
channels:intchannel 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 = SiONextended 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:Numbersample 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:intflags: 0x01 = oneshot, 0x02 = rootSet, 0x04 = stretch, 0x08 = diskbased
| timeSignatureDenominator | property | 
public var timeSignatureDenominator:intdenominator of time signature
| timeSignatureNumber | property | 
public var timeSignatureNumber:intnumber 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):PCMSampleappend 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):PCMSampleappend 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):PCMSampleload 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):PCMSampleload from wave file byteArray.
Parameters
waveFile:ByteArray — ByteArray of wave file.
          | 
PCMSample | 
| readSTRCChunk | () | method | 
 public static function readSTRCChunk(strcChunk:ByteArray):ArrayTry to read mysterious "strc" chunk.
Parameters
strcChunk:ByteArray — strc chunk data.
           | 
Array — positions
          | 
| saveWaveAsByteArray | () | method | 
 public function saveWaveAsByteArray():ByteArraysave wave file as byteArray.
ReturnsByteArray — waveFile ByteArray of wave file.
          |