From 4d3ad434b32a006086192172548f830d9e306df2 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 18 Apr 2017 01:25:23 +0900 Subject: [PATCH] audio/wav, audio/vorbis: Add comments about errors (#331) --- audio/vorbis/vorbis.go | 2 ++ audio/wav/decode.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/audio/vorbis/vorbis.go b/audio/vorbis/vorbis.go index 43a90cc22..947c22c42 100644 --- a/audio/vorbis/vorbis.go +++ b/audio/vorbis/vorbis.go @@ -174,6 +174,8 @@ func decode(in audio.ReadSeekCloser) (*decoded, int, int, error) { // Decode decodes Ogg/Vorbis data to playable stream. // +// Decode returns error when the source format is wrong. +// // Sample rate is automatically adjusted to fit with the audio context. func Decode(context *audio.Context, src audio.ReadSeekCloser) (*Stream, error) { decoded, channelNum, sampleRate, err := decode(src) diff --git a/audio/wav/decode.go b/audio/wav/decode.go index 45b1ba5e2..b086a064d 100644 --- a/audio/wav/decode.go +++ b/audio/wav/decode.go @@ -113,6 +113,8 @@ func (s *stream) Size() int64 { // The format must be 1 or 2 channels, 8bit or 16bit little endian PCM. // The format is converted into 2 channels and 16bit. // +// Decode returns error when the source format is wrong. +// // Sample rate is automatically adjusted to fit with the audio context. func Decode(context *audio.Context, src audio.ReadSeekCloser) (*Stream, error) { buf := make([]byte, 12)