Babycat C API Documentation¶
C header structure¶
Babycat’s C bindings are automatically generated by cbindgen. Babycat’s entire API is described in a single C header file named
This documentation website splits the Babycat C API across multiple pages, but they all represent symbols directly inserted by babycat.h.
Data structures (structs and typedefs)¶
These constants represent default values for structs as well as error codes that can be returned.
The default number of threads to use for multithreaded operations. By default, we will initialize as many threads as logical CPU cores on your machine.
The default start time cutoff when decoding audio. We start at the beginning.
The default end time cutoff when decoding audio. We continue decoding until the end of the file.
The default frame rate to resample to. By default, we do not change the frame rate’s audio.
The default number of channels to decode. By default, we decode all of the available channels.
By default, we do not flatten all audio channels into a mono channel.
By default, we do not zero-pad the ending of an audio file.
Sets the default resampler.
Sets the default audio decoding backend.
Use this value to resample audio with libsamplerate.
The libsamplerate resampler is not available when Babycat is compiled to the
Use this value to resample audio with Babycat’s Lanczos resampler.
Use this value to resample audio with Babycat’s sinc resampler.
Sets the decoding backend as [
Returned when a given operation has succeeded without any error.
Returned when you are trying to use a feature at runtime that was not included at compile-time.
For example, you may receive this error if you are trying to resample audio using a method that was not compiled for your target or binding.
Returned when you wanted to decode more channels than the audio actually had.
Returned if you specified
Returned if you set
truewithout also specifying
Returned when we were not able to detect the encoded input as decodable audio.
Returned when we were not able to decode the given (encoded) audio.
Returned when we were not able to recognize the given decoding backend.
Returned whe we encountered an unknown error when encoding a waveform into particular format.
Returned when we were not able to resample the audio.
Returned when we cannot resample from the input frame rate to the output frame rate.
Returned if you are trying to upsample or downsample audio by a factor greater than 256.
Returned if you asked Babycat to read a file, but you gave it a path to a directory.
Returned if you asked Babycat to read a file that does not exist.
Returned when something else went wrong while doing I/O.