From 2d231c8454ad199ecf2b8adc057f17a62253e4fd Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 30 Nov 2021 00:28:40 +0900 Subject: [PATCH] audio: Add comment at NewInfiniteLoopWithIntro about the noises Updates #1888 --- audio/loop.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/audio/loop.go b/audio/loop.go index ad3b6df77..edcbc0814 100644 --- a/audio/loop.go +++ b/audio/loop.go @@ -45,6 +45,12 @@ func NewInfiniteLoop(src io.ReadSeeker, length int64) *InfiniteLoop { // NewInfiniteLoopWithIntro creates a new infinite loop stream with an intro part. // NewInfiniteLoopWithIntro accepts a source stream src, introLength in bytes and loopLength in bytes. +// +// If the loop's total length is exactly the same as src's length, you might hear noises around the loop joint. +// This noise can be heard especially when src is decoded from a lossy compression format like Ogg/Vorbis and MP3. +// In this case, try to add more (about 0.1[s]) data to src after the loop end. +// If src has data after the loop end, an InfiniteLoop uses part of the data to blend with the loop start +// to make the loop joint smooth. func NewInfiniteLoopWithIntro(src io.ReadSeeker, introLength int64, loopLength int64) *InfiniteLoop { return &InfiniteLoop{ src: src,