feat: couple terrain surge and sun bloom to the soundtrack's low end

This commit is contained in:
2026-10-10 17:46:17 +03:00
parent 416b930523
commit 0821b542b5
5 changed files with 93 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ import {
} from 'vue';
import { createAudioController } from '@/audio/create-audio-controller';
import { createBrowserSoundtrackEngine } from '@/audio/soundtrack-engine';
import { setMusicPulseAudible } from '@/audio/music-pulse';
import type {
AudioController,
AudioUiState,
@@ -65,6 +66,10 @@ export function useAudioEngine(sources: AudioEngineSources): AudioEngineBinding
watch(sources.chapter, (intent) => controller?.setChapterIntent(intent), { flush: 'sync' });
watch(sources.drive, (sample) => controller?.setDriveEnergy(sample), { flush: 'sync' });
watch(sources.volume, (value) => controller?.setVolume(value));
// The world only answers the music the visitor can actually hear.
watch(state, (next) => {
setMusicPulseAudible(next.kind === 'running' && !next.muted && next.volume > 0);
});
onMounted(() => {
ensureController();