1
0
Fork 0

feat(audio): add SetVolume() and Volume()

This commit is contained in:
Henrik Hautakoski 2025-10-27 20:13:34 +01:00
parent d1ed55677e
commit 678670fd37
2 changed files with 16 additions and 0 deletions

View file

@ -6,6 +6,14 @@ func LoadLibrary(library *Library) {
defaultManager.Load(library)
}
func SetVolume(value float32) {
defaultManager.SetVolume(value)
}
func Volume() float32 {
return defaultManager.Volume()
}
func Play(id SoundID) {
defaultManager.Play(id)
}

View file

@ -21,6 +21,14 @@ func (sm *Manager) Load(library *Library) {
sm.library = library
}
func (sm Manager) SetVolume(value float32) {
rl.SetMasterVolume(value)
}
func (sm Manager) Volume() float32 {
return rl.GetMasterVolume()
}
func (sm *Manager) play(id SoundID, looping bool) {
snd := sm.library.Get(id)