type TSignalCoreAudioIn = class(TSignalCoreAudio);
Audio recording component based on WASAPI drivers.
Component supports CoreAudio audio drivers for recording. Input channel data can be accessed via default SignalCoreAudio[i] property as TSignal type. Each time <see cref="OnInputBufferReady"/> event is triggered, these Items contain fresh new data from the recording. Before recording can start: Specify <See cref="SamplingFrequencyHW"/>, which must be supported by the hardware. Specify <See cref="SamplingFrequency"/>, If not equal to SamplingFrequencyHW, the component will perform rate conversion using parameters specified by TransBW and Ripple properties. The signal comming from the component will always have SamplingFrequency rate. The rate conversion quality is top of the crop, but depends upon TransBW and Ripple parameters which make it possible to find a compromise between CPU usage and audio quality. Specify <See cref="ChannelCount"/> Specify <see cref="Precision"/> which defines 16bit, 24bit, double precision format, or other of the data to be converted to. All recorded data will be scaled in to this format. Define <see cref="PrecisionHw"/> properties. This is the precision of the audio engine. Choose values supported by the audio drivers and hardware. Precision and PrecisionHW are used together to determine the correct scaling. <see cref="InputDataLength"/> propery should be adjusted. This defines how large chunks of data will be comming from the component. Recommended size is 1024, but this value depends also on any further processing. Assign OnInputBufferReady. If this event is not assigned, the recording will not buffer data. When this event triggers the InpuDataLength amount of samples is ready for further processing within SignalCoreAudioIn[i] default array property. Exclusive can be set to true or false. When access to the device is exclusive, the latency can be less, audio quality higher, but audio device cannot be shared with other applications. Once a new buffer is ready, the driver will call <see cref="OnProcessRealTime"/> event. This event is executed within the drivers thread and should not interact directly with the user interface. <p> Real time data can be obtained by calling <see cref="MonitorInput"/> methods from a (user defined) TTimer. The maximum size of the data fetched depends upon <see cref="ExtendedBufferTime"/> property, which protects the recording and playback from skipping and missing samples. Typically 0.5s of data is buffered. Further information about the playback and recording can be fetched by calling: <see cref="ElapsedSamples"/>, <see cref="ElapsedTime"/>, <see cref="GetDriverLatency"/>, <see cref="ActualLatency"/>, <see cref="ProcessingTime"/>, <see cref="BufferStats"/>. The size of the buffers can be specified with <see cref="DesiredLatency"/> property in ms.
Properties
| Name | Type | Description |
|---|---|---|
| Active | Boolean | Set active to false to suppress the propagation of the Pull request and the subsequent call to the Update method. |
| BlockAssign | Boolean | Block streaming of specific properties when storing only a "template". |
| Complex | Boolean | Set this property to true, to request computation using complex numbers. |
| Continuous | Boolean | If True, the component will pass on the udpate request to the connected component. |
| Count | Integer | Defines the size of the list. |
| DeviceIndex | integer | Returns the index of the currently open CoreAudio driver in the list of available drivers. |
| DisabledOrDisconnected | boolean | Returns true, if the hardware appears disabled or disconnected. |
| EditIndex | Integer | Specifies index of the item in the list for which to display the design-time editor. |
| EditorActive | Boolean | Returns True, if the component editor is displayed. |
| First | TMtxComponent | Returns the pointer to Items[0]. |
| FloatPrecision | TMtxFloatPrecision | Set this property to request computation in 32bit/64bit precision with real/complex numbers. |
| FloatPrecisionLock | Boolean | Set this property to true to lock changes to FloatPrecision property. |
| IsDouble | Boolean | Set this property to false, to request computation in 32bit floating point precision, 64bit, if true. |
| Item | TSignal | Access TSignal objects by Index. |
| Items | TSignalChannel | Default array property allows access to individual list items. |
| ItemsCollection | TMtxComponentCollection | Content serialization and designer editor support. |
| Last | TMtxComponent | Returns Items[Count - 1]. |
| OnAfterUpdate | TNotifyEvent | The event is triggered after the call to the Update method. |
| OnBeforeUpdate | TNotifyEvent | The event is triggered just before the call to the Update method. |
| OnDisplayUpdate | TNotifyEvent | The event is triggered after the OnAfterUpdate event. |
| OnItemAdd | TMtxComponentAddEvent | Event triggered after a new item has been added. |
| OnItemDelete | TMtxComponentDeleteEvent | Event triggered before the Item will be deleted. |
| OnNotifyUpdate | TNotifyEvent | The event is called after a call to InternalUpdate, OnAfterUpdate and OnDisplayUpdate from within the Update method. |
| OnParameterUpdate | TNotifyEvent | The event is triggered when ParamUpdate method is called. |
| Paused | boolean | Set this property to True, to pause the playback and/or recording. |
| ProcessingTime | double | Returns processing time of the real-time loop in miliseconds. |
| PropagateTemplate | Boolean | Defines how TMtxComponentList.Propagate will proparage properties. |
| Reference | TReferenceList | Stores a list of components that have to be notified, when this component is destroyed. |
| SuspendNotifyUpdate | Boolean | Set this property to True, to prevent calling OnNotifyUpdate from the Update Method. |
| Volume | single | Set this property to to change the playback/recording volume. |
Methods
| Name | Description |
|---|---|
| ActualLatency | Returns actual buffer latency in miliseconds. |
| AllowStreaming | Returns the negatated value of BlockAssign. |
| Assign | Assign values of all published properties from Source. |
| AssignTemplate | Assign values of "template-like" published properties from Source. |
| BufferStats | See abstract method TSignalCoreAudio.BufferStats for more info. |
| Clear | Deletes all items from the list. |
| Create | |
| Delete | Deletes the item from the list. |
| Destroy | |
| EditorClass | To be overriden in descendanr classses. |
| ElapsedSamples | Returns total number of samples elapsed since start. |
| ElapsedTime | Returns time elapsed since start in seconds. |
| Exchange | Swaps the position of two items in the Items array. |
| Extract | Extracts the item from the list. |
| GetDeviceList | Returns a list of CoreAudio devices. |
| GetDriverLatency | Returns latency in miliseconds as reported by the driver. |
| GetSupportedPrecisionHWs | Returns list of supported PrecisionHW values. |
| GetSupportedSamplingFrequencies | Returns list of supported sampling frequencies for the currently selected PrecisionHW. |
| InputBufferSkipped | Returns number of input buffers skipped due to CPU overload. |
| Insert | Inserts an item at position Index |
| IsFormatSupported | Returns true if current setting of SamplingFrequency, ChannelCount and PrecisionHW properties is valid for the selected device. |
| LoadFromStream | Load the component from Src stream. |
| LoadTemplateFromFile | Load a template from file. |
| LoadTemplateFromStream | Load a template from stream. |
| MatchInputs | Match the connections of Inputs with the component. |
| MonitorInput | Returns most current, just recorded data. |
| MonitorInputBuffer | Thread safe method to obtain CoreAudio buffer for monitoring. |
| Move | Changes the position of an item in the Items array. |
| Propagate (2) | Propagates the settings of the component at SrcIndex to all other components. |
| Pull | Distribute Pull request to all objects in the list. |
| PullUntilEnd | Calls Pull until pipeEnd is returned. |
| RateConverterFilterDelay | Returns rate conversion filter delay in number of samples. |
| RefreshDevices | |
| Remove | Deletes the first reference to the Item parameter from the Items array. |
| Renumerate | Assign consecutive numbers to individual items. |
| Reset | Reset is called after loading the data from stream or file. |
| Rotate | Rotate the list up or down. |
| SaveTemplateToFile | Save template to file. |
| SaveTemplateToStream | Save template to stream. |
| SaveToStream | Save the component to Dst stream. |
| Start | Start the recording or playback. |
| Stop | Stop the recording or playback. |
| StopGracefully | Stop the recording or playback. |
| Update | Distribute Update request to all objects in the list. |
| UpdateNotify | Call this method only, if SuspendNotifyUpdate is True. |