Skip to content
/ audiogc Public

A versatile audio engine written in C++ for GameCube and Wii homebrew.

License

Notifications You must be signed in to change notification settings

HTV04/audiogc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AudiOGC

A versatile audio engine written in C++ for GameCube and Wii homebrew.

GitHub release (latest SemVer including pre-releases) GitHub issues GitHub pull requests GitHub Discord

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!

Installation

Before following these instructions, you will need to install devkitPro and devkitPPC.

Pacman

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.

Manual installation

Alternatively, you can install AudiOGC and its dependencies manually.

Usage

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 player object 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.

Building

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 install to build for the Wii, or make PLATFORM=gamecube install to build for the GameCube.
    • Omit install if you would just like to build AudiOGC without installing.
    • You will need to run make clean before switching platforms when compiling.

AudiOGC will be built and installed to $DEVKITPRO/libogc-mod/portlibs/[platform].

Using libogc or libogc2

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]

Libraries

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.

Special thanks

  • Extrems, for helping me out tons with issues I had during AudiOGC's development.
  • mackron, for developing dr_libs and helping me figure out issues I was having with the libraries.
  • nothings, for developing stb_vorbis.
  • devkitPro, for making GameCube and Wii homebrew possible. ❤

About

A versatile audio engine written in C++ for GameCube and Wii homebrew.

Resources

License

Stars

Watchers

Forks

Packages

No packages published