From ddee25d7ece8a1cd87cb33c321dac202a4daa4e3 Mon Sep 17 00:00:00 2001 From: Glought Date: Thu, 20 Nov 2025 10:31:41 -0800 Subject: [Audio Editor] Port Audio Options from SoH Audio Editor (#1325) * Ported Audio Options from SoH Audio Editor *Moved "Mute Low HP Alarm" to Audio Editor -> Audio Options Changed Cvar From: "gEnhancements.Sfx.LowHpAlarm" To: "gAudioEditor.LowHpAlarm" *Moved "Mute Carpenter Sounds" to Audio Editor -> Audio Options Changed Cvar From: "gEnhancements.Sfx.MuteCarpenterSfx" To: "gAudioEditor.MuteCarpenterSfx" *Moved "Mute Crying Goron Child" to Audio Editor -> Audio Options Changed Cvar From: "gEnhancements.Sfx.ChildGoronCry" To: "gAudioEditor.ChildGoronCry" *Added "Disable Tatle Call Audio" *Added "Disable Enemy Proximity Music" *Added "Randomize All Music and Sound Effects on New Scene" *Added "Randomize All Music and Sound Effects on Randomizer Generation" *Added "Display Sequence Name on Overlay" and "Overlay Duration" Slider *Added "Link's Voice Pitch Multiplier" Slider * *Ported "AddSearchWidget" Functionally Enabled for Audio Editor -> Audio Options * Cleaned up some code I missed and ran clang format. * Renamed "OnScene" Hook to "OnSceneChange" * Made it so "Link's Voice Pitch Multiplier" slider only effects Link's voice. * Forgot the "AudioHook.cpp" file its needed for the "Display Sequence Name on Overlay" option. * Moved the "Sfx" folder to the "Audio" folder. * Removed extra line breaks between sections in "RegisterAudioWidgets()". * Renamed "OnGenerationCompletion" hook to "OnRandoSeedGeneration" * Changed "gAudioEditor.*" to use "CVAR_AUDIO("*") in "AudioEditor.cpp" * Added "AddAudioSearchWidget" function Changed all "BenGui::mBenMenu->AddSearchWidget lines to use "AddAudioSearchWidget". * Changed the "OnSeqPlayerInit" hook parameters type to use the "s32" Macro. * Update BenMenu/BenGui include paths: Replaced "../../" with "2s2h/". * Ran Clang Format. * Added "DisableEnemyProximityMusic.cpp" Added "VB_PLAY_ENEMY_PROXIMITY_MUSIC" enum to "GIVanillaBehavior" in "GameInteractor.h" "Audio_UpdateEnemyBgmVolume" is now wrapped in a "GameInteractor_Should" * Added "DisableTatlCallAudio.cpp" Added "VB_PLAY_TATL_CALL_AUDIO" enum to "GIVanillaBehavior" in "GameInteractor.h" "Audio_PlaySfx(NA_SE_VO_NAVY_CALL)" is now wrapped in a "GameInteractor_Should" * Added "LinksVoicePitchMultiplier.cpp" Added "Enable Link's Voice Pitch Multiplier" checkbox to Audio Editor The "Link's Voice Pitch Multiplier" slider is now disabled when "Enable Link's Voice Pitch Multiplier" is not enabled. Added "VB_LINK_VOICE_PITCH_MULTIPLIER" enum to "GIVanillaBehavior" in "GameInteractor.h" "AudioSfx_PlaySfx" in the file "z_actor.c" in function "Player_PlaySfx" is now wrapped in a "GameInteractor_Should". * Removed "OnSceneChange" Hook. Removed "GameInteractor_ExecuteOnSceneChange". Removed "GameInteractor_ExecuteOnSceneChange(play->sceneId);" from "z_play_2SH.cpp:OTRPlay_SpawnScene" function Renamed "AudioEditorRegisterOnSceneChangeHook" to AudioEditorRegisterOnRoomInitHook". * Made Changes requested by Eblo to "LinksVoicePitchMultiplier.cpp" and "z_actor.c" * WIP Randomize On New Scene --- mm/src/code/z_actor.c | 6 ++++-- mm/src/code/z_parameter.c | 13 ++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'mm/src/code') diff --git a/mm/src/code/z_actor.c b/mm/src/code/z_actor.c index 8c86e337e..6fed8a875 100644 --- a/mm/src/code/z_actor.c +++ b/mm/src/code/z_actor.c @@ -2486,8 +2486,10 @@ void Player_PlaySfx(Player* player, u16 sfxId) { if (player->currentMask == PLAYER_MASK_GIANT) { Audio_PlaySfx_AtPosWithPresetLowFreqAndHighReverb(&player->actor.projectedPos, sfxId); } else { - AudioSfx_PlaySfx(sfxId, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + if (GameInteractor_Should(VB_LINK_VOICE_PITCH_MULTIPLIER, true, &sfxId)) { + AudioSfx_PlaySfx(sfxId, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } } } diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c index f18287569..9cea7ffce 100644 --- a/mm/src/code/z_parameter.c +++ b/mm/src/code/z_parameter.c @@ -5091,12 +5091,15 @@ void Interface_SetTatlCall(PlayState* play, u16 tatlCallState) { if (((tatlCallState == TATL_STATE_2A) || (tatlCallState == TATL_STATE_2B)) && !interfaceCtx->tatlCalling && (play->csCtx.state == CS_STATE_IDLE)) { - if (tatlCallState == TATL_STATE_2B) { - Audio_PlaySfx(NA_SE_VO_NAVY_CALL); - } - if (tatlCallState == TATL_STATE_2A) { - Audio_PlaySfx_AtPosWithReverb(&gSfxDefaultPos, NA_SE_VO_NA_HELLO_2, 0x20); + if (GameInteractor_Should(VB_PLAY_TATL_CALL_AUDIO, true)) { + if (tatlCallState == TATL_STATE_2B) { + Audio_PlaySfx(NA_SE_VO_NAVY_CALL); + } + if (tatlCallState == TATL_STATE_2A) { + Audio_PlaySfx_AtPosWithReverb(&gSfxDefaultPos, NA_SE_VO_NA_HELLO_2, 0x20); + } } + interfaceCtx->tatlCalling = true; sCUpInvisible = 0; sCUpTimer = 10; -- cgit v1.2.3