From 6d442c0a175c63b368dac823c59871aa2c40c97a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 28 Feb 2021 23:47:57 +0900 Subject: [PATCH] audio: Add comments --- audio/audio.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/audio/audio.go b/audio/audio.go index 164691aaf..4cbfd97ef 100644 --- a/audio/audio.go +++ b/audio/audio.go @@ -102,8 +102,15 @@ func NewContext(sampleRate int) *Context { var np newPlayerImpler if isReaderContextAvailable() { + // 'Reader players' are players that implement io.Reader. This is the new way and + // not all the environments support reader players. Reader players can have enough + // buffers so that clicking noises can be avoided compared to writer players. + // Reder players will replace writer players in any platforms in the future. np = newReaderPlayerFactory(sampleRate) } else { + // 'Writer players' are players that implement io.Writer. This is the old way but + // all the environments support writer players. Writer players cannot have enough + // buffers and clicking noises are sometimes problematic (#1356, #1458). np = newWriterPlayerFactory(sampleRate) }