27#if defined(__cplusplus)
33#pragma GCC system_header
37#define LSX_GCC(maj, min) \
38 ((__GNUC__ > (maj)) || (__GNUC__ == (maj) && __GNUC_MINOR__ >= (min)))
40#define LSX_GCC(maj, min) 0
44#define _Ret_ __attribute__ ((returns_nonnull))
45#define _Ret_valid_ _Ret_
61#if defined __GNUC__ && defined __i386__
62#define LSX_API __attribute__ ((cdecl))
64#define LSX_API __cdecl
75#define LSX_UNUSED __attribute__ ((unused))
87#define LSX_PRINTF12 __attribute__ ((format (printf, 1, 2)))
99#define LSX_RETURN_PURE __attribute__ ((pure))
101#define LSX_RETURN_PURE
110#define LSX_RETURN_VALID _Ret_
112#define LSX_RETURN_VALID
121#define LSX_RETURN_ARRAY _Ret_valid_
123#define LSX_RETURN_ARRAY
132#define LSX_RETURN_VALID_Z _Ret_z_
134#define LSX_RETURN_VALID_Z
143#define LSX_RETURN_OPT _Ret_opt_
145#define LSX_RETURN_OPT
154#define LSX_PARAM_IN _In_
165#define LSX_PARAM_IN_Z _In_z_
167#define LSX_PARAM_IN_Z
175#ifdef _Printf_format_string_
176#define LSX_PARAM_IN_PRINTF _Printf_format_string_
178#define LSX_PARAM_IN_PRINTF
189#define LSX_PARAM_IN_COUNT(len) _In_count_(len)
191#define LSX_PARAM_IN_COUNT(len)
202#define LSX_PARAM_IN_BYTECOUNT(len) _In_bytecount_(len)
204#define LSX_PARAM_IN_BYTECOUNT(len)
213#define LSX_PARAM_IN_OPT _In_opt_
215#define LSX_PARAM_IN_OPT
224#define LSX_PARAM_IN_OPT_Z _In_opt_z_
226#define LSX_PARAM_IN_OPT_Z
236#define LSX_PARAM_INOUT _Inout_
238#define LSX_PARAM_INOUT
248#ifdef _Inout_count_x_
249#define LSX_PARAM_INOUT_COUNT(len) _Inout_count_x_(len)
251#define LSX_PARAM_INOUT_COUNT(len)
261#define LSX_PARAM_OUT _Out_
275#define LSX_PARAM_OUT_BYTECAP(len) _Out_bytecap_(len)
277#define LSX_PARAM_OUT_BYTECAP(len)
292#ifdef _Out_cap_post_count_
293#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) _Out_cap_post_count_(len,filled)
295#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled)
310#ifdef _Out_z_cap_post_count_
311#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) _Out_z_cap_post_count_(len,filled)
313#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled)
323#define LSX_PARAM_OUT_OPT _Out_opt_
325#define LSX_PARAM_OUT_OPT
334#ifdef _Deref_pre_maybenull_
335#define LSX_PARAM_DEREF_PRE_MAYBENULL _Deref_pre_maybenull_
337#define LSX_PARAM_DEREF_PRE_MAYBENULL
346#ifdef _Deref_post_null_
347#define LSX_PARAM_DEREF_POST_NULL _Deref_post_null_
349#define LSX_PARAM_DEREF_POST_NULL
358#ifdef _Deref_post_notnull_
359#define LSX_PARAM_DEREF_POST_NOTNULL _Deref_post_notnull_
361#define LSX_PARAM_DEREF_POST_NOTNULL
370#define LSX_USE_VAR(x) ((void)(x=0))
372#define LSX_USE_VAR(x) ((void)(x))
381#define lsx_static_assert(e,f) enum {lsx_static_assert_##f = 1/((e) ? 1 : 0)}
613#define SOX_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
621#define SOX_LIB_VERSION_CODE SOX_LIB_VERSION(14, 4, 2)
632#define SOX_INT_MIN(bits) (1 <<((bits)-1))
643#define SOX_INT_MAX(bits) (((unsigned)-1)>>(33-(bits)))
654#define SOX_UINT_MAX(bits) (SOX_INT_MIN(bits)|SOX_INT_MAX(bits))
660#define SOX_INT8_MAX SOX_INT_MAX(8)
666#define SOX_INT16_MAX SOX_INT_MAX(16)
672#define SOX_INT24_MAX SOX_INT_MAX(24)
678#define SOX_INT32_MAX SOX_INT_MAX(32)
684#define SOX_SAMPLE_PRECISION 32
690#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
696#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
727#define SOX_SAMPLE_LOCALS sox_sample_t sox_macro_temp_sample LSX_UNUSED; \
728 double sox_macro_temp_double LSX_UNUSED
734#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
744#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
745 (sox_uint##bits##_t)(SOX_SAMPLE_TO_SIGNED(bits,d,clips) ^ SOX_INT_MIN(bits))
755#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
756 (sox_int##bits##_t)( \
757 LSX_USE_VAR(sox_macro_temp_double), \
758 sox_macro_temp_sample = (d), \
759 sox_macro_temp_sample > SOX_SAMPLE_MAX - (1 << (31-bits)) ? \
760 ++(clips), SOX_INT_MAX(bits) : \
761 ((sox_uint32_t)(sox_macro_temp_sample + (1 << (31-bits)))) >> (32-bits))
770#define SOX_SIGNED_TO_SAMPLE(bits,d) ((sox_sample_t)(d) << (32-bits))
779#define SOX_UNSIGNED_TO_SAMPLE(bits,d) \
780 (SOX_SIGNED_TO_SAMPLE(bits,d) ^ SOX_SAMPLE_NEG)
789#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
798#define SOX_SIGNED_8BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(8,d)
807#define SOX_UNSIGNED_16BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(16,d)
816#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
825#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
834#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
843#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) \
844 ((sox_sample_t)(d) ^ SOX_SAMPLE_NEG)
853#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
862#define SOX_FLOAT_32BIT_TO_SAMPLE(d,clips) SOX_FLOAT_64BIT_TO_SAMPLE(d, clips)
871#define SOX_FLOAT_64BIT_TO_SAMPLE(d, clips) \
873 LSX_USE_VAR(sox_macro_temp_sample), \
874 sox_macro_temp_double = (d) * (SOX_SAMPLE_MAX + 1.0), \
875 sox_macro_temp_double < 0 ? \
876 sox_macro_temp_double <= SOX_SAMPLE_MIN - 0.5 ? \
877 ++(clips), SOX_SAMPLE_MIN : \
878 sox_macro_temp_double - 0.5 : \
879 sox_macro_temp_double >= SOX_SAMPLE_MAX + 0.5 ? \
880 sox_macro_temp_double > SOX_SAMPLE_MAX + 1.0 ? \
881 ++(clips), SOX_SAMPLE_MAX : \
883 sox_macro_temp_double + 0.5 \
892#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
900#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
908#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
916#define SOX_SAMPLE_TO_SIGNED_16BIT(d,clips) SOX_SAMPLE_TO_SIGNED(16,d,clips)
924#define SOX_SAMPLE_TO_UNSIGNED_24BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(24,d,clips)
932#define SOX_SAMPLE_TO_SIGNED_24BIT(d,clips) SOX_SAMPLE_TO_SIGNED(24,d,clips)
940#define SOX_SAMPLE_TO_UNSIGNED_32BIT(d,clips) (sox_uint32_t)((d)^SOX_SAMPLE_NEG)
948#define SOX_SAMPLE_TO_SIGNED_32BIT(d,clips) (sox_int32_t)(d)
956#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) ((d)*(1.0 / (SOX_SAMPLE_MAX + 1.0)))
964#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1.0 / (SOX_SAMPLE_MAX + 1.0)))
973#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
975 if (samp > SOX_SAMPLE_MAX) \
976 { samp = SOX_SAMPLE_MAX; clips++; } \
977 else if (samp < SOX_SAMPLE_MIN) \
978 { samp = SOX_SAMPLE_MIN; clips++; } \
989#define SOX_ROUND_CLIP_COUNT(d, clips) \
990 ((d) < 0? (d) <= SOX_SAMPLE_MIN - 0.5? ++(clips), SOX_SAMPLE_MIN: (d) - 0.5 \
991 : (d) >= SOX_SAMPLE_MAX + 0.5? ++(clips), SOX_SAMPLE_MAX: (d) + 0.5)
1002#define SOX_INTEGER_CLIP_COUNT(bits,i,clips) ( \
1003 (i) >(1 << ((bits)-1))- 1? ++(clips),(1 << ((bits)-1))- 1 : \
1004 (i) <-1 << ((bits)-1) ? ++(clips),-1 << ((bits)-1) : (i))
1014#define SOX_16BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(16,i,clips)
1024#define SOX_24BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(24,i,clips)
1026#define SOX_SIZE_MAX ((size_t)(-1))
1029#define SOX_UNKNOWN_LEN (sox_uint64_t)(-1)
1030#define SOX_IGNORE_LENGTH (sox_uint64_t)(-2)
1032#define SOX_DEFAULT_CHANNELS 2
1033#define SOX_DEFAULT_RATE 48000
1034#define SOX_DEFAULT_PRECISION 16
1035#define SOX_DEFAULT_ENCODING SOX_ENCODING_SIGN2
1037#define SOX_LOOP_NONE ((unsigned char)sox_loop_none)
1038#define SOX_LOOP_8 ((unsigned char)sox_loop_8)
1039#define SOX_LOOP_SUSTAIN_DECAY ((unsigned char)sox_loop_sustain_decay)
1041#define SOX_MAX_NLOOPS 8
1043#define SOX_FILE_NOSTDIO 0x0001
1044#define SOX_FILE_DEVICE 0x0002
1045#define SOX_FILE_PHONY 0x0004
1046#define SOX_FILE_REWIND 0x0008
1047#define SOX_FILE_BIT_REV 0x0010
1048#define SOX_FILE_NIB_REV 0x0020
1049#define SOX_FILE_ENDIAN 0x0040
1050#define SOX_FILE_ENDBIG 0x0080
1051#define SOX_FILE_MONO 0x0100
1052#define SOX_FILE_STEREO 0x0200
1053#define SOX_FILE_QUAD 0x0400
1055#define SOX_FILE_CHANS (SOX_FILE_MONO | SOX_FILE_STEREO | SOX_FILE_QUAD)
1056#define SOX_FILE_LIT_END (SOX_FILE_ENDIAN | 0)
1057#define SOX_FILE_BIG_END (SOX_FILE_ENDIAN | SOX_FILE_ENDBIG)
1059#define SOX_EFF_CHAN 1
1060#define SOX_EFF_RATE 2
1061#define SOX_EFF_PREC 4
1062#define SOX_EFF_LENGTH 8
1063#define SOX_EFF_MCHAN 16
1064#define SOX_EFF_NULL 32
1065#define SOX_EFF_DEPRECATED 64
1066#define SOX_EFF_GAIN 128
1067#define SOX_EFF_MODIFY 256
1068#define SOX_EFF_ALPHA 512
1069#define SOX_EFF_INTERNAL 1024
1076#define SOX_SEEK_SET 0
1280 void * callback_data,
1654#define sox_globals (*sox_get_globals())
1672#define sox_encodings_info (sox_get_encodings_info())
1699 unsigned bits_per_sample
1819#define sox_format_fns (sox_get_format_fns())
2007#define sox_effects_globals (*sox_get_effects_globals())
2060#define sox_effect_fns (sox_get_effect_fns())
2258 size_t base_buffer_len,
2317#define lsx_fail sox_get_globals()->subsystem=__FILE__,lsx_fail_impl
2323#define lsx_warn sox_get_globals()->subsystem=__FILE__,lsx_warn_impl
2329#define lsx_report sox_get_globals()->subsystem=__FILE__,lsx_report_impl
2335#define lsx_debug sox_get_globals()->subsystem=__FILE__,lsx_debug_impl
2354#define LSX_ENUM_ITEM(prefix, item) {#item, prefix##item},
2599#if defined(__cplusplus)
@ lsx_find_enum_item_none
Default parameters (case-insensitive).
Definition: sox.h:2362
@ lsx_find_enum_item_case_sensitive
Enable case-sensitive search.
Definition: sox.h:2363
#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len, filled)
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to me...
Definition: sox.h:313
LSX_RETURN_OPT char const *LSX_API sox_find_comment(LSX_PARAM_IN_OPT sox_comments_t comments, LSX_PARAM_IN_Z char const *id)
Client API: If "id=value" is found, return value, else return null.
LSX_RETURN_VALID_Z LSX_RETURN_PURE sox_effect_fn_t const *LSX_API sox_get_effect_fns(void)
Client API: Returns an array containing the known effect handlers.
LSX_RETURN_OPT LSX_RETURN_PURE char const *LSX_API lsx_find_file_extension(LSX_PARAM_IN_Z char const *pathname)
Plugins API: Finds the file extension for a filename.
LSX_RETURN_OPT sox_effect_t *LSX_API sox_pop_effect_last(LSX_PARAM_INOUT sox_effects_chain_t *chain)
Client API: Removes and returns an effect from the end of the chain.
LSX_RETURN_VALID_Z char const *LSX_API lsx_sigfigs3(double number)
Plugins API: Formats the specified number with up to three significant figures and adds a metric suff...
LSX_RETURN_OPT sox_effect_t *LSX_API sox_create_effect(LSX_PARAM_IN sox_effect_handler_t const *eh)
Client API: Creates an effect using the given handler.
LSX_RETURN_OPT LSX_RETURN_PURE sox_effect_handler_t const *LSX_API sox_find_effect(LSX_PARAM_IN_Z char const *name)
Client API: Finds the effect handler with the given name.
#define LSX_PARAM_DEREF_PRE_MAYBENULL
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer (neve...
Definition: sox.h:337
int LSX_API sox_quit(void)
Client API: Close effects library and unload format handler plugins.
LSX_RETURN_PURE int LSX_API lsx_strncasecmp(LSX_PARAM_IN_Z char const *s1, LSX_PARAM_IN_Z char const *s2, size_t n)
Plugins API: Like strncmp, except that the characters are compared without regard to case.
LSX_RETURN_OPT sox_effects_chain_t *LSX_API sox_create_effects_chain(LSX_PARAM_IN sox_encodinginfo_t const *in_enc, LSX_PARAM_IN sox_encodinginfo_t const *out_enc)
Client API: Initializes an effects chain.
void LSX_API lsx_getopt_init(LSX_PARAM_IN int argc, LSX_PARAM_IN_COUNT(argc) char *const *argv, LSX_PARAM_IN_Z char const *shortopts, LSX_PARAM_IN_OPT lsx_option_t const *longopts, LSX_PARAM_IN lsx_getopt_flags_t flags, LSX_PARAM_IN int first, LSX_PARAM_OUT lsx_getopt_t *state)
Plugins API: Initializes an lsx_getopt_t structure for use with lsx_getopt.
#define LSX_PARAM_IN_BYTECOUNT(len)
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to (l...
Definition: sox.h:204
uint64_t sox_uint64_t
Client API: Unsigned 64-bit type.
Definition: sox.h:433
void LSX_API sox_append_comment(LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t *comments, LSX_PARAM_IN_Z char const *item)
Client API: Adds an "id=value" item to the metadata block.
LSX_RETURN_ARRAY LSX_RETURN_PURE sox_encodings_info_t const *LSX_API sox_get_encodings_info(void)
Client API: Returns a pointer to the list of available encodings.
LSX_RETURN_OPT void *LSX_API lsx_realloc(LSX_PARAM_IN_OPT void *ptr, size_t newsize)
Plugins API: Allocates, deallocates, or resizes; like C's realloc, except that this version terminate...
LSX_RETURN_PURE int LSX_API lsx_enum_option(int c, LSX_PARAM_IN_Z char const *arg, LSX_PARAM_IN lsx_enum_item const *items)
Plugins API: Looks up a command-line argument in a set of enumeration names, showing an error message...
int LSX_API sox_parse_playlist(LSX_PARAM_IN sox_playlist_callback_t callback, void *p, LSX_PARAM_IN char const *const listname)
Client API: Parses the specified playlist file.
int(LSX_API * sox_effect_handler_getopts)(LSX_PARAM_INOUT sox_effect_t *effp, int argc, LSX_PARAM_IN_COUNT(argc) char *argv[])
Client API: Callback to parse command-line arguments (called once per effect), used by sox_effect_han...
Definition: sox.h:1200
sox_int32_t sox_sample_t
Client API: Native SoX audio sample type (alias for sox_int32_t).
Definition: sox.h:451
size_t(LSX_API * sox_format_handler_read)(LSX_PARAM_INOUT sox_format_t *ft, LSX_PARAM_OUT_CAP_POST_COUNT(len, return) sox_sample_t *buf, size_t len)
Client API: Callback to read (decode) a block of samples, used by sox_format_handler....
Definition: sox.h:1135
#define LSX_PARAM_DEREF_POST_NULL
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer (neve...
Definition: sox.h:349
uint16_t sox_uint16_t
Client API: Unsigned 16-bit type.
Definition: sox.h:409
LSX_RETURN_OPT LSX_RETURN_PURE lsx_enum_item const *LSX_API lsx_find_enum_value(unsigned value, LSX_PARAM_IN lsx_enum_item const *lsx_enum_items)
Plugins API: Looks up an enumeration by value in an array of lsx_enum_items.
int(LSX_API * sox_effect_handler_stop)(LSX_PARAM_INOUT sox_effect_t *effp)
Client API: Callback to shut down effect (called once per flow), used by sox_effect_handler....
Definition: sox.h:1248
int(LSX_API * sox_effect_handler_flow)(LSX_PARAM_INOUT sox_effect_t *effp, LSX_PARAM_IN_COUNT(*isamp) sox_sample_t const *ibuf, LSX_PARAM_OUT_CAP_POST_COUNT(*osamp, *osamp) sox_sample_t *obuf, LSX_PARAM_INOUT size_t *isamp, LSX_PARAM_INOUT size_t *osamp)
Client API: Callback to process samples, used by sox_effect_handler.flow.
Definition: sox.h:1222
int LSX_API sox_close(LSX_PARAM_INOUT sox_format_t *ft)
Client API: Closes an encoding or decoding session.
void LSX_API sox_append_comments(LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t *comments, LSX_PARAM_IN_Z char const *items)
Client API: Adds a newline-delimited list of "id=value" items to the metadata block.
void LSX_API sox_delete_effects(LSX_PARAM_INOUT sox_effects_chain_t *chain)
Client API: Shut down and delete all effects in the chain.
size_t LSX_API sox_num_comments(LSX_PARAM_IN_OPT sox_comments_t comments)
Client API: Returns the number of items in the metadata block.
lsx_getopt_flags_t
Plugins API: lsx_getopt_init options.
Definition: sox.h:2519
@ lsx_getopt_flag_none
no flags (no output, not long-only)
Definition: sox.h:2520
@ lsx_getopt_flag_longonly
if set, recognize -option as a long option
Definition: sox.h:2522
@ lsx_getopt_flag_opterr
if set, invalid options trigger lsx_warn output
Definition: sox.h:2521
int LSX_API sox_flow_effects(LSX_PARAM_INOUT sox_effects_chain_t *chain, LSX_PARAM_IN_OPT sox_flow_effects_callback callback, LSX_PARAM_IN_OPT void *client_data)
Client API: Runs the effects chain, returns SOX_SUCCESS if successful.
size_t LSX_API sox_read(LSX_PARAM_INOUT sox_format_t *ft, LSX_PARAM_OUT_CAP_POST_COUNT(len, return) sox_sample_t *buf, size_t len)
Client API: Reads samples from a decoding session into a sample buffer.
#define LSX_PARAM_IN_Z
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to a ...
Definition: sox.h:167
LSX_RETURN_OPT sox_format_t *LSX_API sox_open_mem_read(LSX_PARAM_IN_BYTECOUNT(buffer_size) void *buffer, size_t buffer_size, LSX_PARAM_IN_OPT sox_signalinfo_t const *signal, LSX_PARAM_IN_OPT sox_encodinginfo_t const *encoding, LSX_PARAM_IN_OPT_Z char const *filetype)
Client API: Opens a decoding session for a memory buffer.
LSX_RETURN_ARRAY LSX_RETURN_PURE sox_format_tab_t const *LSX_API sox_get_format_fns(void)
Client API: Returns the table of format handler names and functions.
sox_uint64_t LSX_API sox_stop_effect(LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp)
Client API: Shuts down an effect (calls stop on each of its flows).
uint8_t sox_uint8_t
Client API: Unsigned 8-bit type.
Definition: sox.h:397
int(LSX_API * sox_effect_handler_drain)(LSX_PARAM_INOUT sox_effect_t *effp, LSX_PARAM_OUT_CAP_POST_COUNT(*osamp, *osamp) sox_sample_t *obuf, LSX_PARAM_INOUT size_t *osamp)
Client API: Callback to finish getting output after input is complete, used by sox_effect_handler....
Definition: sox.h:1236
char ** sox_comments_t
Client API: File's metadata, access via sox_*_comments functions.
Definition: sox.h:463
sox_uint64_t LSX_API lsx_filelength(LSX_PARAM_IN sox_format_t *ft)
Plugins API: Gets the file length, or 0 if the file is not seekable/normal.
sox_option_t
Client API: no, yes, or default (default usually implies some kind of auto-detect logic).
Definition: sox.h:483
@ sox_option_default
Option unspecified = 2.
Definition: sox.h:486
@ sox_option_yes
Option specified as yes = 1.
Definition: sox.h:485
@ sox_option_no
Option specified as no = 0.
Definition: sox.h:484
void LSX_API lsx_fail_impl(LSX_PARAM_IN_PRINTF char const *fmt,...) LSX_PRINTF12
Plugins API: Print a fatal error in libSoX.
sox_bool
Client API: Boolean type, assignment (but not necessarily binary) compatible with C++ bool.
Definition: sox.h:473
@ sox_true
True = 1.
Definition: sox.h:476
@ sox_false
False = 0.
Definition: sox.h:475
#define LSX_RETURN_ARRAY
Plugins API: Attribute applied to a function to indicate that the return value is always a pointer to...
Definition: sox.h:123
LSX_RETURN_VALID_Z char const *LSX_API lsx_sigfigs3p(double percentage)
Plugins API: Formats the specified number as a percentage, showing up to three significant figures.
#define LSX_PARAM_IN_COUNT(len)
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to (l...
Definition: sox.h:191
sox_uint32_t sox_uint24_t
Client API: Alias for sox_uint32_t (beware of the extra byte).
Definition: sox.h:445
int64_t sox_int64_t
Client API: Signed twos-complement 64-bit type.
Definition: sox.h:427
int(LSX_API * sox_format_handler_stopread)(LSX_PARAM_INOUT sox_format_t *ft)
Client API: Callback to close reader (decoder), used by sox_format_handler.stopread.
Definition: sox.h:1147
int LSX_API sox_init(void)
Client API: Initialize effects library.
LSX_RETURN_OPT sox_comments_t LSX_API sox_copy_comments(LSX_PARAM_IN_OPT sox_comments_t comments)
Client API: Duplicates the metadata block.
void LSX_API sox_delete_effect(LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp)
Client API: Shut down and delete an effect.
LSX_RETURN_VALID_Z LSX_RETURN_PURE char const *LSX_API sox_strerror(int sox_errno)
Client API: Converts a SoX error code into an error string.
LSX_RETURN_OPT sox_format_t *LSX_API sox_open_read(LSX_PARAM_IN_Z char const *path, LSX_PARAM_IN_OPT sox_signalinfo_t const *signal, LSX_PARAM_IN_OPT sox_encodinginfo_t const *encoding, LSX_PARAM_IN_OPT_Z char const *filetype)
Client API: Opens a decoding session for a file.
#define LSX_RETURN_VALID_Z
Plugins API: Attribute applied to a function to indicate that the return value is always a pointer to...
Definition: sox.h:134
#define LSX_PARAM_IN
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to on...
Definition: sox.h:156
int(LSX_API * sox_effect_handler_start)(LSX_PARAM_INOUT sox_effect_t *effp)
Client API: Callback to initialize effect (called once per flow), used by sox_effect_handler....
Definition: sox.h:1212
sox_format_handler_t const *(LSX_API * sox_format_fn_t)(void)
Client API: Callback to retrieve information about a format handler, used by sox_format_tab_t....
Definition: sox.h:1109
LSX_RETURN_OPT sox_format_t *LSX_API sox_open_memstream_write(LSX_PARAM_OUT char **buffer_ptr, LSX_PARAM_OUT size_t *buffer_size_ptr, LSX_PARAM_IN sox_signalinfo_t const *signal, LSX_PARAM_IN_OPT sox_encodinginfo_t const *encoding, LSX_PARAM_IN_OPT_Z char const *filetype, LSX_PARAM_IN_OPT sox_oob_t const *oob)
Client API: Opens an encoding session for a memstream buffer.
#define LSX_PARAM_DEREF_POST_NOTNULL
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer (neve...
Definition: sox.h:361
LSX_RETURN_VALID LSX_RETURN_PURE sox_globals_t *LSX_API sox_get_globals(void)
Client API: Returns a pointer to the structure with libSoX's global settings.
int LSX_API sox_seek(LSX_PARAM_INOUT sox_format_t *ft, sox_uint64_t offset, int whence)
Client API: Sets the location at which next samples will be decoded.
size_t(LSX_API * sox_format_handler_write)(LSX_PARAM_INOUT sox_format_t *ft, LSX_PARAM_IN_COUNT(len) sox_sample_t const *buf, size_t len)
Client API: Callback to write (encode) a block of samples, used by sox_format_handler....
Definition: sox.h:1167
int32_t sox_int32_t
Client API: Signed twos-complement 32-bit type.
Definition: sox.h:415
sox_bool LSX_API sox_is_playlist(LSX_PARAM_IN_Z char const *filename)
Client API: Returns true if the specified file is a known playlist file type.
#define LSX_PARAM_OUT_CAP_POST_COUNT(len, filled)
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to me...
Definition: sox.h:295
LSX_RETURN_VALID LSX_RETURN_PURE sox_effects_globals_t *LSX_API sox_get_effects_globals(void)
Client API: Returns global parameters for effects.
LSX_RETURN_VALID_Z char const *LSX_API sox_version(void)
Client API: Returns version number string of libSoX, for example, "14.4.0".
void LSX_API sox_delete_effect_last(LSX_PARAM_INOUT sox_effects_chain_t *chain)
Client API: Shut down and delete the last effect in the chain.
uint32_t sox_uint32_t
Client API: Unsigned 32-bit type.
Definition: sox.h:421
void LSX_API sox_format_quit(void)
Client API: Unload format handler plugins.
#define LSX_API
Plugins API: Attribute required on all functions exported by libSoX and on all function pointer types...
Definition: sox.h:66
int LSX_API sox_add_effect(LSX_PARAM_INOUT sox_effects_chain_t *chain, LSX_PARAM_INOUT sox_effect_t *effp, LSX_PARAM_INOUT sox_signalinfo_t *in, LSX_PARAM_IN sox_signalinfo_t const *out)
Client API: Adds an effect to the effects chain, returns SOX_SUCCESS if successful.
LSX_RETURN_PURE int LSX_API lsx_strcasecmp(LSX_PARAM_IN_Z char const *s1, LSX_PARAM_IN_Z char const *s2)
Plugins API: Like strcmp, except that the characters are compared without regard to case.
size_t LSX_API sox_basename(LSX_PARAM_OUT_Z_CAP_POST_COUNT(base_buffer_len, return) char *base_buffer, size_t base_buffer_len, LSX_PARAM_IN_Z char const *filename)
Client API: Gets the basename of the specified file; for example, the basename of "/a/b/c....
#define LSX_PARAM_IN_OPT_Z
Plugins API: Attribute applied to a parameter to indicate that the parameter is either NULL or a vali...
Definition: sox.h:226
#define LSX_PARAM_INOUT_COUNT(len)
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to (l...
Definition: sox.h:251
lsx_option_arg_t
Plugins API: Is option argument unsupported, required, or optional.
Definition: sox.h:2509
@ lsx_option_arg_optional
Option can optionally be followed by an argument.
Definition: sox.h:2512
@ lsx_option_arg_required
Option requires an argument.
Definition: sox.h:2511
@ lsx_option_arg_none
Option does not have an argument.
Definition: sox.h:2510
sox_effect_handler_t const *(LSX_API * sox_effect_fn_t)(void)
Client API: Callback to get information about an effect handler, used by the table returned from sox_...
Definition: sox.h:1117
void LSX_API sox_delete_comments(LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NULL sox_comments_t *comments)
Client API: Frees the metadata block.
#define LSX_PARAM_IN_OPT
Plugins API: Attribute applied to a parameter to indicate that the parameter is either NULL or a vali...
Definition: sox.h:215
sox_error_t
Client API: The libSoX-specific error codes.
Definition: sox.h:494
@ SOX_EPERM
Operation not permitted = 2003.
Definition: sox.h:500
@ SOX_ENOMEM
Can't alloc memory = 2002.
Definition: sox.h:499
@ SOX_EHDR
Invalid Audio Header = 2000.
Definition: sox.h:497
@ SOX_ENOTSUP
Operation not supported = 2004.
Definition: sox.h:501
@ SOX_EINVAL
Invalid argument = 2005.
Definition: sox.h:502
@ SOX_SUCCESS
Function succeeded = 0.
Definition: sox.h:495
@ SOX_EOF
End Of File or other error = -1.
Definition: sox.h:496
@ SOX_EFMT
Unsupported data format = 2001.
Definition: sox.h:498
sox_loop_flags_t
Client API: Loop modes: upper 4 bits mask the loop blass, lower 4 bits describe the loop behaviour,...
Definition: sox.h:582
@ sox_loop_none
single-shot = 0
Definition: sox.h:583
@ sox_loop_sustain_decay
AIFF style, one sustain & one decay loop = 64.
Definition: sox.h:587
@ sox_loop_8
8 loops (??) = 32
Definition: sox.h:586
@ sox_loop_forward
forward loop = 1
Definition: sox.h:584
@ sox_loop_forward_back
forward/back loop = 2
Definition: sox.h:585
#define SOX_MAX_NLOOPS
Client API: Maximum number of loops supported by sox_oob_t = 8.
Definition: sox.h:1041
size_t LSX_API sox_write(LSX_PARAM_INOUT sox_format_t *ft, LSX_PARAM_IN_COUNT(len) sox_sample_t const *buf, size_t len)
Client API: Writes samples to an encoding session from a sample buffer.
#define LSX_PRINTF12
Plugins API: LSX_PRINTF12: Attribute applied to a function to indicate that it requires a printf-styl...
Definition: sox.h:89
LSX_RETURN_OPT LSX_RETURN_PURE lsx_enum_item const *LSX_API lsx_find_enum_text(LSX_PARAM_IN_Z char const *text, LSX_PARAM_IN lsx_enum_item const *lsx_enum_items, int flags)
Plugins API: Looks up an enumeration by name in an array of lsx_enum_items.
#define LSX_PARAM_OUT_BYTECAP(len)
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to me...
Definition: sox.h:277
sox_uint64_t LSX_API sox_effects_clips(LSX_PARAM_IN sox_effects_chain_t *chain)
Client API: Gets the number of clips that occurred while running an effects chain.
int LSX_API sox_effect_options(LSX_PARAM_IN sox_effect_t *effp, int argc, LSX_PARAM_IN_COUNT(argc) char *const argv[])
Client API: Applies the command-line options to the effect.
void LSX_API lsx_warn_impl(LSX_PARAM_IN_PRINTF char const *fmt,...) LSX_PRINTF12
Plugins API: Print a warning in libSoX.
#define LSX_PARAM_OUT
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to me...
Definition: sox.h:263
sox_bool LSX_API sox_format_supports_encoding(LSX_PARAM_IN_OPT_Z char const *path, LSX_PARAM_IN_OPT_Z char const *filetype, LSX_PARAM_IN sox_encodinginfo_t const *encoding)
Client API: Returns true if the format handler for the specified file type supports the specified enc...
sox_int32_t sox_int24_t
Client API: Alias for sox_int32_t (beware of the extra byte).
Definition: sox.h:439
#define LSX_RETURN_VALID
Plugins API: Attribute applied to a function to indicate that the return value is always a pointer to...
Definition: sox.h:112
void LSX_API sox_push_effect_last(LSX_PARAM_INOUT sox_effects_chain_t *chain, LSX_PARAM_INOUT sox_effect_t *effp)
Client API: Adds an already-initialized effect to the end of the chain.
int(LSX_API * sox_format_handler_seek)(LSX_PARAM_INOUT sox_format_t *ft, sox_uint64_t offset)
Client API: Callback to reposition reader, used by sox_format_handler.seek.
Definition: sox.h:1189
sox_encoding_t
Client API: Format of sample data.
Definition: sox.h:521
@ SOX_ENCODING_DPCM
Differential PCM: Fasttracker 2 (xi)
Definition: sox.h:541
@ SOX_ENCODING_G723
G.723 3 or 5 bit ADPCM.
Definition: sox.h:535
@ SOX_ENCODING_OPUS
Opus compression.
Definition: sox.h:551
@ SOX_ENCODING_SIGN2
signed linear 2's comp: Mac
Definition: sox.h:524
@ SOX_ENCODING_AMR_WB
AMR-WB compression.
Definition: sox.h:547
@ SOX_ENCODING_ALAW
A-law signed logs: non-US telephony, Psion.
Definition: sox.h:533
@ SOX_ENCODINGS
End of list marker.
Definition: sox.h:553
@ SOX_ENCODING_ULAW
u-law signed logs: US telephony, SPARC
Definition: sox.h:532
@ SOX_ENCODING_WAVPACKF
WavPack with float samples.
Definition: sox.h:531
@ SOX_ENCODING_UNKNOWN
encoding has not yet been determined
Definition: sox.h:522
@ SOX_ENCODING_MP3
MP3 compression.
Definition: sox.h:545
@ SOX_ENCODING_G721
G.721 4-bit ADPCM.
Definition: sox.h:534
@ SOX_ENCODING_CVSD
Continuously Variable Slope Delta modulation.
Definition: sox.h:549
@ SOX_ENCODING_FLOAT_TEXT
floating point (text format)
Definition: sox.h:527
@ SOX_ENCODING_MS_ADPCM
Microsoft Compressed PCM.
Definition: sox.h:538
@ SOX_ENCODING_GSM
GSM 6.10 33byte frame lossy compression.
Definition: sox.h:544
@ SOX_ENCODING_FLAC
FLAC compression.
Definition: sox.h:528
@ SOX_ENCODING_DWVWN
Delta Width Variable Word N-bit.
Definition: sox.h:543
@ SOX_ENCODING_VORBIS
Vorbis compression.
Definition: sox.h:546
@ SOX_ENCODING_CL_ADPCM16
Creative Labs 16 --> 4 bit Compressed PCM.
Definition: sox.h:537
@ SOX_ENCODING_UNSIGNED
unsigned linear: Sound Blaster
Definition: sox.h:525
@ SOX_ENCODING_CL_ADPCM
Creative Labs 8 --> 2,3,4 bit Compressed PCM.
Definition: sox.h:536
@ SOX_ENCODING_HCOM
Mac FSSD files with Huffman compression.
Definition: sox.h:529
@ SOX_ENCODING_AMR_NB
AMR-NB compression.
Definition: sox.h:548
@ SOX_ENCODING_DWVW
Delta Width Variable Word.
Definition: sox.h:542
@ SOX_ENCODING_LPC10
Linear Predictive Coding.
Definition: sox.h:550
@ SOX_ENCODING_WAVPACK
WavPack with integer samples.
Definition: sox.h:530
@ SOX_ENCODING_FLOAT
floating point (binary format)
Definition: sox.h:526
@ SOX_ENCODING_IMA_ADPCM
IMA Compressed PCM.
Definition: sox.h:539
@ SOX_ENCODING_OKI_ADPCM
Dialogic/OKI Compressed PCM.
Definition: sox.h:540
#define LSX_RETURN_OPT
Plugins API: Attribute applied to a function to indicate that the returned pointer may be null.
Definition: sox.h:145
LSX_RETURN_OPT sox_format_handler_t const *LSX_API sox_find_format(LSX_PARAM_IN_Z char const *name, sox_bool ignore_devices)
Client API: Finds a format handler by name.
sox_uint64_t LSX_API sox_trim_get_start(LSX_PARAM_IN sox_effect_t *effp)
Client API: Gets the sample offset of the start of the trim, useful for efficiently skipping the part...
sox_encodings_flags_t
Client API: Flags for sox_encodings_info_t: lossless/lossy1/lossy2.
Definition: sox.h:560
@ sox_encodings_lossy2
encode, decode, encode, decode: lossy twice = 2.
Definition: sox.h:563
@ sox_encodings_none
no flags specified (implies lossless encoding) = 0.
Definition: sox.h:561
@ sox_encodings_lossy1
encode, decode: lossy once = 1.
Definition: sox.h:562
int(LSX_API * sox_playlist_callback_t)(void *callback_data, LSX_PARAM_IN_Z char const *filename)
Client API: Callback for enumerating the contents of a playlist, used by the sox_parse_playlist funct...
Definition: sox.h:1279
int(LSX_API * sox_effect_handler_kill)(LSX_PARAM_INOUT sox_effect_t *effp)
Client API: Callback to shut down effect (called once per effect), used by sox_effect_handler....
Definition: sox.h:1258
LSX_RETURN_OPT sox_format_t *LSX_API sox_open_mem_write(LSX_PARAM_OUT_BYTECAP(buffer_size) void *buffer, LSX_PARAM_IN size_t buffer_size, LSX_PARAM_IN sox_signalinfo_t const *signal, LSX_PARAM_IN_OPT sox_encodinginfo_t const *encoding, LSX_PARAM_IN_OPT_Z char const *filetype, LSX_PARAM_IN_OPT sox_oob_t const *oob)
Client API: Opens an encoding session for a memory buffer.
LSX_RETURN_VALID LSX_RETURN_PURE sox_version_info_t const *LSX_API sox_version_info(void)
Client API: Returns information about this build of libsox.
int LSX_API sox_format_init(void)
Client API: Find and load format handler plugins.
int16_t sox_int16_t
Client API: Signed twos-complement 16-bit type.
Definition: sox.h:403
int(LSX_API * sox_format_handler_startwrite)(LSX_PARAM_INOUT sox_format_t *ft)
Client API: Callback to initialize writer (encoder), used by sox_format_handler.startwrite.
Definition: sox.h:1157
void LSX_API lsx_report_impl(LSX_PARAM_IN_PRINTF char const *fmt,...) LSX_PRINTF12
Plugins API: Print an informational message in libSoX.
int(LSX_API * sox_format_handler_startread)(LSX_PARAM_INOUT sox_format_t *ft)
Client API: Callback to initialize reader (decoder), used by sox_format_handler.startread.
Definition: sox.h:1125
LSX_RETURN_OPT sox_format_handler_t const *LSX_API sox_write_handler(LSX_PARAM_IN_OPT_Z char const *path, LSX_PARAM_IN_OPT_Z char const *filetype, LSX_PARAM_OUT_OPT char const **filetype1)
Client API: Gets the format handler for a specified file type.
#define LSX_RETURN_PURE
Plugins API: Attribute applied to a function to indicate that it has no side effects and depends only...
Definition: sox.h:101
sox_version_flags_t
Client API: Flags indicating whether optional features are present in this build of libSoX.
Definition: sox.h:509
@ sox_version_have_threads
threads = 4.
Definition: sox.h:513
@ sox_version_have_popen
popen = 1.
Definition: sox.h:511
@ sox_version_have_memopen
memopen = 8.
Definition: sox.h:514
@ sox_version_have_magic
magic = 2.
Definition: sox.h:512
@ sox_version_none
No special features = 0.
Definition: sox.h:510
LSX_RETURN_OPT sox_format_t *LSX_API sox_open_write(LSX_PARAM_IN_Z char const *path, LSX_PARAM_IN sox_signalinfo_t const *signal, LSX_PARAM_IN_OPT sox_encodinginfo_t const *encoding, LSX_PARAM_IN_OPT_Z char const *filetype, LSX_PARAM_IN_OPT sox_oob_t const *oob, LSX_PARAM_IN_OPT sox_bool(LSX_API *overwrite_permitted)(LSX_PARAM_IN_Z char const *filename))
Client API: Opens an encoding session for a file.
void LSX_API sox_delete_effects_chain(LSX_PARAM_INOUT sox_effects_chain_t *ecp)
Client API: Closes an effects chain.
void LSX_API lsx_debug_impl(LSX_PARAM_IN_PRINTF char const *fmt,...) LSX_PRINTF12
Plugins API: Print a debug message in libSoX.
int(LSX_API * sox_flow_effects_callback)(sox_bool all_done, void *client_data)
Client API: Callback called while flow is running (called once per buffer), used by sox_flow_effects....
Definition: sox.h:1268
int LSX_API lsx_getopt(LSX_PARAM_INOUT lsx_getopt_t *state)
Plugins API: Gets the next option.
lsx_io_type
Plugins API: Is file a real file, a pipe, or a url?
Definition: sox.h:595
@ lsx_io_file
File is a real file = 0.
Definition: sox.h:596
@ lsx_io_pipe
File is a pipe (no seeking) = 1.
Definition: sox.h:597
@ lsx_io_url
File is a URL (no seeking) = 2.
Definition: sox.h:598
double sox_rate_t
Client API: Samples per second is stored as a double.
Definition: sox.h:457
#define LSX_PARAM_IN_PRINTF
Plugins API: Attribute applied to a parameter to indicate that the parameter is a const pointer to a ...
Definition: sox.h:178
#define LSX_PARAM_INOUT
Plugins API: Attribute applied to a parameter to indicate that the parameter is a valid pointer to on...
Definition: sox.h:238
void(LSX_API * sox_output_message_handler_t)(unsigned level, LSX_PARAM_IN_Z char const *filename, LSX_PARAM_IN_PRINTF char const *fmt, LSX_PARAM_IN va_list ap)
Client API: Callback to write a message to an output device (console or log file),...
Definition: sox.h:1096
sox_plot_t
Client API: Type of plot.
Definition: sox.h:570
@ sox_plot_octave
Octave plot = 1.
Definition: sox.h:572
@ sox_plot_gnuplot
Gnuplot plot = 2.
Definition: sox.h:573
@ sox_plot_off
No plot = 0.
Definition: sox.h:571
@ sox_plot_data
Plot data = 3.
Definition: sox.h:574
void LSX_API sox_trim_clear_start(LSX_PARAM_INOUT sox_effect_t *effp)
Client API: Clears the start of the trim to 0.
void LSX_API sox_init_encodinginfo(LSX_PARAM_OUT sox_encodinginfo_t *e)
Client API: Fills in an encodinginfo with default values.
int8_t sox_int8_t
Client API: Signed twos-complement 8-bit type.
Definition: sox.h:391
LSX_RETURN_PURE unsigned LSX_API sox_precision(sox_encoding_t encoding, unsigned bits_per_sample)
Client API: Given an encoding (for example, SIGN2) and the encoded bits_per_sample (for example,...
#define LSX_PARAM_OUT_OPT
Plugins API: Attribute applied to a parameter to indicate that the parameter is either NULL or a vali...
Definition: sox.h:325
int(LSX_API * sox_format_handler_stopwrite)(LSX_PARAM_INOUT sox_format_t *ft)
Client API: Callback to close writer (decoder), used by sox_format_handler.stopwrite.
Definition: sox.h:1179
LSX_RETURN_PURE sox_bool LSX_API lsx_strends(LSX_PARAM_IN_Z char const *str, LSX_PARAM_IN_Z char const *end)
Plugins API: Determines whether the specified string ends with the specified suffix (case-sensitive).
Plugins API: String name and integer values for enumerated types (type metadata), for use with LSX_EN...
Definition: sox.h:2342
char const * text
String name of enumeration.
Definition: sox.h:2343
unsigned value
Integer value of enumeration.
Definition: sox.h:2344
Plugins API: lsx_getopt session information (initialization data and state).
Definition: sox.h:2540
char const * shortopts
IN shortopts: Short option characters.
Definition: sox.h:2543
int opt
OUT optopt: Receives the option character that caused error.
Definition: sox.h:2548
int lngind
OUT lngind: Receives the index of the matched long option or -1 if not a long option.
Definition: sox.h:2550
char const * curpos
INOUT curpos: Maintains state between calls to lsx_getopt.
Definition: sox.h:2546
int ind
INOUT optind: Maintains the index of next element to be processed.
Definition: sox.h:2547
lsx_option_t const * longopts
IN longopts: Array of long option descriptors.
Definition: sox.h:2544
char const * arg
OUT optarg: Receives the value of the option's argument.
Definition: sox.h:2549
lsx_getopt_flags_t flags
IN flags: Flags for longonly and opterr.
Definition: sox.h:2545
char *const * argv
IN argv: Array of arguments.
Definition: sox.h:2542
int argc
IN argc: Number of arguments in argv.
Definition: sox.h:2541
Plugins API: lsx_getopt long option descriptor.
Definition: sox.h:2529
lsx_option_arg_t has_arg
Whether the long option supports an argument and, if so, whether the argument is required or optional...
Definition: sox.h:2531
int * flag
Flag to set if argument is present.
Definition: sox.h:2532
char const * name
Name of the long option.
Definition: sox.h:2530
int val
Value to put in flag if argument is present.
Definition: sox.h:2533
Client API: Effect handler information.
Definition: sox.h:1565
sox_effect_handler_kill kill
Called to shut down effect (called once per effect).
Definition: sox.h:1574
char const * usage
Short explanation of parameters accepted by effect.
Definition: sox.h:1567
sox_effect_handler_getopts getopts
Called to parse command-line arguments (called once per effect).
Definition: sox.h:1569
sox_effect_handler_flow flow
Called to process samples.
Definition: sox.h:1571
sox_effect_handler_drain drain
Called to finish getting output after input is complete.
Definition: sox.h:1572
char const * name
Effect name.
Definition: sox.h:1566
size_t priv_size
Size of private data SoX should pre-allocate for effect.
Definition: sox.h:1575
sox_effect_handler_start start
Called to initialize effect (called once per flow).
Definition: sox.h:1570
sox_effect_handler_stop stop
Called to shut down effect (called once per flow).
Definition: sox.h:1573
unsigned int flags
Combination of SOX_EFF_* flags.
Definition: sox.h:1568
Client API: Effect information.
Definition: sox.h:1582
size_t flow
flow number
Definition: sox.h:1591
sox_effects_globals_t * global_info
global effect parameters
Definition: sox.h:1583
sox_encodinginfo_t const * out_encoding
Information about the outgoing data encoding.
Definition: sox.h:1587
size_t flows
1 if MCHAN, number of chans otherwise
Definition: sox.h:1590
sox_signalinfo_t out_signal
Information about the outgoing data stream.
Definition: sox.h:1585
sox_encodinginfo_t const * in_encoding
Information about the incoming data encoding.
Definition: sox.h:1586
sox_signalinfo_t in_signal
Information about the incoming data stream.
Definition: sox.h:1584
void * priv
Effect's private data area (each flow has a separate copy)
Definition: sox.h:1592
size_t imin
minimum input buffer content required for calling this effect's flow function; set via lsx_effect_set...
Definition: sox.h:1597
sox_uint64_t clips
increment if clipping occurs
Definition: sox.h:1589
sox_effect_handler_t handler
The handler for this effect.
Definition: sox.h:1588
size_t oend
output buffer: one past valid data section (oend-obeg is length of current content)
Definition: sox.h:1596
size_t obeg
output buffer: start of valid data section
Definition: sox.h:1595
sox_sample_t * obuf
output buffer
Definition: sox.h:1594
Client API: Chain of effects to be applied to a stream.
Definition: sox.h:1604
sox_encodinginfo_t const * out_enc
Output encoding.
Definition: sox.h:1609
sox_effect_t ** effects
Table of effects to be applied to a stream.
Definition: sox.h:1605
sox_encodinginfo_t const * in_enc
Input encoding.
Definition: sox.h:1608
size_t table_size
Size of effects table (including unused entries)
Definition: sox.h:1611
sox_sample_t * il_buf
Channel interleave buffer.
Definition: sox.h:1612
sox_effects_globals_t global_info
Copy of global effects settings.
Definition: sox.h:1607
size_t length
Number of effects to be applied.
Definition: sox.h:1606
Client API: Global parameters for effects.
Definition: sox.h:1556
sox_plot_t plot
To help the user choose effect & options.
Definition: sox.h:1557
sox_globals_t * global_info
Pointer to associated SoX globals.
Definition: sox.h:1558
Client API: Encoding parameters.
Definition: sox.h:1371
sox_option_t reverse_nibbles
Should nibbles be reversed? If this is default during sox_open_read or sox_open_write,...
Definition: sox.h:1388
sox_bool opposite_endian
If set to true, the format should reverse its default endianness.
Definition: sox.h:1400
sox_option_t reverse_bits
Should bits be reversed? If this is default during sox_open_read or sox_open_write,...
Definition: sox.h:1395
sox_encoding_t encoding
format of sample numbers
Definition: sox.h:1372
sox_option_t reverse_bytes
Should bytes be reversed? If this is default during sox_open_read or sox_open_write,...
Definition: sox.h:1381
double compression
compression factor (where applicable)
Definition: sox.h:1374
unsigned bits_per_sample
0 if unknown or variable; uncompressed value if lossless; compressed value if lossy
Definition: sox.h:1373
Client API: Basic information about an encoding.
Definition: sox.h:1361
char const * name
encoding name.
Definition: sox.h:1363
sox_encodings_flags_t flags
lossy once (lossy1), lossy twice (lossy2), or lossless (none).
Definition: sox.h:1362
char const * desc
encoding description.
Definition: sox.h:1364
Client API: File buffer info.
Definition: sox.h:1430
char * buf
Pointer to data buffer.
Definition: sox.h:1431
size_t pos
Position in buffer.
Definition: sox.h:1434
size_t count
Count read into buffer.
Definition: sox.h:1433
size_t size
Size of buffer in bytes.
Definition: sox.h:1432
Client API: Global parameters (for effects & formats), returned from the sox_get_globals function.
Definition: sox.h:1311
sox_bool repeatable
true to use pre-determined timestamps and PRNG seed
Definition: sox.h:1315
sox_bool use_threads
Private: true if client has requested parallel effects processing.
Definition: sox.h:1336
size_t bufsiz
Default size (in bytes) used by libSoX for blocks of sample data.
Definition: sox.h:1321
char * tmp_path
Private: client-configured path to use for temporary files.
Definition: sox.h:1334
char const * stdout_in_use_by
Private: tracks the name of the handler currently using stdout.
Definition: sox.h:1332
char const * stdin_in_use_by
Private: tracks the name of the handler currently using stdin.
Definition: sox.h:1331
unsigned verbosity
messages are only written if globals.verbosity >= message.level
Definition: sox.h:1313
size_t input_bufsiz
Default size (in bytes) used by libSoX for blocks of input sample data.
Definition: sox.h:1327
sox_bool use_magic
Private: true if client has requested use of 'magic' file-type detection.
Definition: sox.h:1335
sox_output_message_handler_t output_message_handler
client-specified message output callback
Definition: sox.h:1314
size_t log2_dft_min_size
Log to base 2 of minimum size (in bytes) used by libSoX for DFT (filtering).
Definition: sox.h:1342
char const * subsystem
Private: tracks the name of the handler currently writing an output message.
Definition: sox.h:1333
sox_int32_t ranqd1
Can be used to re-seed libSoX's PRNG.
Definition: sox.h:1329
Client API: Instrument information.
Definition: sox.h:1418
signed char MIDIlow
MIDI pitch-bend low range.
Definition: sox.h:1420
unsigned nloops
number of active loops (max SOX_MAX_NLOOPS).
Definition: sox.h:1423
signed char MIDInote
for unity pitch playback
Definition: sox.h:1419
signed char MIDIhi
MIDI pitch-bend high range.
Definition: sox.h:1421
unsigned char loopmode
0=no, 1=forward, 2=forward/back (see sox_loop_* values)
Definition: sox.h:1422
Client API: Looping parameters (out-of-band data).
Definition: sox.h:1407
sox_uint64_t length
length
Definition: sox.h:1409
unsigned count
number of repeats, 0=forever
Definition: sox.h:1410
sox_uint64_t start
first sample
Definition: sox.h:1408
unsigned char type
0=no, 1=forward, 2=forward/back (see sox_loop_* for valid values).
Definition: sox.h:1411
Client API: Comments, instrument info, loop info (out-of-band data).
Definition: sox.h:1487
sox_comments_t comments
Comment strings in id=value format.
Definition: sox.h:1489
sox_instrinfo_t instr
Instrument specification.
Definition: sox.h:1490
sox_loopinfo_t loops[SOX_MAX_NLOOPS]
Looping specification.
Definition: sox.h:1491
Client API: Signal parameters; members should be set to SOX_UNSPEC (= 0) if unknown.
Definition: sox.h:1349
unsigned channels
number of sound channels, 0 if unknown
Definition: sox.h:1351
unsigned precision
bits per sample, 0 if unknown
Definition: sox.h:1352
double * mult
Effects headroom multiplier; may be null.
Definition: sox.h:1354
sox_uint64_t length
samples * chans in file, 0 if unknown, -1 if unspecified
Definition: sox.h:1353
sox_rate_t rate
samples per second, 0 if unknown
Definition: sox.h:1350
Client API: Information about a build of libSoX, returned from the sox_version_info function.
Definition: sox.h:1293
char const * arch
arch, for example, "1248 48 44 L OMP"
Definition: sox.h:1302
sox_version_flags_t flags
feature flags = popen | magic | threads | memopen
Definition: sox.h:1295
char const * version
version string = sox_version(), for example, "14.4.0"
Definition: sox.h:1297
sox_uint32_t version_code
version number = 0x140400
Definition: sox.h:1296
char const * distro
distro or null = "DISTRO", for example, "Debian"
Definition: sox.h:1300
char const * version_extra
version extra info or null = "PACKAGE_EXTRA", for example, "beta"
Definition: sox.h:1298
size_t size
structure size = sizeof(sox_version_info_t)
Definition: sox.h:1294
char const * compiler
compiler info or null, for example, "msvc 160040219"
Definition: sox.h:1301
char const * time
build time = "__DATE__ __TIME__", for example, "Jan 7 2010 03:31:50"
Definition: sox.h:1299