From 329a2cb26418794a13f679104dade0477d1d7b5c Mon Sep 17 00:00:00 2001 From: Rinnegatamante Date: Thu, 17 Dec 2015 11:30:33 +0100 Subject: [PATCH] Added LOOP flag support for streaming with dsp. Added LOOP flag support for streaming with dsp. --- source/luaSound.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/luaSound.cpp b/source/luaSound.cpp index dd6af9b..cceaa9b 100644 --- a/source/luaSound.cpp +++ b/source/luaSound.cpp @@ -835,6 +835,12 @@ void streamOGG_DSP(void* arg){ // Check if file reached EOF if (src->audio_pointer >= src->size){ + // Looping feature (TODO: Seems to not work) + if (src->streamLoop){ + ov_raw_seek((OggVorbis_File*)src->sourceFile,0); + src->audio_pointer = 0; + } + // Check if playback ended if (!ndspChnIsPlaying(src->ch)){ src->isPlaying = false; @@ -1071,7 +1077,10 @@ void streamWAV_DSP(void* arg){ // Check if file reached EOF if (src->audio_pointer >= src->size){ - + + // Looping feature + if (src->streamLoop) src->audio_pointer = src->startRead; + // Check if playback ended if (!ndspChnIsPlaying(src->ch)){ src->isPlaying = false;