MCPcopy Index your code
hub / github.com/EngoEngine/engo / SetVolume

Method SetVolume

common/audio_player.go:289–299  ·  view source on GitHub ↗

SetVolume sets the Player's volume volume can only be set from 0 to 1

(volume float64)

Source from the content-addressed store, hash-verified

287// SetVolume sets the Player's volume
288// volume can only be set from 0 to 1
289func (p *Player) SetVolume(volume float64) {
290 // The condition must be true when volume is NaN.
291 if volume < 0 || volume > 1 {
292 log.Println("Volume can only be set between zero and one. Volume was not set.")
293 return
294 }
295
296 p.sync(func() {
297 p.volume = volume * masterVolume
298 })
299}
300
301var masterVolume float64
302

Callers 2

TestAudioPlayerVolumeFunction · 0.80
UpdateMethod · 0.80

Calls 1

syncMethod · 0.95

Tested by 1

TestAudioPlayerVolumeFunction · 0.64