Home Units Hierarchy Routines All identifiers

Class unaLibCELTcoder

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaLibCELTcoder = class(unaObject)

Description

Base abstract libcelt coder.

Hierarchy

Overview

Fields

Protected f_proc: unaLibCELTAPI;
Protected f_frameSizeBytes: int;

Methods

Public constructor create(rate: int = 24000; frame_size: int = 480; channels: int = 1; const libname: string = '');
Public function IOCTL(req: int; var value: int32): int;
Public function open(): int; overload;
Public function open(rate: int; frame_size: int = 480; channels: int = 1): int; overload;
Protected function doIOCTL(req: int; var value: int32): int; virtual; abstract;
Protected function doOpen(): int; virtual; abstract;
Protected function lock(timeout: tTimeout = 100): bool;
Public procedure BeforeDestruction(); override;
Public procedure close();
Protected procedure doClose(); virtual; abstract;
Protected procedure doDataAvail(data: pointer; size: int); virtual;
Protected procedure unlock();

Properties

Public property active: bool read f_active;
Public property frameSize: int read f_frameSize2 write setFrameSize;
Public property lastError: int read f_lastError;
Public property libOK: bool read f_libOK;
Public property onDataAvail: unaLibCELTcoderDataAvail read f_onDataAvail write f_onDataAvail;
Public property pcm_channels: int read f_channels;
Public property pcm_rate: int read f_rate;
Public property proc: punaLibCELTAPI read getProc;

Description

Fields

Protected f_proc: unaLibCELTAPI;
 
Protected f_frameSizeBytes: int;
 

Methods

Public constructor create(rate: int = 24000; frame_size: int = 480; channels: int = 1; const libname: string = '');

Loads library and initializes the coder with specified parameters. Aborts with exception if library was not loaded.

Parameters
rate
Sampling rate, from 8000 to 96000.
frame_size
Frame size is samples (per channel), must be even (and should divide on 80?)
channels
Number of channels, 1 for mono, 2 for stereo
libname
Library file name
Public function IOCTL(req: int; var value: int32): int;

Query and set coder parameters.

Parameters
req
Parameter to change or query
value
In/Out value
Returns

Error code

Public function open(): int; overload;

Initializes the coder with parameters specified upon creation or previois open().

Returns

0 if succeeded, negative value otherwise (see CELT_ error codes).

Public function open(rate: int; frame_size: int = 480; channels: int = 1): int; overload;

Initializes the coder with specified parameters.

Parameters
rate
Sampling rate, from 32000 to 96000.
frame_size
Frame size is samples (per channel), must be even (and should divide on 80?)
channels
Number of channels, 1 for mono, 2 for stereo
libname
Library file name
Returns

0 if succeeded, negative value otherwise (see CELT_ error codes).

Protected function doIOCTL(req: int; var value: int32): int; virtual; abstract;

IOCTL the coder.

Protected function doOpen(): int; virtual; abstract;

Opens the coder.

Protected function lock(timeout: tTimeout = 100): bool;

DLL Re-entrance lock.

Public procedure BeforeDestruction(); override;
 
Public procedure close();

Releases the coder resources.

Protected procedure doClose(); virtual; abstract;

Closes the coder.

Protected procedure doDataAvail(data: pointer; size: int); virtual;

Called when encoder or decoder is ready with new portion of data.

Protected procedure unlock();

DLL Re-entrance unlock.

Properties

Public property active: bool read f_active;

True if coder is opened

Public property frameSize: int read f_frameSize2 write setFrameSize;

frame size in samples (per channel)

Public property lastError: int read f_lastError;

Last error (shared for all threads!)

Public property libOK: bool read f_libOK;

True if liblary was loaded

Public property onDataAvail: unaLibCELTcoderDataAvail read f_onDataAvail write f_onDataAvail;

Fired for each new chunk of audio

Public property pcm_channels: int read f_channels;

number of channels

Public property pcm_rate: int read f_rate;

sampling rate

Public property proc: punaLibCELTAPI read getProc;

libcelt API

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09