feat(audio): add SetVolume() and Volume()
This commit is contained in:
parent
d1ed55677e
commit
678670fd37
2 changed files with 16 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue