mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
Opening and closing the menu, moving the cursor, changing a value, pressing an item, cancelling a dialog and changing tabs play the game's system sounds (Plus menu open and close, cursor, decide, cancel, tab move), read from the user's RomFS at the first use and decoded from BWAV (DSP-ADPCM or PCM16, 48 kHz) in runtime/menu_sound.c. They are mixed over the game's output in the audio callback with up to eight voices started without locks. The Sound tab gets a Menu sounds volume (menu_sound_volume, 0 to 100, default 80, under the output volume). A RomFS without the files stays silent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
742 B
C
28 lines
742 B
C
// The settings menu's sounds, from the game's own interface sounds (menu_sound.c).
|
|
#pragma once
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
MENU_SOUND_OPEN,
|
|
MENU_SOUND_CLOSE,
|
|
MENU_SOUND_CURSOR,
|
|
MENU_SOUND_DECIDE,
|
|
MENU_SOUND_CANCEL,
|
|
MENU_SOUND_TAB_LEFT,
|
|
MENU_SOUND_TAB_RIGHT,
|
|
MENU_SOUND_COUNT
|
|
} MenuSound;
|
|
|
|
void menu_sound_play(MenuSound id); // menu thread
|
|
void menu_sound_preload(void); // decodes the sounds now (the first play does it otherwise)
|
|
// Audio thread: adds the playing sounds to frames of interleaved float output (channels 0 and 1 get them).
|
|
void menu_sound_mix(float *out, uint32_t frames, int channels, int rate);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|