A versatile audio engine written in C++ for GameCube and Wii homebrew.
AudiOGC supports common audio formats, simultaneous playback, and other useful features, all without the headaches of working with audio streams and threads directly. It is designed to be easy to use and integrate into homebrew projects of any kind. AudiOGC also utilizes efficient libraries for its operations, making it faster and more lightweight.
Supported formats:
- FLAC
- MP3
- (Ogg) Vorbis
- WAV
More formats may be added in the future.
Check out the audio demo!
Before following these instructions, you will need to install devkitPro and devkitPPC.
The quickest way to install AudiOGC is by adding the htv-dkp-libs repository, allowing you to install AudiOGC and its dependencies from pacman. Follow the instructions here.
After setting up the repository, install the wii-audiogc and/or gamecube-audiogc package(s) via pacman.
Alternatively, you can install AudiOGC and its dependencies manually.
- Download the latest libogc-mod commit and copy its contents to
$DEVKITPRO. - Download the latest version of AudiOGC and copy its contents to
$DEVKITPRO/libogc-mod/portlibs. Create theportlibsdirectory if it doesn't exist yet.
Here's a quick example of how to use AudiOGC.
- Make sure the following libraries are linked in your Makefile:
LIBS += -laudiogc -laesnd -lfat- Include the following header files in your project:
#include <aesndlib.h> // AESND
#include <fat.h> // libfat
#include <audiogc.hpp> // AudiOGC- Next, initialize AESND (AudiOGC's backend), and libfat (for reading audio files from an SD card):
AESND_Init();
fatInitDefault();- Finally, create a
playerobject and play it:
audiogc::player my_player = audiogc::player(audiogc::types::detect, "sd:/path/to/audio/file");
my_player.play();Refer to the wiki for more documentation.
Ensure devkitPro and devkitPPC are installed before proceeding.
- Download the latest libogc-mod commit and copy its contents to
$DEVKITPRO. - Clone this repo and run
make installto build for the Wii, ormake PLATFORM=gamecube installto build for the GameCube.- Omit
installif you would just like to build AudiOGC without installing. - You will need to run
make cleanbefore switching platforms when compiling.
- Omit
AudiOGC will be built and installed to $DEVKITPRO/libogc-mod/portlibs/[platform].
It is recommended to use libogc-mod with AudiOGC because it has more fixes and features than the original libogc. However, if desired or necessary, you can build AudiOGC using libogc or libogc2.
Append LIBOGC_VER=libogc or LIBOGC_VER=libogc2 to the make command to use libogc or libogc2 when building.
Install paths:
- libogc:
$DEVKITPRO/portlibs/[platform] - libogc2:
$DEVKITPRO/libogc2/portlibs/[platform]
NOTE: The libogc2 path is technically unofficial, because it's not included in the PORTLIBS variable. However, it helps separate it from other versions that may be present. Be sure to add it to your Makefile:
LIBDIRS := $(PORTLIBS) $(DEVKITPRO)/libogc2/portlibs/[platform]AudiOGC uses AESND as its audio backend. AESND's functions can be used in conjunction with AudiOGC as long as they are not modifying anything from AudiOGC's players.
The FLAC, MP3, and WAV formats are supported by their respective dr_libs. The Vorbis format is supported by stb_vorbis.