From de67e91f8c6152ff41a3b4f7a38c751577786533 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 1 Feb 2021 20:55:39 -0500 Subject: [PATCH] loop resampled vorbis --- simpleaudio.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simpleaudio.d b/simpleaudio.d index eae0307..c1744ae 100644 --- a/simpleaudio.d +++ b/simpleaudio.d @@ -681,7 +681,13 @@ final class AudioPcmOutThreadImplementation : Thread { tmp[0] = buffersIn[0].ptr; tmp[1] = buffersIn[1].ptr; + loop: auto actuallyGot = v.getSamplesFloat(v.chans, tmp.ptr, cast(int) buffersIn[0].length); + if(actuallyGot == 0 && loop) { + v.seekStart(); + scf.currentPosition = 0; + goto loop; + } resamplerDataLeft.dataIn = buffersIn[0][0 .. actuallyGot]; if(v.chans > 1)