Fix an error with sound positioning in play_sound.
This commit is contained in:
parent
d513927d52
commit
e0fab91260
6
sound.py
6
sound.py
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user