Package | com.yoambulante.midifiles |
Class | public class SamplesExtractor |
Inheritance | SamplesExtractor flash.events.EventDispatcher |
flash.media.Sound
) object and turn them to a Vector.<Point> where .x represents the right channel value and .y the left channel value.
Property | Defined By | ||
---|---|---|---|
MAX_EXTRACTION_PER_GO : uint = 10000 [static]
Everytime .extract() is called it will try to extract up to this amount of samples
| SamplesExtractor | ||
totalSamples : uint [read-only]
total amount of samples available after extraction
| SamplesExtractor |
Method | Defined By | ||
---|---|---|---|
SamplesExtractor(snd:Sound)
Creates a SamplesExtractor instance
| SamplesExtractor | ||
extract():void
start extracting all samples from a Sound defined on constructor
| SamplesExtractor | ||
readSampleAt(index:uint):Point
get a stereo sample in form of a Point from the extracted sample list
| SamplesExtractor |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when the extraction process has finished. | SamplesExtractor | |||
Dispatched during the extraction process, helps to know the percentage progress of the current extraction process. | SamplesExtractor |
MAX_EXTRACTION_PER_GO | property |
public static var MAX_EXTRACTION_PER_GO:uint = 10000
Everytime .extract()
is called it will try to extract up to this amount of samples
totalSamples | property |
totalSamples:uint
[read-only] total amount of samples available after extraction
public function get totalSamples():uint
SamplesExtractor | () | Constructor |
public function SamplesExtractor(snd:Sound)
Creates a SamplesExtractor instance
Parameterssnd:Sound — Sound object where to extract samples from. IMPORTANT, this sound must represent a waveform in A440 frequency
|
extract | () | method |
public function extract():void
start extracting all samples from a Sound
defined on constructor
See also
Sound
var snd:Sound = new MySound(); //MySound is a sound in the library extending flash.media.Sound Class var ext:SamplesExtractor = new SamplesExtractor(snd); ext.addEventListener(ProgressEvent.PROGRESS, extractingSamples); //progress ext.addEventListener(Event.COMPLETE, samplesReady); //when is finishes ext.extract();
readSampleAt | () | method |
public function readSampleAt(index:uint):Point
get a stereo sample in form of a Point
from the extracted sample list
Parameters
index:uint |
Point — a stereo sample in form of a Point where .x represent right channel and .y left channel
|
COMPLETE | Event |
flash.events.Event
flash.events.Event.COMPLETE
Dispatched when the extraction process has finished. Call .extract
method for start extracting all samples.
PROGRESS | Event |
flash.events.ProgressEvent
flash.events.ProgressEvent.PROGRESS
Dispatched during the extraction process, helps to know the percentage progress of the current extraction process.