diff --git a/audio/mp3/decode.go b/audio/mp3/decode.go index 4d43d8b63..05c7a177c 100644 --- a/audio/mp3/decode.go +++ b/audio/mp3/decode.go @@ -87,6 +87,9 @@ func DecodeWithoutResampling(src io.Reader) (*Stream, error) { // // A Stream doesn't close src even if src implements io.Closer. // Closing the source is src owner's responsibility. +// +// Resampling can be a very heavy task. Stream has a cache for resampling, but the size is limited. +// Do not expect that Stream has a resampling cache even after whole data is played. func DecodeWithSampleRate(sampleRate int, src io.Reader) (*Stream, error) { d, err := mp3.NewDecoder(src) if err != nil { diff --git a/audio/vorbis/vorbis.go b/audio/vorbis/vorbis.go index 63cf13ee1..71381ab9d 100644 --- a/audio/vorbis/vorbis.go +++ b/audio/vorbis/vorbis.go @@ -182,6 +182,9 @@ func DecodeWithoutResampling(src io.Reader) (*Stream, error) { // // A Stream doesn't close src even if src implements io.Closer. // Closing the source is src owner's responsibility. +// +// Resampling can be a very heavy task. Stream has a cache for resampling, but the size is limited. +// Do not expect that Stream has a resampling cache even after whole data is played. func DecodeWithSampleRate(sampleRate int, src io.Reader) (*Stream, error) { decoded, channelCount, origSampleRate, err := decode(src) if err != nil { diff --git a/audio/wav/decode.go b/audio/wav/decode.go index 1dc0489b3..abd8593b7 100644 --- a/audio/wav/decode.go +++ b/audio/wav/decode.go @@ -134,6 +134,9 @@ func DecodeWithoutResampling(src io.Reader) (*Stream, error) { // // A Stream doesn't close src even if src implements io.Closer. // Closing the source is src owner's responsibility. +// +// Resampling can be a very heavy task. Stream has a cache for resampling, but the size is limited. +// Do not expect that Stream has a resampling cache even after whole data is played. func DecodeWithSampleRate(sampleRate int, src io.Reader) (*Stream, error) { s, origSampleRate, err := decode(src) if err != nil {