You could access this page securely.

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;-).
out123.h
Go to the documentation of this file.
1 /*
2  out123: audio output interface
3 
4  copyright 1995-2016 by the mpg123 project,
5  free software under the terms of the LGPL 2.1
6 
7  see COPYING and AUTHORS files in distribution or http://mpg123.org
8  initially written as audio.h by Michael Hipp, reworked into out123 API
9  by Thomas Orgis
10 */
11 
12 #ifndef _OUT123_H_
13 #define _OUT123_H_
14 
17 /* We only need size_t definition. */
18 #include <stddef.h>
19 
20 /* Common audio encoding specification, including a macro for getting
21  * size of encoded samples in bytes. Said macro is still hardcoded
22  * into out123_encsize(). Relying on this one may help an old program
23  * know sizes of encodings added to fmt123.h later on.
24  * If you don't care, just use the macro.
25  */
26 #include <fmt123.h>
27 
32 #ifndef OUT123_API_VERSION
33 #define OUT123_API_VERSION 2
34 #endif
35 
36 #ifndef MPG123_EXPORT
37 
44 #ifdef BUILD_MPG123_DLL
45 /* The dll exports. */
46 #define MPG123_EXPORT __declspec(dllexport)
47 #else
48 #ifdef LINK_MPG123_DLL
49 /* The exe imports. */
50 #define MPG123_EXPORT __declspec(dllimport)
51 #else
52 /* Nothing on normal/UNIX builds */
53 #define MPG123_EXPORT
54 #endif
55 #endif
56 #endif
57 
58 /* Earlier versions of libout123 put enums into public API calls,
59  * thich is not exactly safe. There are ABI rules, but you can use
60  * compiler switches to change the sizes of enums. It is safer not
61  * to have them in API calls. Thus, the default is to remap calls and
62  * structs to variants that use plain ints. Define MPG123_ENUM_API to
63  * prevent that remapping.
64  *
65  * You might want to define this to increase the chance of your binary
66  * working with an older version of the library. But if that is your goal,
67  * you should better build with an older version to begin with.
68  */
69 #ifndef MPG123_ENUM_API
70 
71 #define out123_param out123_param2
72 #define out123_getparam out123_getparam2
73 
74 #endif
75 
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79 
117 struct out123_struct;
119 typedef struct out123_struct out123_handle;
120 
123 {
148 };
149 
152 {
156 , OUT123_QUIET = 0x08
167 , OUT123_MUTE = 0x20
168 };
169 
172 {
181 };
182 
190 
195 void out123_del(out123_handle *ao);
196 
202 MPG123_EXPORT void out123_free(void *ptr);
203 
211 {
213 , OUT123_OK = 0
232 };
233 
240 const char* out123_strerror(out123_handle *ao);
241 
250 
256 const char* out123_plain_strerror(int errcode);
257 
290 int out123_set_buffer(out123_handle *ao, size_t buffer_bytes);
291 
292 #ifdef MPG123_ENUM_API
293 
311 int out123_param( out123_handle *ao, enum out123_parms code
312 , long value, double fvalue, const char *svalue );
313 #endif
314 
333 int out123_param2( out123_handle *ao, int code
334 , long value, double fvalue, const char *svalue );
335 
336 
338 #define out123_param_int(ao, code, value) \
339  out123_param((ao), (code), (value), 0., NULL)
340 
341 #define out123_param_float(ao, code, value) \
342  out123_param((ao), (code), 0, (value), NULL)
343 
344 #define out123_param_string(ao, code, value) \
345  out123_param((ao), (code), 0, 0., (value))
346 
347 #ifdef MPG123_ENUM_API
348 
362 int out123_getparam( out123_handle *ao, enum out123_parms code
363 , long *ret_value, double *ret_fvalue, char* *ret_svalue );
364 #endif
365 
380 int out123_getparam2( out123_handle *ao, int code
381 , long *ret_value, double *ret_fvalue, char* *ret_svalue );
382 
384 #define out123_getparam_int(ao, code, value) \
385  out123_getparam((ao), (code), (value), NULL, NULL)
386 
387 #define out123_getparam_float(ao, code, value) \
388  out123_getparam((ao), (code), NULL, (value), NULL)
389 
390 #define out123_getparam_string(ao, code, value) \
391  out123_getparam((ao), (code), NULL, NULL, (value))
392 
400 
418 int out123_drivers(out123_handle *ao, char ***names, char ***descr);
419 
449 int out123_devices( out123_handle *ao, const char *driver
450 , char ***names, char ***descr, char **active_driver );
451 
464 void out123_stringlists_free(char **name, char **descr, int count);
465 
466 
480 int out123_open(out123_handle *ao, const char* driver, const char* device);
481 
494 int out123_driver_info(out123_handle *ao, char **driver, char **device);
495 
505 void out123_close(out123_handle *ao);
506 
525 int out123_encodings(out123_handle *ao, long rate, int channels);
526 
530 MPG123_EXPORT int out123_encsize(int encoding);
531 
561 int out123_formats( out123_handle *ao, const long *rates, int ratecount
562  , int minchannels, int maxchannels
563  , struct mpg123_fmt **fmtlist );
564 
571 int out123_enc_list(int **enclist);
572 
578 int out123_enc_byname(const char *name);
579 
585 const char* out123_enc_name(int encoding);
586 
592 const char* out123_enc_longname(int encoding);
593 
608 , long rate, int channels, int encoding );
609 
618 void out123_pause(out123_handle *ao);
619 
632 
640 void out123_stop(out123_handle *ao);
641 
659 size_t out123_play( out123_handle *ao
660  , void *buffer, size_t bytes );
661 
672 void out123_drop(out123_handle *ao);
673 
682 void out123_drain(out123_handle *ao);
683 
702 void out123_ndrain(out123_handle *ao, size_t bytes);
703 
711 size_t out123_buffered(out123_handle *ao);
712 
725 , long *rate, int *channels, int *encoding, int *framesize );
726 
729 #ifdef __cplusplus
730 }
731 #endif
732 
733 #endif
734 
MPG123_EXPORT size_t out123_play(out123_handle *ao, void *buffer, size_t bytes)
MPG123_EXPORT int out123_formats(out123_handle *ao, const long *rates, int ratecount, int minchannels, int maxchannels, struct mpg123_fmt **fmtlist)
struct out123_struct out123_handle
Definition: out123.h:119
out123_propflags
Definition: out123.h:171
MPG123_EXPORT int out123_enc_byname(const char *name)
MPG123_EXPORT void out123_pause(out123_handle *ao)
MPG123_EXPORT int out123_param2(out123_handle *ao, int code, long value, double fvalue, const char *svalue)
MPG123_EXPORT void out123_ndrain(out123_handle *ao, size_t bytes)
MPG123_EXPORT int out123_open(out123_handle *ao, const char *driver, const char *device)
out123_error
Definition: out123.h:210
MPG123_EXPORT int out123_enc_list(int **enclist)
MPG123_EXPORT int out123_encsize(int encoding)
MPG123_EXPORT int out123_errcode(out123_handle *ao)
MPG123_EXPORT int out123_drivers(out123_handle *ao, char ***names, char ***descr)
MPG123_EXPORT int out123_set_buffer(out123_handle *ao, size_t buffer_bytes)
MPG123_EXPORT int out123_driver_info(out123_handle *ao, char **driver, char **device)
MPG123_EXPORT void out123_drain(out123_handle *ao)
MPG123_EXPORT void out123_close(out123_handle *ao)
MPG123_EXPORT int out123_param_from(out123_handle *ao, out123_handle *from_ao)
out123_flags
Definition: out123.h:151
MPG123_EXPORT void out123_stop(out123_handle *ao)
MPG123_EXPORT const char * out123_plain_strerror(int errcode)
MPG123_EXPORT void out123_del(out123_handle *ao)
MPG123_EXPORT void out123_drop(out123_handle *ao)
MPG123_EXPORT const char * out123_strerror(out123_handle *ao)
MPG123_EXPORT int out123_getformat(out123_handle *ao, long *rate, int *channels, int *encoding, int *framesize)
out123_parms
Definition: out123.h:122
MPG123_EXPORT int out123_getparam(out123_handle *ao, enum out123_parms code, long *ret_value, double *ret_fvalue, char **ret_svalue)
MPG123_EXPORT int out123_getparam2(out123_handle *ao, int code, long *ret_value, double *ret_fvalue, char **ret_svalue)
MPG123_EXPORT int out123_start(out123_handle *ao, long rate, int channels, int encoding)
MPG123_EXPORT void out123_free(void *ptr)
MPG123_EXPORT int out123_devices(out123_handle *ao, const char *driver, char ***names, char ***descr, char **active_driver)
MPG123_EXPORT void out123_stringlists_free(char **name, char **descr, int count)
#define MPG123_EXPORT
Definition: out123.h:53
MPG123_EXPORT out123_handle * out123_new(void)
MPG123_EXPORT void out123_continue(out123_handle *ao)
MPG123_EXPORT int out123_param(out123_handle *ao, enum out123_parms code, long value, double fvalue, const char *svalue)
MPG123_EXPORT int out123_encodings(out123_handle *ao, long rate, int channels)
MPG123_EXPORT const char * out123_enc_longname(int encoding)
MPG123_EXPORT size_t out123_buffered(out123_handle *ao)
MPG123_EXPORT const char * out123_enc_name(int encoding)
Hopefully valid HTML! Valid CSS!