From 4b7e292ab193d2e6ccd6c86d2361e5c056fa006b Mon Sep 17 00:00:00 2001 From: Hraban Luyat Date: Thu, 9 Jul 2015 13:34:52 +0000 Subject: [PATCH] Elaborate docs for Read functions --- stream.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stream.go b/stream.go index 53a7b74..a59efb9 100644 --- a/stream.go +++ b/stream.go @@ -84,6 +84,9 @@ func (s *Stream) Init(read io.Reader) error { // Read a chunk of raw opus data from the stream and decode it. Returns the // number of decoded samples per channel. This means that a dual channel // (stereo) feed will have twice as many samples as the value returned. +// +// Read may successfully read less bytes than requested, but it will never read +// exactly zero bytes succesfully if a non-zero buffer is supplied. func (s *Stream) Read(pcm []int16) (int, error) { if s.oggfile == nil { return 0, fmt.Errorf("opus stream is uninitialized or already closed") -- 2.48.1