# API documentation for libmpg123, libout123, and libsyn123

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, NEWS.libout123, NEWS.libsyn123, and the overall NEWS file on libmpg123 versions and important changes between them.
Let me emphasize that the policy for the lib*123 family is to always stay backwards compatible -- only additions are planned (and it's not yet planned to change the plans;-).
fmt123.h
Go to the documentation of this file.
1 /*
2 libmpg123: MPEG Audio Decoder library
3
4 separate header just for audio format definitions not tied to
5 library code
6
7 copyright 1995-2020 by the mpg123 project
8 free software under the terms of the LGPL 2.1
9 see COPYING and AUTHORS files in distribution or http://mpg123.org
10 */
11
12 #ifndef MPG123_ENC_H
13 #define MPG123_ENC_H
14
43 enum mpg123_enc_enum
44 {
45 /* 0000 0000 0000 1111 Some 8 bit integer encoding. */
46 MPG123_ENC_8 = 0x00f
47 /* 0000 0000 0100 0000 Some 16 bit integer encoding. */
48 , MPG123_ENC_16 = 0x040
49 /* 0100 0000 0000 0000 Some 24 bit integer encoding. */
50 , MPG123_ENC_24 = 0x4000
51 /* 0000 0001 0000 0000 Some 32 bit integer encoding. */
52 , MPG123_ENC_32 = 0x100
53 /* 0000 0000 1000 0000 Some signed integer encoding. */
54 , MPG123_ENC_SIGNED = 0x080
55 /* 0000 1110 0000 0000 Some float encoding. */
56 , MPG123_ENC_FLOAT = 0xe00
57 /* 0000 0000 1101 0000 signed 16 bit */
58 , MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10)
59 /* 0000 0000 0110 0000 unsigned 16 bit */
60 , MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20)
61 /* 0000 0000 0000 0001 unsigned 8 bit */
62 , MPG123_ENC_UNSIGNED_8 = 0x01
63 /* 0000 0000 1000 0010 signed 8 bit */
64 , MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02)
65 /* 0000 0000 0000 0100 ulaw 8 bit */
66 , MPG123_ENC_ULAW_8 = 0x04
67 /* 0000 0000 0000 1000 alaw 8 bit */
68 , MPG123_ENC_ALAW_8 = 0x08
69 /* 0001 0001 1000 0000 signed 32 bit */
70 , MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000
71 /* 0010 0001 0000 0000 unsigned 32 bit */
72 , MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000
73 /* 0101 0000 1000 0000 signed 24 bit */
74 , MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000
75 /* 0110 0000 0000 0000 unsigned 24 bit */
76 , MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000
77 /* 0000 0010 0000 0000 32bit float */
78 , MPG123_ENC_FLOAT_32 = 0x200
79 /* 0000 0100 0000 0000 64bit float */
80 , MPG123_ENC_FLOAT_64 = 0x400
81 /* Any possibly known encoding from the list above. */
82 , MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16
83 | MPG123_ENC_UNSIGNED_8 | MPG123_ENC_SIGNED_8
84 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8
85 | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32
86 | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24
87 | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 )
88 };
89
101 #define MPG123_SAMPLESIZE(enc) ( \
102 (enc) < 1 \
103 ? 0 \
104 : ( (enc) & MPG123_ENC_8 \
105 ? 1 \
106 : ( (enc) & MPG123_ENC_16 \
107 ? 2 \
108 : ( (enc) & MPG123_ENC_24 \
109 ? 3 \
110 : ( ( (enc) & MPG123_ENC_32 \
111 || (enc) == MPG123_ENC_FLOAT_32 ) \
112 ? 4 \
113 : ( (enc) == MPG123_ENC_FLOAT_64 \
114 ? 8 \
115 : 0 \
116 ) ) ) ) ) )
117
130 #define MPG123_ZEROSAMPLE(enc, siz, off) ( \
131 (enc) == MPG123_ENC_ULAW_8 \
132 ? (off == 0 ? 0xff : 0x00) \
133 : ( (enc) == MPG123_ENC_ALAW_8 \
134 ? (off == 0 ? 0xd5 : 0x00) \
135 : ( (((enc) & (MPG123_ENC_SIGNED|MPG123_ENC_FLOAT)) || (siz) != ((off)+1)) \
136 ? 0x00 \
137 : 0x80 \
138 ) ) )
139
147 struct mpg123_fmt
148 {
149 long rate;
150 int channels;
153 int encoding;
154 };
155
158 #endif
159
mpg123_fmt::rate
long rate
Definition: fmt123.h:149
mpg123_fmt::encoding
int encoding
Definition: fmt123.h:153
mpg123_enc_enum
mpg123_enc_enum
Definition: fmt123.h:43
mpg123_fmt
Definition: fmt123.h:147
mpg123_fmt::channels
int channels
Definition: fmt123.h:150