libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
WutAudioDriver Class Reference

Wii U AudioDriver: AX (sndcore2), 16 fixed AXVoice slots for one-shots plus a dedicated stereo streaming path (two AXVoices, ring-buffered) fed by a GuiSoundOggPlayer for the background stream. More...

#include <WutAudioDriver.h>

Inheritance diagram for WutAudioDriver:
[legend]

Public Member Functions

void init () override
 Allocates the backend's audio resources. Does not start playback; see start().
 
void start () override
 Starts the audio backend running (eg. registers the DSP/AX callback).
 
void stop () override
 Stops the audio backend.
 
void shutdown () override
 Releases everything init() allocated. Call stop() first.
 
int32_t playVoice (const uint8_t *data, int32_t length, int volume) override
 Start a one-shot/short PCM voice.
 
void stopVoice (int32_t voice) override
 Stops a voice returned by playVoice() and frees its slot.
 
void pauseVoice (int32_t voice) override
 Pauses a playing voice, keeping its position and slot.
 
void resumeVoice (int32_t voice) override
 Resumes a voice paused with pauseVoice().
 
bool isVoicePlaying (int32_t voice) override
 
void setVoiceVolume (int32_t voice, int volume) override
 Changes the volume of a playing voice.
 
void playStream (const uint8_t *data, int32_t length, bool loop, int volume) override
 Streamed (OGG) playback.
 
void stopStream () override
 Stops the stream started by playStream().
 
void pauseStream () override
 Pauses the stream, keeping its position.
 
void resumeStream () override
 Resumes a stream paused with pauseStream().
 
bool isStreamPlaying () override
 
void setStreamVolume (int volume) override
 Changes the stream volume.
 
void handleStreamCallback ()
 AX frame callback hook that refills the stream ring buffers.
 

Detailed Description

Wii U AudioDriver: AX (sndcore2), 16 fixed AXVoice slots for one-shots plus a dedicated stereo streaming path (two AXVoices, ring-buffered) fed by a GuiSoundOggPlayer for the background stream.

Definition at line 18 of file WutAudioDriver.h.

Member Function Documentation

◆ handleStreamCallback()

void WutAudioDriver::handleStreamCallback ( )

AX frame callback hook that refills the stream ring buffers.

Not part of the AudioDriver interface.

Definition at line 276 of file WutAudioDriver.cpp.

◆ init()

void WutAudioDriver::init ( )
overridevirtual

Allocates the backend's audio resources. Does not start playback; see start().

Implements AudioDriver.

Definition at line 38 of file WutAudioDriver.cpp.

◆ isStreamPlaying()

bool WutAudioDriver::isStreamPlaying ( )
overridevirtual
Returns
true while the stream is playing.

Implements AudioDriver.

Definition at line 387 of file WutAudioDriver.cpp.

◆ isVoicePlaying()

bool WutAudioDriver::isVoicePlaying ( int32_t voice)
overridevirtual
Returns
true while the voice is still playing (false once it has finished or been stopped).

Implements AudioDriver.

Definition at line 178 of file WutAudioDriver.cpp.

◆ pauseStream()

void WutAudioDriver::pauseStream ( )
overridevirtual

Pauses the stream, keeping its position.

Implements AudioDriver.

Definition at line 375 of file WutAudioDriver.cpp.

◆ pauseVoice()

void WutAudioDriver::pauseVoice ( int32_t voice)
overridevirtual

Pauses a playing voice, keeping its position and slot.

Implements AudioDriver.

Definition at line 168 of file WutAudioDriver.cpp.

◆ playStream()

void WutAudioDriver::playStream ( const uint8_t * data,
int32_t length,
bool loop,
int volume )
overridevirtual

Streamed (OGG) playback.

There is no per-call stream handle, only one can play at a time.

Implements AudioDriver.

Definition at line 193 of file WutAudioDriver.cpp.

◆ playVoice()

int32_t WutAudioDriver::playVoice ( const uint8_t * data,
int32_t length,
int volume )
overridevirtual

Start a one-shot/short PCM voice.

Returns a backend-defined voice handle (>=0) on success, or a negative value if no voice was available.

Implements AudioDriver.

Definition at line 123 of file WutAudioDriver.cpp.

◆ resumeStream()

void WutAudioDriver::resumeStream ( )
overridevirtual

Resumes a stream paused with pauseStream().

Implements AudioDriver.

Definition at line 381 of file WutAudioDriver.cpp.

◆ resumeVoice()

void WutAudioDriver::resumeVoice ( int32_t voice)
overridevirtual

Resumes a voice paused with pauseVoice().

Implements AudioDriver.

Definition at line 173 of file WutAudioDriver.cpp.

◆ setStreamVolume()

void WutAudioDriver::setStreamVolume ( int volume)
overridevirtual

Changes the stream volume.

Parameters
volumeVolume, 0-100

Implements AudioDriver.

Definition at line 391 of file WutAudioDriver.cpp.

◆ setVoiceVolume()

void WutAudioDriver::setVoiceVolume ( int32_t voice,
int volume )
overridevirtual

Changes the volume of a playing voice.

Parameters
voiceVoice handle returned by playVoice()
volumeVolume, 0-100

Implements AudioDriver.

Definition at line 184 of file WutAudioDriver.cpp.

◆ shutdown()

void WutAudioDriver::shutdown ( )
overridevirtual

Releases everything init() allocated. Call stop() first.

Implements AudioDriver.

Definition at line 105 of file WutAudioDriver.cpp.

◆ start()

void WutAudioDriver::start ( )
overridevirtual

Starts the audio backend running (eg. registers the DSP/AX callback).

Implements AudioDriver.

Definition at line 97 of file WutAudioDriver.cpp.

◆ stop()

void WutAudioDriver::stop ( )
overridevirtual

Stops the audio backend.

Implements AudioDriver.

Definition at line 101 of file WutAudioDriver.cpp.

◆ stopStream()

void WutAudioDriver::stopStream ( )
overridevirtual

Stops the stream started by playStream().

Implements AudioDriver.

Definition at line 369 of file WutAudioDriver.cpp.

◆ stopVoice()

void WutAudioDriver::stopVoice ( int32_t voice)
overridevirtual

Stops a voice returned by playVoice() and frees its slot.

Implements AudioDriver.

Definition at line 161 of file WutAudioDriver.cpp.


The documentation for this class was generated from the following files: