Add per-node scene music volume control

Author a music track and volume (0-100%) per story node; the runtime
scales it to 0-1 and applies it without restarting the track when only
the level changes. Adds migration 024, threads music_volume through the
repository/runtime, and gives the node inspector a volume slider.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-18 21:02:16 +02:00
co-authored by Claude Opus 4.8
parent 80e5f548ac
commit 1b3ff1e78c
8 changed files with 36 additions and 22 deletions
+1 -1
View File
@@ -155,7 +155,7 @@ export function App() {
// Scene music follows the current node (null inherits; a finished playthrough stops).
useEffect(() => {
if (runtimeNode?.musicUrl) audio.setMusic(runtimeNode.musicUrl)
if (runtimeNode?.musicUrl) audio.setMusic(runtimeNode.musicUrl, runtimeNode.musicVolume)
else if (playthrough?.status === 'finished') audio.setMusic(null)
}, [runtimeNode, playthrough])