Home Units Hierarchy Routines All identifiers

Class unaSpeexEncoder

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaSpeexEncoder = class(unaSpeexCoder)

Description

Speex Encoder.

Hierarchy

Overview

Methods

Public function encode_int(samples: pointer; size: int): int;
Protected function doGetFrameSize(): int; override;
Protected function doGetSamplingRate(): int; override;
Protected function doInit(): pointer; override;
Public procedure AfterConstruction(); override;
Public procedure assignDSP(dsp: unaSpeexDSP; aec: bool = false);
Protected procedure add_frame_int(samples: pointer; vad: bool); virtual;
Protected procedure doClose(); override;
Protected procedure doOpen(); override;
Protected procedure encoder_write(sampleDelta: uint; data: pointer; size: uint; numFrames: uint); virtual;

Properties

Public property abr: int read getABR write setABR;
Public property aec: bool read f_aec write f_aec;
Public property bitrate: int read getBitrate write setBitrate;
Public property complexity: int read getComplexity write setComplexity;
Public property dsp: unaSpeexDSP read f_dsp;
Public property optimizeForRTP: bool read f_op4RTP write f_op4RTP;
Public property quality: int read getQuality write setQuality;
Public property vbr: bool read getVbr write setVbr;
Public property vbrQuality: float read getVbrQ write setVbrQ;

Description

Methods

Public function encode_int(samples: pointer; size: int): int;

Writes full frames from samples buffer. Rest will be stored internally. Size is in bytes. Samples are 16 bits integer values from -32768 to +32767, mono.

Return number of bytes consumed by encoder or -1 in case of some error.

Protected function doGetFrameSize(): int; override;
 
Protected function doGetSamplingRate(): int; override;
 
Protected function doInit(): pointer; override;
 
Public procedure AfterConstruction(); override;
 
Public procedure assignDSP(dsp: unaSpeexDSP; aec: bool = false);

Makes encoder aware (or unaware if nil is passed) of DSP.

Protected procedure add_frame_int(samples: pointer; vad: bool); virtual;

Adds new frame to encoder. samples is pointing to exactly 1 frame of audio (20 ms). Samples are 16 bits integer values from -32768 to +32767, mono.

Protected procedure doClose(); override;
 
Protected procedure doOpen(); override;
 
Protected procedure encoder_write(sampleDelta: uint; data: pointer; size: uint; numFrames: uint); virtual;

Called when new block of encoded data is available. numFrames is number of frames encoded in buffer.

Properties

Public property abr: int read getABR write setABR;
 
Public property aec: bool read f_aec write f_aec;

Enable/disable aec (only when dsp is assigned)

Public property bitrate: int read getBitrate write setBitrate;
 
Public property complexity: int read getComplexity write setComplexity;
 
Public property dsp: unaSpeexDSP read f_dsp;

Assigned DSP (if any)

Public property optimizeForRTP: bool read f_op4RTP write f_op4RTP;

When True, up to c_opt4RTP_numframes frames but no more than c_opt4RTP_numbytes bytes will be packed before output encoded buffer will be notified.

Public property quality: int read getQuality write setQuality;

set below properties to adjust output bitrate (and quality)

Public property vbr: bool read getVbr write setVbr;
 
Public property vbrQuality: float read getVbrQ write setVbrQ;
 

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09