Fix an error with sound positioning in play_sound.

This commit is contained in:
Storm Dragon 2025-03-17 20:47:41 -04:00
parent d513927d52
commit e0fab91260

View File

@ -103,7 +103,8 @@ class Sound:
channel = sound.play(loopParam)
if channel:
channel.set_volume(volume * self.volumeService.get_sfx_volume())
sfx_volume = volume * self.volumeService.get_sfx_volume()
channel.set_volume(sfx_volume, sfx_volume) # Explicitly set both channels to ensure centered sound
# Store in active loops if looping
if loop:
@ -836,7 +837,8 @@ def play_sound(sound, volume=1.0, loop=False):
channel = sound.play(loopParam)
if channel:
channel.set_volume(volume * volumeService.get_sfx_volume())
sfx_volume = volume * volumeService.get_sfx_volume()
channel.set_volume(sfx_volume, sfx_volume) # Explicitly set both channels to ensure centered sound
return channel
def obj_play(sounds, soundName, playerPos, objPos, playerY=0, objY=0, loop=False):