From 22455002454d416acb8998b0658014ac02a01227 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 10 Jul 2022 21:39:13 +0200 Subject: [PATCH] Added comment about buffer refill issue on looping #2228 --- src/raudio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/raudio.c b/src/raudio.c index c48240195..4186ca60c 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1745,6 +1745,9 @@ void UpdateMusicStream(Music music) while (IsAudioStreamProcessed(music.stream)) { + // WARNING: If audio needs to loop but the frames left are less than the actual size of buffer to fill, + // the buffer is only partially filled and no refill is done until next frame call, generating a silence + // TODO: Possible solution: In case of music loop, fill frames left + frames from start to fill the buffer to process if (framesLeft >= subBufferSizeInFrames) frameCountToStream = subBufferSizeInFrames; else frameCountToStream = framesLeft;