comparison 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
comparison
equal deleted inserted replaced
1100:5cbf71022679 1101:cd156ede1395
134 sv_samplerate_t fileRate = reader->getSampleRate(); 134 sv_samplerate_t fileRate = reader->getSampleRate();
135 135
136 if (reader->isOK() && 136 if (reader->isOK() &&
137 (!reader->isQuicklySeekable() || 137 (!reader->isQuicklySeekable() ||
138 normalised || 138 normalised ||
139 (cacheMode == CodedAudioFileReader::CacheInMemory) ||
139 (targetRate != 0 && fileRate != targetRate))) { 140 (targetRate != 0 && fileRate != targetRate))) {
140 141
141 SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", creating decoding reader" << endl; 142 SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", in memory " << (cacheMode == CodedAudioFileReader::CacheInMemory) << ", creating decoding reader" << endl;
142 143
143 delete reader; 144 delete reader;
144 reader = new DecodingWavFileReader 145 reader = new DecodingWavFileReader
145 (source, 146 (source,
146 decodeMode, cacheMode, 147 decodeMode, cacheMode,
202 sv_samplerate_t fileRate = reader->getSampleRate(); 203 sv_samplerate_t fileRate = reader->getSampleRate();
203 204
204 if (reader->isOK() && 205 if (reader->isOK() &&
205 (!reader->isQuicklySeekable() || 206 (!reader->isQuicklySeekable() ||
206 normalised || 207 normalised ||
208 (cacheMode == CodedAudioFileReader::CacheInMemory) ||
207 (targetRate != 0 && fileRate != targetRate))) { 209 (targetRate != 0 && fileRate != targetRate))) {
208 210
209 SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", creating decoding reader" << endl; 211 SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", in memory " << (cacheMode == CodedAudioFileReader::CacheInMemory) << ", creating decoding reader" << endl;
210 212
211 delete reader; 213 delete reader;
212 reader = new DecodingWavFileReader 214 reader = new DecodingWavFileReader
213 (source, 215 (source,
214 decodeMode, cacheMode, 216 decodeMode, cacheMode,