Add new core and audio functions

This commit is contained in:
Milan Nikolic 2023-11-07 13:56:05 +01:00
parent 1ffd9fb3ca
commit c0b171213e
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
3 changed files with 31 additions and 1 deletions

View file

@ -52,6 +52,13 @@ func SetMasterVolume(volume float32) {
C.SetMasterVolume(cvolume)
}
// GetMasterVolume - Set master volume (listener)
func GetMasterVolume() float32 {
ret := C.GetMasterVolume()
v := float32(ret)
return v
}
// LoadWave - Load wave data from file into RAM
func LoadWave(fileName string) Wave {
cfileName := C.CString(fileName)
@ -97,6 +104,14 @@ func LoadSoundFromWave(wave Wave) Sound {
return v
}
// LoadSoundAlias - Create a new sound that shares the same sample data as the source sound, does not own the sound data
func LoadSoundAlias(source Sound) Sound {
csound := source.cptr()
ret := C.LoadSoundAlias(*csound)
v := newSoundFromPointer(unsafe.Pointer(&ret))
return v
}
// IsSoundReady - Checks if a sound is ready
func IsSoundReady(sound Sound) bool {
csound := sound.cptr()