Skip to content
This repository has been archived by the owner on Oct 29, 2022. It is now read-only.

Commit

Permalink
Added LOOP flag support for streaming with dsp.
Browse files Browse the repository at this point in the history
Added LOOP flag support for streaming with dsp.
  • Loading branch information
Rinnegatamante committed Dec 17, 2015
1 parent b17a4b5 commit 329a2cb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion source/luaSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 329a2cb

Please sign in to comment.