Once again, the time has come for...
__ _ _ _ __ _ _ __
/ / _ __ | | __ _(_) __| | / /_ _ _ _ __| (_) ___ \ \
/ / | '_ \| |/ _` | |/ _` | / / _` | | | |/ _` | |/ _ \ \ \
\ \ | |_) | | (_| | | (_| |/ / (_| | |_| | (_| | | (_) | / /
\_\ | .__/|_|\__,_|_|\__,_/_/ \__,_|\__,_|\__,_|_|\___/ /_/
standalone audio framework
Written with <3 by Evan Balster
is a portable, extensible C++ framework for CPU-processed audio. It is designed chiefly for use in games and other media-intensive software, and is most notably used in SoundSelf
It offers a free (zlib-licensed) alternative to commercial audio middleware like FMOD. Unlike the leading API, OpenAL, its behavior is consistent and guaranteed across platforms.
At present it offers classes for streaming and buffering audio files, playing back microphone input, manipulating streams with a selection of simple effects including pitch-changing, bandpassing and amplification, as well as mixing and splicing.
plaid/audio's scheduling system synchronizes audio with the program's framerate. It does this by dividing output into "timeslices" for each call to update(). This allows games to render their audio at their graphical framerate, with any changes in audio effects, synthesizers or samplers being audible every frame. Physics, animation or player input can thus have articulate audio feedback.Extensive documentation is now available here.
A Visual C++ example project is included, which plays a little song. It shouldn't be hard to build for other platforms; the audio engine code has previously been compiled for Windows, OS X, Linux and iOS, and the provided implementation layer (portaudio) is compatible with all but the latter.
Special thanks go to TIGS user randomshade
, who hired me for the work of separating this code from my game engine, with the understanding that it would be opensourced thereafter.
588kb (alpha)Demo Program
Backwards code compatibility is not
guaranteed with future versions.
Notable inconveniences at present:
- The only codec I've written is for OGG files. Further, it uses stb_vorbis, which can be a little picky about its input. If you control the files you use this isn't a problem. I'll accept codec contributions if they don't add library dependencies.
- The Audio module expects wide strings for the purpose of specifying audio files. (My game engine is unicode, but yours probably isn't)