mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-18 12:08:38 +00:00
At 100/100/100 the RomFS, zstd and Opus hooks and the mixer lookup are skipped (audio_cat_active); the RomFS handle still keeps its category, so a stream opened earlier is classified by its later reads once a setting moves. The mixer keeps each voice's category until it moves to another wave buffer or coefficient table, instead of up to six scans of a 32768-entry ring per voice per frame; the ring is 4096 entries and lookups take its lock. zstd decodes check the BARS magic before any lookup. The guesses from BWAV headers (Opus means voice, stereo ADPCM means music) are gone: Opus streams are the DmT cutscene beds and stereo ADPCM is common among effects. Unknown Opus output counts as effects. A once-a-minute log line counts the categories while a setting is below 100. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1.0 KiB
C
31 lines
1.0 KiB
C
// Sound categories for the music / effects / voice volume settings (audio_cat.c).
|
|
#ifndef TOTK_AUDIO_CAT_H
|
|
#define TOTK_AUDIO_CAT_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
enum {
|
|
AUDIO_CAT_UNKNOWN = 0,
|
|
AUDIO_CAT_MUSIC = 1,
|
|
AUDIO_CAT_SFX = 2,
|
|
AUDIO_CAT_VOICE = 3,
|
|
};
|
|
|
|
int audio_cat_active(void); // one of volume_music / volume_sfx / volume_voice is below 100
|
|
int audio_cat_from_path(const char *path); // a RomFS-relative path; UNKNOWN outside Sound/Resource/
|
|
void audio_cat_tag_range(uint64_t addr, uint64_t size, int cat);
|
|
void audio_cat_scan_bars(uint64_t dst, uint64_t size, int fallback_cat);
|
|
void audio_cat_scan_bwav(const void *data, uint64_t size, int cat);
|
|
void audio_cat_on_opus_decode(uint64_t decoder_guest, uint64_t in_addr, uint64_t out_addr, uint64_t out_size);
|
|
int audio_cat_lookup(uint64_t addr);
|
|
int audio_cat_lookup_coef(uint64_t extra_addr, uint64_t extra_size);
|
|
void audio_cat_log_tables(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|