mpg123 logo
download : svn :: features :: sf.net project - bug tracker :: news archive
libmpg123 API :: hacking :: testing :: benchmarking :: FAQ :: links :: contact
Note: This API doc is automatically generated from the current development version that you can get via Subversion or as a daily snapshot from http://mpg123.org/snapshot. There may be differences (additions) compared to the latest stable release. See NEWS.libmpg123 and the overall NEWS file on libmpg123 versions and important changes between them.
Let me emphasize that the policy for libmpg123 is to always stay backwards compatible -- only additions are planned (and it's not yet planned to change the plans;-).

mpg123 status and information


Data Structures

struct  mpg123_frameinfo

Enumerations

enum  mpg123_vbr {
  MPG123_CBR = 0, MPG123_VBR,
  MPG123_ABR
}
enum  mpg123_version {
  MPG123_1_0 = 0, MPG123_2_0,
  MPG123_2_5
}
enum  mpg123_mode {
  MPG123_M_STEREO = 0, MPG123_M_JOINT,
  MPG123_M_DUAL, MPG123_M_MONO
}
enum  mpg123_flags {
  MPG123_CRC = 0x1, MPG123_COPYRIGHT = 0x2,
  MPG123_PRIVATE = 0x4, MPG123_ORIGINAL = 0x8
}
enum  mpg123_state { MPG123_ACCURATE = 1, MPG123_BUFFERFILL }

Functions

int mpg123_info (mpg123_handle *mh, struct mpg123_frameinfo *mi)
size_t mpg123_safe_buffer (void)
int mpg123_scan (mpg123_handle *mh)
off_t mpg123_length (mpg123_handle *mh)
int mpg123_set_filesize (mpg123_handle *mh, off_t size)
double mpg123_tpf (mpg123_handle *mh)
int mpg123_spf (mpg123_handle *mh)
long mpg123_clip (mpg123_handle *mh)
int mpg123_getstate (mpg123_handle *mh, enum mpg123_state key, long *val, double *fval)

Enumeration Type Documentation

enum mpg123_vbr

Enumeration of the mode types of Variable Bitrate

Enumerator:
MPG123_CBR  Constant Bitrate Mode (default)
MPG123_VBR  Variable Bitrate Mode
MPG123_ABR  Average Bitrate Mode

Definition at line 681 of file mpg123.h.

Enumeration of the MPEG Versions

Enumerator:
MPG123_1_0  MPEG Version 1.0
MPG123_2_0  MPEG Version 2.0
MPG123_2_5  MPEG Version 2.5

Definition at line 688 of file mpg123.h.

Enumeration of the MPEG Audio mode. Only the mono mode has 1 channel, the others have 2 channels.

Enumerator:
MPG123_M_STEREO  Standard Stereo.
MPG123_M_JOINT  Joint Stereo.
MPG123_M_DUAL  Dual Channel.
MPG123_M_MONO  Single Channel.

Definition at line 697 of file mpg123.h.

Enumeration of the MPEG Audio flag bits

Enumerator:
MPG123_CRC  The bitstream is error protected using 16-bit CRC.
MPG123_COPYRIGHT  The bitstream is copyrighted.
MPG123_PRIVATE  The private bit has been set.
MPG123_ORIGINAL  The bitstream is an original, not a copy.

Definition at line 706 of file mpg123.h.

The key values for state information from mpg123_getstate().

Enumerator:
MPG123_ACCURATE  Query if positons are currently accurate (integer value, 0 if false, 1 if true)
MPG123_BUFFERFILL  Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine.

Definition at line 763 of file mpg123.h.


Function Documentation

int mpg123_info ( mpg123_handle mh,
struct mpg123_frameinfo mi 
)

Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure.

size_t mpg123_safe_buffer ( void   ) 

Get the safe output buffer size for all cases (when you want to replace the internal buffer)

int mpg123_scan ( mpg123_handle mh  ) 

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.

Returns:
MPG123_OK or MPG123_ERR.

off_t mpg123_length ( mpg123_handle mh  ) 

Return, if possible, the full (expected) length of current track in samples.

Returns:
length >= 0 or MPG123_ERR if there is no length guess possible.

int mpg123_set_filesize ( mpg123_handle mh,
off_t  size 
)

Override the value for file size in bytes. Useful for getting sensible track length values in feed mode or for HTTP streams.

Returns:
MPG123_OK or MPG123_ERR

double mpg123_tpf ( mpg123_handle mh  ) 

Returns the time (seconds) per frame; <0 is error.

int mpg123_spf ( mpg123_handle mh  ) 

Returns the samples per frame for the most recently parsed frame; <0 is error.

long mpg123_clip ( mpg123_handle mh  ) 

Get and reset the clip count.

int mpg123_getstate ( mpg123_handle mh,
enum mpg123_state  key,
long *  val,
double *  fval 
)

Get various current decoder/stream state information.

Parameters:
key the key to identify the information to give.
val the address to return (long) integer values to
fval the address to return floating point values to
Returns:
MPG123_OK or MPG123_ERR for success


Generated on Mon Feb 6 01:07:21 2012 for libmpg123 by  doxygen 1.5.6