SoX - Sound eXchange
Audio file processing tool.
|
Client API: Handler structure defined by each format. More...
#include <sox.h>
Public Attributes | |
unsigned | sox_lib_version_code |
Checked on load; must be 1st in struct. | |
char const * | description |
short description of format | |
char const *const * | names |
null-terminated array of filename extensions that are handled by this format | |
unsigned int | flags |
File flags (SOX_FILE_* values). | |
sox_format_handler_startread | startread |
called to initialize reader (decoder) | |
sox_format_handler_read | read |
called to read (decode) a block of samples | |
sox_format_handler_stopread | stopread |
called to close reader (decoder); may be null if no closing necessary | |
sox_format_handler_startwrite | startwrite |
called to initialize writer (encoder) | |
sox_format_handler_write | write |
called to write (encode) a block of samples | |
sox_format_handler_stopwrite | stopwrite |
called to close writer (decoder); may be null if no closing necessary | |
sox_format_handler_seek | seek |
called to reposition reader; may be null if not supported | |
unsigned const * | write_formats |
Array of values indicating the encodings and precisions supported for writing (encoding). More... | |
sox_rate_t const * | write_rates |
Array of sample rates (samples per second) supported for writing (encoding). More... | |
size_t | priv_size |
SoX will automatically allocate a buffer in which the handler can store data. More... | |
Client API: Handler structure defined by each format.
size_t priv_size |
SoX will automatically allocate a buffer in which the handler can store data.
Specify the size of the buffer needed here. Usually this will be sizeof(your_struct). The buffer will be allocated and zeroed before the call to startread/startwrite. The buffer will be freed after the call to stopread/stopwrite. The buffer will be provided via format.priv in each call to the handler.
unsigned const* write_formats |
Array of values indicating the encodings and precisions supported for writing (encoding).
Precisions specified with default precision first. Encoding, precision, precision, ..., 0, repeat. End with one more 0. Example: unsigned const * formats = { SOX_ENCODING_SIGN2, 16, 24, 0, // Support SIGN2 at 16 and 24 bits, default to 16 bits. SOX_ENCODING_UNSIGNED, 8, 0, // Support UNSIGNED at 8 bits, default to 8 bits. 0 // No more supported encodings. };
sox_rate_t const* write_rates |
Array of sample rates (samples per second) supported for writing (encoding).
NULL if all (or almost all) rates are supported. End with 0.