mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
audio: Reduce panic
This commit is contained in:
parent
3d8de3254c
commit
26bc94ca4a
@ -261,6 +261,8 @@ func (p *Player) Volume() float64 {
|
||||
return p.volume
|
||||
}
|
||||
|
||||
// SetVolume sets the volume.
|
||||
// volume must be in between 0 and 1. This function panics otherwise.
|
||||
func (p *Player) SetVolume(volume float64) {
|
||||
// The condition must be true when volume is NaN.
|
||||
if !(0 <= volume && volume <= 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user