audio: Add comments

Updates #1888
This commit is contained in:
Hajime Hoshi 2021-11-30 21:56:44 +09:00
parent 2d231c8454
commit 1eb5d4a188

View File

@ -39,6 +39,12 @@ type InfiniteLoop struct {
}
// NewInfiniteLoop creates a new infinite loop stream with a source stream and length 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 NewInfiniteLoop(src io.ReadSeeker, length int64) *InfiniteLoop {
return NewInfiniteLoopWithIntro(src, 0, length)
}