Fixed off-by-one error in wave file reader
This commit is contained in:
parent
0e00e58d91
commit
97f172282d
|
@ -188,7 +188,7 @@ void WaveFileReader::seek(int64_t frameIndex) {
|
|||
}
|
||||
|
||||
float WaveFileReader::readSample() {
|
||||
if (frameIndex + channelCount > frameCount) throw std::out_of_range("End of stream.");
|
||||
if (frameIndex >= frameCount) throw std::out_of_range("End of stream.");
|
||||
++frameIndex;
|
||||
|
||||
float sum = 0;
|
||||
|
|
Loading…
Reference in New Issue