From: Hraban Luyat Date: Thu, 9 Jul 2015 13:34:52 +0000 (+0000) Subject: Elaborate docs for Read functions X-Git-Tag: v2.0.0~92 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4b7e292ab193d2e6ccd6c86d2361e5c056fa006b;p=go-opus.git Elaborate docs for Read functions --- 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")