AzAudio

Reference Guide

About The Guide

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.

Introduction

The Project

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.

The Author

I'm Philip, AKA Equivocator, an programmer enthusiastic about learning how things work. With this insatiable appetite for learning new things, I started this project to fill the gap left by other audio libraries for a simple-to-ship static library for game audio.

I'm always open to feedback and am more than happy to answer any questions you may have. Should you have an inquiry, you can contact me via email at:

singularity.haynes@gmail.com

Naming Conventions

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.

Preprocessor Macros

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.

Functions

azaCapitalizeEveryWordWithoutSpaces
Always prefixed with aza.

Data Structures Repeatedly Passed to Functions

aza<FunctionName>Data

Functions Initializing These Data Structures

aza<FunctionName>DataInit( aza<FunctionName>Data *data )

Functions Cleaning These Data Structures

aza<FunctionName>DataDeinit( aza<FunctionName>Data *data )

Examples:

#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] );
					

Error Handling

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().

Reference

azaInit()


int azaInit(void)
					
Description:

Initializes the library. This must be called before any other library functions! If this is omitted, behavior is undefined.

Returns:

AZA_SUCCESS on success

azaGetError()


int azaGetError(void)
					
Description:

Gets the last error code set.

Returns:

Any library-specified error code.

Error Codes

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
					

Usage

Source

The source can be found here: https://github.com/SingularityAzure/AzAudio

Dependencies

TODO

License

Creative Commons License
This library is licensed under a Creative Commons Attribution 4.0 International License.