papermario
Decompilation of Paper Mario
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
voice.c File Reference

Functions

void au_flush_finished_voices (AuGlobals *globals)
 (UNUSED) Immediately flush all voices which have finished playing.
 
void au_init_voices (AuGlobals *globals)
 Initializes all voices in the audio system.
 
void au_update_voices (AuGlobals *globals)
 Main envelope system update, called once per frame.
 
void au_voice_after_volume_change (AuVoice *voice)
 Applies volume update after a client-side volume change.
 
s32 au_voice_get_delta (s32 usecs)
 Converts envelope step duration from microseconds to num samples delta.
 
void au_voice_start (AuVoice *voice, EnvelopeData *envData)
 Starts a new voice with the given envelope data.
 
u8 au_voice_step (AuVoice *voice)
 Parses and executes envelope commands until a time interval is found.
 
void au_voice_set_vol_changed (AuVoice *voice)
 (UNUSED) Force recalculation of voice envelope volume during next update.
 

Function Documentation

◆ au_flush_finished_voices()

void au_flush_finished_voices ( AuGlobals * globals)

(UNUSED) Immediately flush all voices which have finished playing.

These are normally released automatically during the start of each audio frame.

◆ au_init_voices()

void au_init_voices ( AuGlobals * globals)

Initializes all voices in the audio system.

Sets default values and clears previous envelope state.

Referenced by au_engine_init().

◆ au_update_voices()

void au_update_voices ( AuGlobals * globals)

Main envelope system update, called once per frame.

Progresses envelope state for all active voices.

Referenced by au_update_clients_for_audio_frame().

◆ au_voice_after_volume_change()

void au_voice_after_volume_change ( AuVoice * voice)

Applies volume update after a client-side volume change.

This is deferred to avoid modifying envelope state mid-step.

Referenced by au_update_voices().

◆ au_voice_get_delta()

s32 au_voice_get_delta ( s32 usecs)

Converts envelope step duration from microseconds to num samples delta.

Uses AU_FRAME_USEC as the base time slice, returning the number of audio samples corresponding to the provided duration.

Parameters
msecsTime duration in microseconds.
Returns
Number of samples that should pass in this interval.

Referenced by au_update_voices(), au_voice_after_volume_change(), and au_voice_start().

◆ au_voice_set_vol_changed()

void au_voice_set_vol_changed ( AuVoice * voice)

(UNUSED) Force recalculation of voice envelope volume during next update.

◆ au_voice_start()

void au_voice_start ( AuVoice * voice,
EnvelopeData * envData )

Starts a new voice with the given envelope data.

Initializes envelope state and prepares the press phase for playback.

Parameters
voicePointer to the voice being started.
envDataEnvelope command lists (press and release) to use.

Referenced by au_syn_begin_audio_frame().

◆ au_voice_step()

u8 au_voice_step ( AuVoice * voice)

Parses and executes envelope commands until a time interval is found.

Commands include setting multipliers, loop control, etc.

Referenced by au_update_voices(), and au_voice_start().