Description | Uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables |
Delphi wrapper for MpgLib.DLL and libmpg123-0.dll
Name | Description |
---|---|
record libmpg123_proto |
|
packed record mpg123_frameinfo |
|
packed record mpg123_handle |
|
packed record mpg123_id3v1 |
|
packed record mpg123_id3v2 |
|
packed record mpg123_pars |
|
packed record mpg123_string |
|
packed record mpg123_text |
|
packed record mpglib_buf |
|
packed record mpglib_frame |
|
packed record mpglib_framebuf |
|
packed record mpglib_gr_info_s |
|
packed record mpglib_gr_info_s2 |
– – |
packed record mpglib_III_sideinfo |
|
record mpglib_proto |
mpglib prototype |
packed record MPSTR |
|
Class unaLibmpg123Decoder |
libmpg123 decoder wrapper. |
Class unaMpgLibDecoder |
MPGLIB decoder wrapper. |
function loadLib(var proto: mpglib_proto; const libName: wString = ''): int; |
function unloadLib(var proto: mpglib_proto): int; |
function loadLibmpg123(var proto: libmpg123_proto; const libName: wString = ''): int; |
function unloadLibmpg123(var proto: libmpg123_proto): int; |
function loadLib(var proto: mpglib_proto; const libName: wString = ''): int; |
Loads mpglib. |
function unloadLib(var proto: mpglib_proto): int; |
Unloads mpglib. |
function loadLibmpg123(var proto: libmpg123_proto; const libName: wString = ''): int; |
Loads libmpg123 library.
Parameters
ReturnsMPG123_BAD_PARAM if some or all of exports could not be found. |
function unloadLibmpg123(var proto: libmpg123_proto): int; |
Unloads libmpg123. Parameters
|
pfloat = ˆdouble; |
– – |
pmpglib_frame = ˆmpglib_frame; |
– – |
pmpglib_gr_info_s = ˆmpglib_gr_info_s; |
– – |
pmpglib_III_sideinfo = ˆmpglib_III_sideinfo; |
– – |
pmpglib_buf = ˆmpglib_buf; |
#include "lame-analysis.h" #ifndef NOANALYSIS extern plotting_data *mpg123_pinfo; #endif – buf – |
pmpglib_framebuf = ˆmpglib_framebuf; |
– framebuf – |
PMPSTR = ˆMPSTR; |
– – |
intp = int32; |
\defgroup mpg123_init mpg123 library and handle setup * * Functions to initialise and shutdown the mpg123 library and handles. * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) * Tip: Use a RVA setting... * * @{ * |
uintp = uint32; |
signed integer parameter |
offp = intp; |
unsigned integer parameter |
floatp = double; |
offset parameter or result code |
ptrp = pointer; |
float parameter |
iresult = int32; |
pointer to buffer parameter |
charp = paChar; |
signed integer result |
pintp = ˆintp; |
pointer to array of chars |
pmpg123_handle = ˆmpg123_handle; |
Opaque structure for the libmpg123 decoder handle. * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. * |
proc_mpg123_init = function(): iresult; cdecl; |
Function to initialise the mpg123 library. * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. * * \return MPG123_OK if successful, otherwise an error number. * |
proc_mpg123_new = function(decoder: charp; error: pintp): pmpg123_handle; cdecl; |
Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). * and optional retrieval of an error code to feed to mpg123_plain_strerror(). * Optional means: Any of or both the parameters may be NULL. * * \return Non-NULL pointer when successful. * |
proc_mpg123_delete = procedure(mh: pmpg123_handle); cdecl; |
Delete handle, mh is either a valid mpg123 handle or NULL. * |
mpg123_parms = intp; |
Enumeration of the parameters types that it is possible to set/get. * |
mpg123_param_flags = intp; |
Flag bits for MPG123_FLAGS, use the usual binary or to combine. * |
mpg123_param_rva = intp; |
choices for MPG123_RVA * |
proc_mpg123_param = function(mh: pmpg123_handle; _type: mpg123_parms; value: intp; fvalue: floatp): iresult; cdecl; |
Set a specific parameter, for a specific mpg123_handle, using a parameter * type key chosen from the mpg123_parms enumeration, to the specified value. */ |
proc_mpg123_getparam = function(mh: pmpg123_handle; _type: mpg123_parms; var val: intp; var fval: floatp): iresult; cdecl; |
Get a specific parameter, for a specific mpg123_handle. * See the mpg123_parms enumeration for a list of available parameters. * |
mpg123_errors = intp; |
Enumeration of the message and error codes and returned by libmpg123 functions. * |
proc_mpg123_plain_strerror = function(errcode: intp): charp; cdecl; |
Return a string describing that error errcode means. * |
proc_mpg123_strerror = function(mh: pmpg123_handle): charp; cdecl; |
Give string describing what error has occured in the context of handle mh. * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via * char *errmsg = mpg123_strerror(mh) * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. * |
proc_mpg123_errcode = function(mh: pmpg123_handle): iresult; cdecl; |
Return the plain errcode intead of a string. * |
charpp = ˆcharp; |
\defgroup mpg123_decoder mpg123 decoder selection * * Functions to list and select the available decoders. * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). * * @{ * |
proc_mpg123_decoders = function(): charpp; cdecl; |
Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). * |
proc_mpg123_supported_decoders = function(): charpp; cdecl; |
Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). * |
proc_mpg123_decoder = function(mh: pmpg123_handle; decoder_name: charp): iresult; cdecl; |
Set the chosen decoder to 'decoder_name' * |
mpg123_enc_enum = intp; |
16 or 8 bits, signed or unsigned... all flags fit into 15 bits and are designed to have meaningful binary AND/OR. * Adding float and 32bit int definitions for experimental fun. Only 32bit (and possibly 64bit) float is * somewhat there with a dedicated library build. * |
mpg123_channelcount = intp; |
They can be combined into one number (3) to indicate mono and stereo... * |
proc_mpg123_rates = procedure(var list: pInt32; var number: uintp); cdecl; |
An array of supported standard sample rates * These are possible native sample rates of MPEG audio files. * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. * \param list Store a pointer to the sample rates array there. * \param number Store the number of sample rates there. * |
proc_mpg123_encodings = procedure(var list: pInt32; var number: uintp); cdecl; |
An array of supported audio encodings. * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). * \param list Store a pointer to the encodings array there. * \param number Store the number of encodings there. * |
proc_mpg123_format_none = function(mh: pmpg123_handle): iresult; cdecl; |
Configure a mpg123 handle to accept no output format at all, * use before specifying supported formats with mpg123_format * |
proc_mpg123_format_all = function(mh: pmpg123_handle): iresult; cdecl; |
Configure mpg123 handle to accept all formats * (also any custom rate you may set) – this is default. * |
proc_mpg123_format = function(mh: pmpg123_handle; rate: intp; channels: intp; encodings: intp): iresult; cdecl; |
Set the audio format support of a mpg123_handle in detail: * \param mh audio decoder handle * \param rate The sample rate value (in Hertz). * \param channels A combination of MPG123_STEREO and MPG123_MONO. * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. * \return MPG123_OK on success, MPG123_ERR if there was an error. * |
proc_mpg123_format_support = function(mh: pmpg123_handle; rate: intp; encoding: intp): iresult; cdecl; |
Check to see if a specific format at a specific rate is supported * by mpg123_handle. * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, * MPG123_MONO or MPG123_STEREO|MPG123_MONO. * |
proc_mpg123_getformat = function(mh: pmpg123_handle; var rate: intp; var channels: intp; var encoding: intp): iresult; cdecl; |
Get the current output format written to the addresses givenr. * |
proc_mpg123_open = function(mh: pmpg123_handle; path: charp): iresult; cdecl; |
Open and prepare to decode the specified file by filesystem path. * This does not open HTTP urls; libmpg123 contains no networking code. * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). * |
proc_mpg123_open_fd = function(mh: pmpg123_handle; fd: intp): iresult; cdecl; |
Use an already opened file descriptor as the bitstream input * mpg123_close() will _not_ close the file descriptor. * |
proc_mpg123_open_feed = function(mh: pmpg123_handle): iresult; cdecl; |
Open a new bitstream and prepare for direct feeding * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. * |
proc_mpg123_close = function(mh: pmpg123_handle): iresult; cdecl; |
Closes the source, if libmpg123 opened it. * |
proc_mpg123_read = function(mh: pmpg123_handle; outmemory: ptrp; outmemsize: uintp; var done: uintp): iresult; cdecl; |
Read from stream and decode up to outmemsize bytes. * \param outmemory address of output buffer to write to * \param outmemsize maximum number of bytes to write * \param done address to store the number of actually decoded bytes to * \return error/message code (watch out for MPG123_DONE and friends!) * |
proc_mpg123_feed = function(mh: pmpg123_handle; _in: ptrp; size: uintp): iresult; cdecl; |
Feed data for a stream that has been opened with mpg123_open_feed(). * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. * \param in input buffer * \param size number of input bytes * \return error/message code. * |
proc_mpg123_decode = function(mh: pmpg123_handle; inmemory: ptrp; inmemsize: uintp; outmemory: ptrp; outmemsize: uintp; var done: uintp): iresult; cdecl; |
Decode MPEG Audio from inmemory to outmemory. * This is very close to a drop-in replacement for old mpglib. * When you give zero-sized output buffer the input will be parsed until * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) * without taking decoded data. * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). * You can actually always decide if you want those specialized functions in separate steps or one call this one here. * \param inmemory input buffer * \param inmemsize number of input bytes * \param outmemory output buffer * \param outmemsize maximum number of output bytes * \param done address to store the number of actually decoded bytes to * \return error/message code (watch out especially for MPG123_NEED_MORE) * |
proc_mpg123_decode_frame = function(mh: pmpg123_handle; var num: offp; var audio: ptrp; var bytes: uintp): iresult; cdecl; |
Decode next MPEG frame to internal buffer * or read a frame and return after setting a new format. * \param num current frame offset gets stored there * \param audio This pointer is set to the internal buffer to read the decoded audio from. * \param bytes number of output bytes ready in the buffer * |
proc_mpg123_tell = function(mh: pmpg123_handle): uintp; cdecl; |
Returns the current position in samples. * On the next read, you'd get that sample. * |
proc_mpg123_tellframe = function(mh: pmpg123_handle): uintp; cdecl; |
Returns the frame number that the next read will give you data from. * |
proc_mpg123_tell_stream = function(mh: pmpg123_handle): offp; cdecl; |
Returns the current byte offset in the input stream. * |
proc_mpg123_seek = function(mh: pmpg123_handle; sampleoff: offp; whence: intp): offp; cdecl; |
Seek to a desired sample offset. * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. * \return The resulting offset >= 0 or error/message code * |
proc_mpg123_feedseek = function(mh: pmpg123_handle; sampleoff: offp; whence: intp; var input_offset: offp): offp; cdecl; |
Seek to a desired sample offset in data feeding mode. * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. * \param input_offset The position it expects to be at the * next time data is fed to mpg123_decode(). * \return The resulting offset >= 0 or error/message code * |
proc_mpg123_seek_frame = function(mh: pmpg123_handle; frameoff: offp; whence: intp): offp; cdecl; |
Seek to a desired MPEG frame index. * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. * \return The resulting offset >= 0 or error/message code * |
proc_mpg123_timeframe = function(mh: pmpg123_handle; sec: floatp): offp; cdecl; |
Return a MPEG frame offset corresponding to an offset in seconds. * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. * \return frame offset >= 0 or error/message code * |
poffp = ˆoffp; |
pointer to array of offsets |
proc_mpg123_index = function(mh: pmpg123_handle; var offsets: poffp; var step: offp; var fill: uintp): iresult; cdecl; |
Give access to the frame index table that is managed for seeking. * You are asked not to modify the values... unless you are really aware of what you are doing. * \param offsets pointer to the index array * \param step one index byte offset advances this many MPEG frames * \param fill number of recorded index offsets; size of the array * |
proc_mpg123_position = function(mh: pmpg123_handle; frame_offset: offp; buffered_bytes: offp; var current_frame: offp; var frames_left: offp; var current_seconds: floatp; var seconds_left: floatp): iresult; cdecl; |
Get information about current and remaining frames/seconds. * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! * You provide an offset (in frames) from now and a number of output bytes * served by libmpg123 but not yet played. You get the projected current frame * and seconds, as well as the remaining frames/seconds. This does _not_ care * about skipped samples due to gapless playback. * |
mpg123_channels = intp; |
* \defgroup mpg123_voleq mpg123 volume and equalizer |
proc_mpg123_eq = function(mh: pmpg123_handle; channel: mpg123_channels; band: intp; val: floatp): iresult; cdecl; |
Set the 32 Band Audio Equalizer settings. * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. * \param band The equaliser band to change (from 0 to 31) * \param val The (linear) adjustment factor. * |
proc_mpg123_geteq = function(mh: pmpg123_handle; channel: mpg123_channels; band: intp): floatp; cdecl; |
Get the 32 Band Audio Equalizer settings. * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. * \param band The equaliser band to change (from 0 to 31) * \return The (linear) adjustment factor. * |
proc_mpg123_reset_eq = function(mh: pmpg123_handle): iresult; cdecl; |
Reset the 32 Band Audio Equalizer settings to flat * |
proc_mpg123_volume = function(mh: pmpg123_handle; vol: floatp): iresult; cdecl; |
Set the absolute output volume including the RVA setting, * vol<0 just applies (a possibly changed) RVA setting. * |
proc_mpg123_volume_change = function(mh: pmpg123_handle; change: floatp): iresult; cdecl; |
Adjust output volume including the RVA setting by chosen amount * |
proc_mpg123_getvolume = function(mh: pmpg123_handle; var base: floatp; really: floatp; var rva_db: floatp): iresult; cdecl; |
Return current volume setting, the actual value due to RVA, and the RVA * adjustment itself. It's all as double float value to abstract the sample * format. The volume values are linear factors / amplitudes (not percent) * and the RVA value is in decibels. * |
mpg123_vbr_t = intp; |
Enumeration of the mode types of Variable Bitrate * |
mpg123_version = intp; |
Enumeration of the MPEG Versions * |
mpg123_mode = intp; |
Enumeration of the MPEG Audio mode. * Only the mono mode has 1 channel, the others have 2 channels. * |
mpg123_flags_t = intp; |
Enumeration of the MPEG Audio flag bits * |
pmpg123_frameinfo = ˆmpg123_frameinfo; |
Data structure for storing information about a frame of MPEG Audio * |
proc_mpg123_info = function(mh: pmpg123_handle; var mi: mpg123_frameinfo): iresult; cdecl; |
Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. * |
proc_mpg123_safe_buffer = function(): uintp; cdecl; |
Get the safe output buffer size for all cases (when you want to replace the internal buffer) * |
proc_mpg123_scan = function(mh: pmpg123_handle): iresult; cdecl; |
Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length * value is stored. Seek index will be filled. A seek back to current position * is performed. At all, this function refuses work when stream is * not seekable. * \return MPG123_OK or MPG123_ERR. * |
proc_mpg123_length = function(mh: pmpg123_handle): offp; cdecl; |
Return, if possible, the full (expected) length of current track in samples. * \return length >= 0 or MPG123_ERR if there is no length guess possible. * |
proc_mpg123_set_filesize = function(mh: pmpg123_handle; size: offp): iresult; cdecl; |
Override the value for file size in bytes. * Useful for getting sensible track length values in feed mode or for HTTP streams. * \return MPG123_OK or MPG123_ERR * |
proc_mpg123_tpf = function(mh: pmpg123_handle): floatp; cdecl; |
Returns the time (seconds) per frame; <0 is error. * |
proc_mpg123_clip = function(mh: pmpg123_handle): iresult; cdecl; |
Get and reset the clip count. * |
mpg123_state = intp; |
The key values for state information from mpg123_getstate(). * |
proc_mpg123_getstate = function(mh: pmpg123_handle; key: mpg123_state; var val: intp; var fval: floatp): iresult; cdecl; |
Get various current decoder/stream state information. * \param key the key to identify the information to give. * \param val the address to return (long) integer values to * \param fval the address to return floating point values to * \return MPG123_OK or MPG123_ERR for success * |
pmpg123_string = ˆmpg123_string; |
Data structure for storing strings in a safer way than a standard C-String. * Can also hold a number of null-terminated strings. * |
proc_mpg123_init_string = procedure(sb: pmpg123_string); cdecl; |
Create and allocate memory for a new mpg123_string * |
proc_mpg123_free_string = procedure(sb: pmpg123_string); cdecl; |
Free-up mempory for an existing mpg123_string * |
proc_mpg123_resize_string = function(sb: pmpg123_string; news: uintp): iresult; cdecl; |
Change the size of a mpg123_string * \return 0 on error, 1 on success * |
proc_mpg123_grow_string = function(sb: pmpg123_string; news: uintp): iresult; cdecl; |
Increase size of a mpg123_string if necessary (it may stay larger). * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). * That way, you can preallocate memory and safely work afterwards with pieces. * \return 0 on error, 1 on success * |
proc_mpg123_copy_string = function(from: pmpg123_string; _to: pmpg123_string): iresult; cdecl; |
Copy the contents of one mpg123_string string to another. * \return 0 on error, 1 on success * |
proc_mpg123_add_string = function(sb: pmpg123_string; stuff: charp): iresult; cdecl; |
Append a C-String to an mpg123_string * \return 0 on error, 1 on success * |
proc_mpg123_add_substring = function(sb: pmpg123_string; stuff: charp; from, count: uintp): iresult; cdecl; |
Append a C-substring to an mpg123 string * \return 0 on error, 1 on success * \param from offset to copy from * \param count number of characters to copy (a null-byte is always appended) * |
proc_mpg123_set_string = function(sb: pmpg123_string; stuff: charp): iresult; cdecl; |
Set the conents of a mpg123_string to a C-string * \return 0 on error, 1 on success * |
proc_mpg123_set_substring = function(sb: pmpg123_string; stuff: charp; from, count: uintp): iresult; cdecl; |
Set the contents of a mpg123_string to a C-substring * \return 0 on error, 1 on success * \param from offset to copy from * \param count number of characters to copy (a null-byte is always appended) * |
pmpg123_text = ˆmpg123_text; |
Sub data structure for ID3v2, for storing various text fields (including comments). * This is for ID3v2 COMM, TXXX and all the other text fields. * Only COMM and TXXX have a description, only COMM has a language. * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). * |
pmpg123_id3v2 = ˆmpg123_id3v2; |
Data structure for storing IDV3v2 tags. * This structure is not a direct binary mapping with the file contents. * The ID3v2 text frames are allowed to contain multiple strings. * So check for null bytes until you reach the mpg123_string fill. * All text is encoded in UTF-8. * |
pmpg123_id3v1 = ˆmpg123_id3v1; |
Data structure for ID3v1 tags (the last 128 bytes of a file). * Don't take anything for granted (like string termination)! * Also note the change ID3v1.1 did: comment[28] = 0; comment[19] = track_number * It is your task to support ID3v1 only or ID3v1.1 ...* |
proc_mpg123_meta_check = function(mh: pmpg123_handle): iresult; cdecl; |
Query if there is (new) meta info, be it ID3 or ICY (or something new in future). The check function returns a combination of flags. * |
proc_mpg123_id3 = function(mh: pmpg123_handle; var v1: pmpg123_id3v1; var v2: mpg123_id3v2): iresult; cdecl; |
Point v1 and v2 to existing data structures wich may change on any next read/decode function call. * v1 and/or v2 can be set to NULL when there is no corresponding data. * \return Return value is MPG123_OK or MPG123_ERR, * |
proc_mpg123_icy = function(mh: pmpg123_handle; var icy_meta: charp): iresult; cdecl; |
Point icy_meta to existing data structure wich may change on any next read/decode function call. * \return Return value is MPG123_OK or MPG123_ERR, * |
proc_mpg123_icy2utf8 = function(icy_text: charp): charp; cdecl; |
Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. * \param icy_text The input data in ICY encoding * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) * |
pmpg123_pars = ˆmpg123_pars; |
Opaque structure for the libmpg123 decoder parameters. * |
proc_mpg123_parnew = function(mp: pmpg123_pars; decoder: charp; var error: intp): pmpg123_handle; cdecl; |
Create a handle with preset parameters. * |
proc_mpg123_new_pars = function(var error: intp): pmpg123_pars; cdecl; |
Allocate memory for and return a pointer to a new mpg123_pars * |
proc_mpg123_delete_pars = procedure(mp: pmpg123_pars); cdecl; |
Delete and free up memory used by a mpg123_pars data structure * |
proc_mpg123_fmt_none = function(mp: pmpg123_pars): iresult; cdecl; |
Configure mpg123 parameters to accept no output format at all, * use before specifying supported formats with mpg123_format * |
proc_mpg123_fmt_all = function(mp: pmpg123_pars): iresult; cdecl; |
Configure mpg123 parameters to accept all formats * (also any custom rate you may set) – this is default. * |
proc_mpg123_fmt = function(mp: pmpg123_pars; rate, channels, encodings: intp): iresult; cdecl; |
Set the audio format support of a mpg123_pars in detail: \param rate The sample rate value (in Hertz). \param channels A combination of MPG123_STEREO and MPG123_MONO. \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). \return 0 on success, -1 if there was an error. / * |
proc_mpg123_fmt_support = function(mp: pmpg123_pars; rate, encoding: intp): iresult; cdecl; |
Check to see if a specific format at a specific rate is supported * by mpg123_pars. * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, * MPG123_MONO or MPG123_STEREO|MPG123_MONO. * |
proc_mpg123_par = function(mp: pmpg123_pars; _type: mpg123_parms; value: intp; fvalue: floatp): iresult; cdecl; |
Set a specific parameter, for a specific mpg123_pars, using a parameter * type key chosen from the mpg123_parms enumeration, to the specified value. * |
proc_mpg123_getpar = function(mp: pmpg123_pars; _type: mpg123_parms; var val: intp; var fval: floatp): iresult; cdecl; |
Get a specific parameter, for a specific mpg123_pars. * See the mpg123_parms enumeration for a list of available parameters. * |
proc_mpg123_replace_buffer = function(mh: pmpg123_handle; data: ptrp; size: uintp): iresult; cdecl; |
Replace default internal buffer with user-supplied buffer. * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. * |
proc_mpg123_outblock = function(mh: pmpg123_handle): uintp; cdecl; |
The max size of one frame's decoded output with current settings. * Use that to determine an appropriate minimum buffer size for decoding one frame. * |
proc_POSIX_read = function (handle: intp; buf: pointer; size: uintp): intp; cdecl; |
proc_POSIX_seek = function (handle: intp; offs: offp; some: intp): offp; cdecl; |
proc_mpg123_replace_reader = function(mh: pmpg123_handle; read_proc: proc_POSIX_read; seek_proc: proc_POSIX_seek): iresult; cdecl; |
Replace low-level stream access functions; read and lseek as known in POSIX. * You can use this to make any fancy file opening/closing yourself, * using open_fd to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). * Setting a function to NULL means that the default internal read is * used (active from next mpg123_open call on). * |
plibmpg123_proto = ˆlibmpg123_proto; |
libmpg123 prototype – |
mpglibDataAvailEvent = procedure(sender: tObject; data: pointer; size: unsigned; var copyToStream: bool) of object; |
– – |
mpglibApplySamplingEvent = procedure(sender: tObject; rate, bits, channels: unsigned) of object; |
copyToStream is not used |
unaLibmpg123_onFormatChange = procedure(sender: tObject; rate, numChannels, numBits, encoding: int) of object; |
OnFormatChange prototype
Parameters
|
AUDIOBUFSIZE = 16384; |
AUDIOBUFSIZE = n*64 with n=1,2,3 ... */ |
freqs: array[0..8] of unsigned =
(
44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000
); |
MAXFRAMESIZE = 1792; |
MP3_ERR = -1; |
MP3_NEED_MORE = 1; |
MP3_OK = 0; |
sync_bitstream: int; error codes |
MPG123_1_0 = 0; |
MPG123_2_0 = 1; |
*< MPEG Version 1.0 */ |
MPG123_2_5 = 2; |
*< MPEG Version 2.0 */ |
MPG123_ABR = 2; |
*< Variable Bitrate Mode */ |
MPG123_ACCURATE = 1; |
MPG123_ADD_FLAGS = 2; |
*< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ |
MPG123_BAD_ALIGN = 30; |
*< No 8bit encoding possible. */ |
MPG123_BAD_BAND = 16; |
*< Incompatible numeric data types. */ |
MPG123_BAD_BUFFER = 6; |
*< Bad parameter id! */ |
MPG123_BAD_CHANNEL = 2; |
*< Unable to set up output format! */ |
MPG123_BAD_DECODER = 9; |
*< You didn't initialize the library! */ |
MPG123_BAD_FILE = 22; |
*< Build does not support stream timeouts. */ |
MPG123_BAD_HANDLE = 10; |
*< Invalid decoder choice. */ |
MPG123_BAD_INDEX_PAR = 26; |
*< Bad parameter handle. */ |
MPG123_BAD_KEY = 34; |
*< You gave a null pointer somewhere where you shouldn't have. */ |
MPG123_BAD_OUTFORMAT = 1; |
*< Success */ |
MPG123_BAD_PARAM = 5; |
*< Unable to allocate memory for 16 to 8 converter table! */ |
MPG123_BAD_PARS = 25; |
*< No stream opened. */ |
MPG123_BAD_RATE = 3; |
*< Invalid channel number specified. */ |
MPG123_BAD_RVA = 12; |
*< Unable to initialize frame buffers (out of memory?). */ |
MPG123_BAD_TYPES = 15; |
*< Not enough buffer space. */ |
MPG123_BAD_WHENCE = 20; |
*< Cannot seek from end (end is not known). */ |
MPG123_CBR = 0; |
MPG123_COPYRIGHT = $2; |
*< The bitstream is error protected using 16-bit CRC. */ |
MPG123_CRC = $1; |
MPG123_DECODE_FRAMES = 9; |
*< start with this frame (skip frames before that, integer) */ |
MPG123_DONE = -12; |
MPG123_DOWNSPEED = 6; |
*< one of the RVA choices above (integer) */ |
MPG123_DOWN_SAMPLE = 4; |
*< when value > 0, force output rate to that value (integer) */ |
MPG123_ENC_16 = $040; |
*< 0000 0000 1111 Some 8 bit integer encoding. */ |
MPG123_ENC_32 = $100; |
*< 0000 0100 0000 Some 16 bit integer encoding. */ |
MPG123_ENC_8 = $00f; |
MPG123_ENC_ALAW_8 = $08; |
*< 0000 0000 0100 ulaw 8 bit*/ |
MPG123_ENC_ANY = MPG123_ENC_SIGNED_16 or MPG123_ENC_UNSIGNED_16 or MPG123_ENC_UNSIGNED_8
or MPG123_ENC_SIGNED_8 or MPG123_ENC_ULAW_8 or MPG123_ENC_ALAW_8
or MPG123_ENC_FLOAT_32 or MPG123_ENC_FLOAT_64; |
*< 0100 0000 0000 64bit float */ |
MPG123_ENC_FLOAT = $800; |
*< 0000 1000 0000 Some signed integer encoding. */ |
MPG123_ENC_FLOAT_32 = $200; |
*< 0001 0010 0000 unsigned 32 bit */ |
MPG123_ENC_FLOAT_64 = $400; |
*< 0010 0000 0000 32bit float */ |
MPG123_ENC_SIGNED = $080; |
*< 0001 0000 0000 Some 32 bit integer encoding. */ |
MPG123_ENC_SIGNED_16 = MPG123_ENC_16 or MPG123_ENC_SIGNED or $10; |
*< 1110 0000 0000 Some float encoding. */ |
MPG123_ENC_SIGNED_32 = MPG123_ENC_32 or MPG123_ENC_SIGNED or $10; |
*< 0000 0000 1000 alaw 8 bit */ |
MPG123_ENC_SIGNED_8 = MPG123_ENC_SIGNED or $02; |
*< 0000 0000 0001 unsigned 8 bit*/ |
MPG123_ENC_ULAW_8 = $04; |
*< 0000 1000 0010 signed 8 bit*/ |
MPG123_ENC_UNSIGNED_16 = MPG123_ENC_16 or $20; |
*< 0000 1101 0000 signed 16 bit */ |
MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32 or $20; |
*< 0001 1001 0000 signed 32 bit */ |
MPG123_ENC_UNSIGNED_8 = $01; |
*< 0000 0110 0000 unsigned 16 bit*/ |
MPG123_ERR = -1; |
*< Message: For feed reader: "Feed me more!" */ |
MPG123_ERR_16TO8TABLE = 4; |
*< Invalid sample rate specified. */ |
MPG123_ERR_NULL = 17; |
*< Bad equalizer band. */ |
MPG123_ERR_READER = 18; |
*< Null pointer given where valid storage address needed. */ |
MPG123_FLAGS = 1; |
*< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ |
MPG123_FORCE_8BIT = $10; |
*< 1000 Force stereo output. */ |
MPG123_FORCE_MONO = $7; |
MPG123_FORCE_RATE = 3; |
*< add some flags (integer) */ |
MPG123_FORCE_STEREO = $8; |
*< 0100 Force playback of mixed mono. */ |
MPG123_FUZZY = $200; |
*< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ |
MPG123_GAPLESS = $40; |
*< 00100000 Suppress any printouts (overrules verbose). */ |
MPG123_ICY = $c; |
*< 0001 There is ID3 info that changed since last call to mpg123_id3. */ |
MPG123_ICY_INTERVAL = 10; |
*< decode only this number of frames (integer) */ |
MPG123_ID3 = $3; |
*< Genre index. */ |
MPG123_INDEX_FAIL = 36; |
*< No frame index in this build. */ |
MPG123_INDEX_SIZE = 15; |
*< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). */ |
MPG123_LEFT =$1; |
MPG123_LR =$3; |
*< The Right Channel. */ |
MPG123_MONO = 1; |
MPG123_MONO_LEFT = $1; |
*< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ |
MPG123_MONO_MIX = $4; |
*< 0010 Force playback of right channel only. */ |
MPG123_MONO_RIGHT = $2; |
*< 0001 Force playback of left channel only. */ |
MPG123_M_DUAL = 2; |
*< Joint Stereo. */ |
MPG123_M_JOINT = 1; |
*< Standard Stereo. */ |
MPG123_M_MONO = 3; |
*< Dual Channel. */ |
MPG123_M_STEREO = 0; |
MPG123_NEED_MORE = -10; |
*< Message: Output format will be different on next call. */ |
MPG123_NEW_FORMAT = -11; |
*< Message: Track ended. */ |
MPG123_NEW_ICY = $4; |
*< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ |
MPG123_NEW_ID3 = $1; |
*< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ |
MPG123_NOT_INITIALIZED = 8; |
*< Out of memory – some malloc() failed. */ |
MPG123_NO_8BIT = 29; |
*< Resync failed to find valid MPEG data. */ |
MPG123_NO_BUFFERS = 11; |
*< Invalid mpg123 handle. */ |
MPG123_NO_GAPLESS = 13; |
*< Invalid RVA mode. */ |
MPG123_NO_INDEX = 35; |
*< Bad key value given. */ |
MPG123_NO_READER = 24; |
*< Seek not supported by stream. */ |
MPG123_NO_RELSEEK = 32; |
*< NULL input buffer with non-zero size... */ |
MPG123_NO_RESYNC = $80; |
*< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ |
MPG123_NO_SEEK = 23; |
*< File access error. */ |
MPG123_NO_SEEK_FROM_END = 19; |
*< Error reading the stream. */ |
MPG123_NO_SPACE = 14; |
*< This build doesn't support gapless decoding. */ |
MPG123_NO_TIMEOUT = 21; |
*< Invalid 'whence' for seek function.*/ |
MPG123_NULL_BUFFER = 31; |
*< Stack aligmnent error */ |
MPG123_NULL_POINTER = 33; |
*< Relative seek not possible (screwed up file offset) */ |
MPG123_OK = 0; |
*< Generic Error */ |
MPG123_ORIGINAL = $8; |
*< The private bit has been set. */ |
MPG123_OUTSCALE = 11; |
*< stream contains ICY metadata with this interval (integer) */ |
MPG123_OUT_OF_MEM = 7; |
*< Bad buffer given – invalid pointer or too small size. */ |
MPG123_OUT_OF_SYNC = 27; |
*< Bad parameters to mpg123_index() */ |
MPG123_PRIVATE = $4; |
*< The bitstream is copyrighted. */ |
MPG123_QUIET = $20; |
*< 00010000 Force 8bit formats. */ |
MPG123_REMOVE_FLAGS = 13; |
*< timeout for reading from a stream (not supported on win32, integer) */ |
MPG123_RESYNC_FAIL = 28; |
*< Lost track in bytestream and did not try to resync. */ |
MPG123_RESYNC_LIMIT = 14; |
*< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ |
MPG123_RIGHT =$2; |
*< The Left Channel. */ |
MPG123_RVA = 5; |
*< 0=native rate, 1=half rate, 2=quarter rate (integer) */ |
MPG123_RVA_ALBUM = 2; |
*< Use mix/track/radio gain. */ |
MPG123_RVA_MAX = MPG123_RVA_ALBUM; |
*< Use album/audiophile gain */ |
MPG123_RVA_MIX = 1; |
*< RVA disabled (default). */ |
MPG123_RVA_OFF = 0; |
MPG123_SEEKBUFFER = $100; |
*< 10000000 Disable resync stream after error. */ |
MPG123_START_FRAME = 8; |
*< play every Nth frame (integer) */ |
MPG123_STEREO = 2; |
MPG123_TIMEOUT = 12; |
*< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ |
MPG123_UPSPEED = 7; |
*< play a frame N times (integer) */ |
MPG123_VBR = 1; |
*< Constant Bitrate Mode (default) */ |
MPG123_VERBOSE = 0; |
mpglib_error_general = MP3_ERR; |
mpglib_error_initFail = -12; |
mpglib_error_more = MP3_NEED_MORE; |
mpglib_error_noLib = -10; |
mpglib_error_noProc = -11; |
mpglib_error_OK = MP3_OK; |
additional |
MPG_MD_DUAL_CHANNEL = 2; |
MPG_MD_JOINT_STEREO = 1; |
MPG_MD_MONO = 3; |
MPG_MD_STEREO = 0; |
Layer 2 */ |
M_PI = 3.14159265358979323846; |
————– mpg123.h ————– |
M_SQRT2 = 1.41421356237309504880; |
SBLIMIT = 32; |
SCALE_BLOCK = 12; |
SSLIMIT = 18; |
tabsel_123: array[0..1, 0..2, 0..15] of unsigned = (
(
(0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0),
(0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 0),
(0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 0)
),
(
(0, 32,48,56,64,80,96,112,128,144,160,176,192,224,256, 0),
(0, 8, 16,24,32,40,48, 56, 64, 80, 96,112,128,144,160, 0),
(0, 8, 16,24,32,40,48, 56, 64, 80, 96,112,128,144,160, 0)
)
); |
—— common.c ———— |
(c) 2012 Lake of Soft