diff data/fileio/AudioFileReaderFactory.cpp @ 1101:cd156ede1395 simple-fft-model

Use in-memory cache for WAV files as well, if appropriate
author Chris Cannam
date Mon, 15 Jun 2015 19:01:44 +0100
parents 329ddaf7415d
children 6877f4200912
line wrap: on
line diff
--- a/data/fileio/AudioFileReaderFactory.cpp	Mon Jun 15 16:02:58 2015 +0100
+++ b/data/fileio/AudioFileReaderFactory.cpp	Mon Jun 15 19:01:44 2015 +0100
@@ -136,9 +136,10 @@
         if (reader->isOK() &&
             (!reader->isQuicklySeekable() ||
              normalised ||
+             (cacheMode == CodedAudioFileReader::CacheInMemory) ||
              (targetRate != 0 && fileRate != targetRate))) {
 
-            SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", creating decoding reader" << endl;
+            SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", in memory " << (cacheMode == CodedAudioFileReader::CacheInMemory) << ", creating decoding reader" << endl;
 
             delete reader;
             reader = new DecodingWavFileReader
@@ -204,9 +205,10 @@
     if (reader->isOK() &&
         (!reader->isQuicklySeekable() ||
          normalised ||
+         (cacheMode == CodedAudioFileReader::CacheInMemory) ||
          (targetRate != 0 && fileRate != targetRate))) {
 
-        SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", creating decoding reader" << endl;
+        SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", in memory " << (cacheMode == CodedAudioFileReader::CacheInMemory) << ", creating decoding reader" << endl;
 
         delete reader;
         reader = new DecodingWavFileReader