TAudioProcessor Events


OnFlush : TAudioProcessorFlushEvent;

TAudioProcessorFlushEvent = procedure(Sender : TComponent) of object;

This event is invoked when the output component has finished output (either because there is no more data or because its Stop method was called). In this events handler AudioProcessor should flush its input by calling

AudioProcessor1.Input.Flush;

and perform any other operations needed to finish the current processing task.


OnGetBitsPerSample :TGetParameterEvent;
OnGetChannels :TGetParameterEvent;
OnGetSampleRate :TGetParameterEvent;
OnGetSize :TGetParameterEvent;
OnGetTotalTime :TGetParameterEvent;

TGetParameterEvent = procedure(Sender : TComponent; var Param : Integer) of object;

One of this events is invoked when the BitsPerSample, Channels, SampleRate, Size, or TotalTime properties (inherited from TACSInput) of the TAudioProcessor component are accessed. Param should contain the value requested. If the size of the input data is unknown, Param in OnGetSize haandler sould be passed value of -1.


OnGetData :TGetDataEvent;

TGetDataEvent = procedure(Sender : TComponent; Data : Pointer; var n : Integer) of object;

This event is invoced to process GetData method call. P is the pointer to the data block, allocated by the caller. The size of te block in bytes is stored in n parameter. The event handler should fill the block with processed data obtained by TAudioOprocessor imput component GetData call, and return in n the number of meaningful bytes in the block (this number shouldn't be greater than the original value of n. The simplest form of this operation is as follows:

n := AudioProcessor1.Input.GetData(P, n);

Returning zero in n means there is no more data to process.


OnInit :TAudioProcessorInitEvent;

TAudioProcessorInitEvent = procedure(Sender : TComponent; var TotalSize : Integer) of object;

This event's handler is invoced to process Init method call. In the handler you should call

AudioProcessor1.Input.Init;

and perform any actions needed to initialize AudioProcessor. TotalSize should be passed the size of data (same as in OnGetSize).


TAudioProcessor Home ACS Classes


Copyright © 2002, 2003 Andrei Borovsky. All rights reserved.