From 26bc94ca4a2058e3ed231103137aacd9a54a025c Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 4 Apr 2016 02:16:26 +0900 Subject: [PATCH] audio: Reduce panic --- exp/audio/audio.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exp/audio/audio.go b/exp/audio/audio.go index 2800cccd8..837cb5287 100644 --- a/exp/audio/audio.go +++ b/exp/audio/audio.go @@ -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) {