From bbfab235665a7246b33fcba9dbcc4b0e40a9783e Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Feb 2026 16:04:59 -0800 Subject: [PATCH] Replace blacksmith weapon sounds with proper BlackSmith ambience loop Replaces the pitch-shifted weapon hit sound hack with the official Sound\Ambience\WMOAmbience\BlackSmith.wav ambience loop. This provides authentic blacksmith atmosphere with natural hammer strikes and anvil sounds. Changes: - Use proper blacksmith ambience file instead of modified weapon sounds - Remove pitch shifting (1.6x) - use natural sound at 1.0x pitch - Adjust volume to 0.6 (from 0.25) for ambient loop - Play every 15 seconds (from 2.5s) for natural atmosphere - Single loop file replaces 3 random weapon hit sounds --- src/audio/ambient_sound_manager.cpp | 31 +++++++++-------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/src/audio/ambient_sound_manager.cpp b/src/audio/ambient_sound_manager.cpp index 3db8e9f3..22205cb6 100644 --- a/src/audio/ambient_sound_manager.cpp +++ b/src/audio/ambient_sound_manager.cpp @@ -73,12 +73,9 @@ bool AmbientSoundManager::initialize(pipeline::AssetManager* assets) { tavernSounds_.resize(1); bool tavernLoaded = loadSound("Sound\\Ambience\\WMOAmbience\\Tavern.wav", tavernSounds_[0], assets); - // Load multiple hammer sounds for variety (short metal hit sounds) - blacksmithSounds_.resize(3); - bool bs1 = loadSound("Sound\\Item\\Weapons\\Mace1HMetal\\1hMaceMetalHitWoodCrit.wav", blacksmithSounds_[0], assets); - bool bs2 = loadSound("Sound\\Item\\Weapons\\Sword2H\\m2hSwordHitMetalShield1c.wav", blacksmithSounds_[1], assets); - bool bs3 = loadSound("Sound\\Item\\Weapons\\Axe2H\\m2hAxeHitChain1c.wav", blacksmithSounds_[2], assets); - bool blacksmithLoaded = (bs1 || bs2 || bs3); + // Load blacksmith ambience loop + blacksmithSounds_.resize(1); + bool blacksmithLoaded = loadSound("Sound\\Ambience\\WMOAmbience\\BlackSmith.wav", blacksmithSounds_[0], assets); LOG_INFO("AmbientSoundManager: Wind loaded: ", windLoaded ? "YES" : "NO", ", Tavern loaded: ", tavernLoaded ? "YES" : "NO", @@ -290,23 +287,13 @@ void AmbientSoundManager::updateBlacksmithAmbience(float deltaTime) { } } - if (hasSound) { + if (hasSound && blacksmithSounds_[0].loaded) { blacksmithLoopTime_ += deltaTime; - // Play every 2.5 seconds - rapid hammer strikes like real blacksmith - if (blacksmithLoopTime_ >= 2.5f) { - // Pick random hammer sound - int index = 0; - for (int i = 0; i < static_cast(blacksmithSounds_.size()); i++) { - if (blacksmithSounds_[i].loaded) { - index = i; - break; - } - } - - float volume = 0.25f * volumeScale_; // Reduced 30% from 0.35 - float pitch = 1.6f; // Higher pitch for metallic clink - AudioEngine::instance().playSound2D(blacksmithSounds_[index].data, volume, pitch); - LOG_INFO("Playing blacksmith ambience (hammer strike)"); + // Play blacksmith ambience loop every 15 seconds + if (blacksmithLoopTime_ >= 15.0f) { + float volume = 0.6f * volumeScale_; // Ambient loop volume + AudioEngine::instance().playSound2D(blacksmithSounds_[0].data, volume, 1.0f); + LOG_INFO("Playing blacksmith ambience loop"); blacksmithLoopTime_ = 0.0f; } }