Skip to content

Commit 9a704fb

Browse files
authored
Merge pull request #336 from wagenadl/filereader-from-start
FileReader now starts from beginning of file
2 parents 98c58d4 + 4d973cd commit 9a704fb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Source/Processors/FileReader/FileReader.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ bool FileReader::enable()
168168
bufferA.malloc(currentNumChannels * m_bufferSize * BUFFER_WINDOW_CACHE_SIZE);
169169
bufferB.malloc(currentNumChannels * m_bufferSize * BUFFER_WINDOW_CACHE_SIZE);
170170

171-
readAndFillBufferCache(bufferA); // pre-fill the front buffer with a blocking read
171+
// reset stream to beginning
172+
input->seekTo (startSample);
173+
currentSample = startSample;
174+
readAndFillBufferCache(bufferA); // pre-fill the front buffer with a blocking read
172175

173176
// set the backbuffer so that on the next call to process() we start with bufferA and buffer
174177
// cache window id = 0

0 commit comments

Comments
 (0)