Description | Hierarchy | Fields | Methods | Properties |
type unaLibmpg123Decoder = class(unaObject)
libmpg123 decoder wrapper.
constructor create(const libname: string = ''); |
|
function feed(data: pointer; size: unsigned): iresult; |
|
function getDecoderNames(supportedOnly: bool = true; list: unaStringList = nil): charpp; |
|
function open(): iresult; overload; |
|
function open(const filename: string): iresult; overload; |
|
function read(outdata: pointer; var outsize: unsigned): iresult; |
|
procedure BeforeDestruction(); override; |
|
procedure close(); |
|
procedure formatChange(rate, channels, encoding: int); virtual; |
property autoResynch: bool read f_autoResynch write f_autoResynch; |
|
property bitrate: int read getBitrate; |
|
property decoder: string read getDecoder write setDecoder; |
|
property handle: pmpg123_handle read f_mh; |
|
property libOK: bool read f_libOK; |
|
property onFormatChange: unaLibmpg123_onFormatChange read f_onFC write f_onFC; |
|
property proto: plibmpg123_proto read getProto; |
constructor create(const libname: string = ''); |
|
Creates new instance of libmpg123 decoder. Parameters
|
function feed(data: pointer; size: unsigned): iresult; |
|
Feeds library with new portion of mp3 data. Library must be opened for feeding with open(). Use read() method to read available uncompressed audio data.
Parameters
ReturnsMPG123_OK or error code. |
function getDecoderNames(supportedOnly: bool = true; list: unaStringList = nil): charpp; |
|
Lists available decoder names.
decoder names (plain 8bit ASCII). Parameters
ReturnsReturn a NULL-terminated array of generally available (supportedOnly = False) or supported by the CPU (supportedOnly = True) |
function open(): iresult; overload; |
|
Opens library for direct mp3 data feeding. Use feed() to feed library with new portion of mp3 data. Use read() to read available uncompressed audio data. Use close() to release library handle. ReturnsMPG123_OK or error code. |
function open(const filename: string): iresult; overload; |
|
Opens library for direct mp3 file reading. Use read() to read uncompressed audio data. Use close() to release library handle.
Parameters
ReturnsMPG123_OK or error code. |
function read(outdata: pointer; var outsize: unsigned): iresult; |
|
Reads up to outsize uncompressed audio bytes (if available). Library must be opened for feeding or reading with open(). If library was open for feeding, use feed() method to feed library with new portion of mp3 data. Library will try to fill the whole buffer if there is enough input data. Actual number of bytes written into buffer is returned via this variable. Also check the result for reason of other possible errors or warnings. MPG123_NEED_MORE library needs more data to fill the whole buffer. Actual number of bytes is returned via outsize parameter. MPG123_OK the buffer was filled, call feed() again to read more data. MPG123_DONE Means track had a fixed VBR header with total track size information. According to this header no more mp3 data is available. Or some error code. Parameters
ReturnsMPG123_NEW_FORMAT in case a new audio format is detected. Returned at least once. No data is returned in this case. |
procedure BeforeDestruction(); override; |
|
Cleans up the instance before destruction. |
procedure close(); |
|
Closes any handles opened by library after open(). |
procedure formatChange(rate, channels, encoding: int); virtual; |
|
Called when new format was detected in read().
Parameters
|
property autoResynch: bool read f_autoResynch write f_autoResynch; |
|
property bitrate: int read getBitrate; |
|
Current bitrate. May change from frame to frame. |
property decoder: string read getDecoder write setDecoder; |
|
Returns current decoder or assigns a new one (use getDecoderNames() to list available decoders). NOTE: Current decoder is alwyas '' due to limitation of library. |
property handle: pmpg123_handle read f_mh; |
|
Direct access to internal handle. |
property libOK: bool read f_libOK; |
|
property onFormatChange: unaLibmpg123_onFormatChange read f_onFC write f_onFC; |
|
Fired when new format is detected during read(). |
property proto: plibmpg123_proto read getProto; |
|
Direct access to library prototypes. |
(c) 2012 Lake of Soft