As of this writing, the library is in an early stage of development and many things are subject to change. I will do my best to keep this guide up-to-date and accurate but I cannot guarantee at this time that it will always be representative of the latest version.
AzAudio is a cross-platform audio library for games being written in C with the mission to bring powerful, featureful 3D audio to developers with minimal friction. It is meant to be a simple, extensible, easy-to-use API that you can include in your projects for commercial or non-commercial use. The only condition to using this library is attribution to the original author, as detailed in the license.
On top of this will be a C++ wrapper library for those who like a little casual OOP.
Based on my experience and personal preferences, I've chosen these naming conventions because they are distinct for each type of name they represent, which not only helps avoid conflicts, but also provides a way to identify what something is without looking it up or tagging it with an identifier. They are meant to be a good balance between clarity, and brevity.
ALL_CAPS_WITH_UNDERSCORES
Prefixed with AZA_ for the vast majority. The prefix AZAUDIO_ is used exclusively for parameters the user may wish to change for compilation, and affect the build process.
azaCapitalizeEveryWordWithoutSpaces
Always prefixed with aza.
aza<FunctionName>Data
aza<FunctionName>DataInit( aza<FunctionName>Data *data )
aza<FunctionName>DataDeinit( aza<FunctionName>Data *data )
#define AZA_PREPROCESSOR_VALUE
#define AZAUDIO_COMPILE_SETTING
// Stereo channels
azaFooData data[2];
data[0].someParameter = someValue;
data[1].someParameter = someValue;
// It's important to set parameters first since allocated memory may depend on them.
azaFooDataInit( &data[0] );
azaFooDataInit( &data[1] );
float output[bufferSize];
// input is an array of floats the same size as output
if (azaFoo( input, output, data, bufferSize, 2 )) {
// Error handling
}
azaFooDataDeinit( &data[0] );
azaFooDataDeinit( &data[1] );
Any library function you call will return an error status as an int. On success, it will always return AZA_SUCCESS. Simple error checking can be done this way. You can store the value returned by the function, or, alternatively, can check the last error code by using azaGetError().
int azaInit(void)
Initializes the library. This must be called before any other library functions! If this is omitted, behavior is undefined.
AZA_SUCCESS on success
int azaGetError(void)
Gets the last error code set.
Any library-specified error code.
These are all the possible error codes.
// The operation completed successfully
#define AZA_SUCCESS 0
// A pointer was unexpectedly null
#define AZA_ERROR_NULL_POINTER 1
// PortAudio has generated an error
#define AZA_ERROR_PORTAUDIO 2
The source can be found here: https://github.com/SingularityAzure/AzAudio
TODO
This library is licensed under a Creative Commons Attribution 4.0 International License.