Skip to content

Commit

Permalink
Take care EOF in AudioFileReader
Browse files Browse the repository at this point in the history
  • Loading branch information
pinxue committed Apr 27, 2014
1 parent 12d3f97 commit 0edfb28
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Novocaine/AudioFileReader.mm
Expand Up @@ -163,6 +163,12 @@ - (void)bufferNewAudio
ExtAudioFileTell(self.inputFile, &frameOffset);
self.currentFileTime = (float)frameOffset / self.samplingRate;

ExtAudioFileRead(self.inputFile, &framesRead, &incomingAudio);

if ( framesRead == 0 ) { // EOF.
[self pause];
}

// Add the new audio to the ring buffer
ringBuffer->AddNewInterleavedFloatData(self.outputBuffer, framesRead, self.numChannels);

Expand Down

0 comments on commit 0edfb28

Please sign in to comment.