audio: Add comment at NewInfiniteLoopWithIntro about the noises

Updates #1888
This commit is contained in:
Hajime Hoshi 2021-11-30 00:28:40 +09:00
parent c91a6fb81f
commit 2d231c8454

View File

@ -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,