1
0
Fork 0

fix(audio): implement IsPlaying() correctly

cant use rl.IsSoundPlaying() because we create sound aliases.
so we must look at the sm.active slice instead
This commit is contained in:
Henrik Hautakoski 2025-09-26 12:09:05 +02:00
parent cb6e66bc45
commit 1b187d7412

View file

@ -55,7 +55,9 @@ func (sm *Manager) Stop(id SoundID) {
}
func (sm Manager) IsPlaying(id SoundID) bool {
return rl.IsSoundPlaying(*sm.library.Get(id))
return slices.ContainsFunc(sm.active, func(e audio) bool {
return e.id == id
})
}
// Pause all active sounds