From 52201a39fa6e51399915191a16c6245b71bc4b27 Mon Sep 17 00:00:00 2001 From: QBaraki Date: Fri, 24 Oct 2025 15:12:29 +0700 Subject: [PATCH] fix(music): Fix the audio volume from music stream not detecting the desired volume Apparently, Yonokid used default value for a parameter in play_music_stream in file `libs/audio.py` and forgot to pass the supposed argument when using the function. This commit will completely kill that default value and pass the correct parameter's value (which is `music`). Please don't use default parameter anymore, Yono. --- libs/audio.py | 2 +- scenes/game.py | 2 +- scenes/song_select.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/audio.py b/libs/audio.py index 1781a55..366c1c5 100644 --- a/libs/audio.py +++ b/libs/audio.py @@ -327,7 +327,7 @@ class AudioEngine: print(f"Failed to load music: {file_path}") return "" - def play_music_stream(self, name: str, volume_preset: str = '') -> None: + def play_music_stream(self, name: str, volume_preset: str) -> None: """Play a music stream""" if name in self.music_streams: music = self.music_streams[name] diff --git a/scenes/game.py b/scenes/game.py index 159a0f8..4083865 100644 --- a/scenes/game.py +++ b/scenes/game.py @@ -165,7 +165,7 @@ class GameScreen: def start_song(self, current_time): if (self.current_ms >= self.tja.metadata.offset*1000 + self.start_delay - global_data.config["general"]["judge_offset"]) and not self.song_started: if self.song_music is not None: - audio.play_music_stream(self.song_music) + audio.play_music_stream(self.song_music, 'music') print(f"Song started at {self.current_ms}") if self.movie is not None: self.movie.start(current_time) diff --git a/scenes/song_select.py b/scenes/song_select.py index 50d766a..eb290bb 100644 --- a/scenes/song_select.py +++ b/scenes/song_select.py @@ -285,7 +285,7 @@ class SongSelectScreen: song.box.get_scores() if song.tja.metadata.wave.exists() and song.tja.metadata.wave.is_file(): self.demo_song = audio.load_music_stream(song.tja.metadata.wave, 'demo_song') - audio.play_music_stream(self.demo_song) + audio.play_music_stream(self.demo_song, 'music') audio.seek_music_stream(self.demo_song, song.tja.metadata.demostart) audio.stop_sound('bgm') if song.box.is_open: