comparison data/fileio/CodedAudioFileReader.cpp @ 1318:f830a10bfbd6 3.0-integration

Start pruning other resampler logic than bqresample
author Chris Cannam
date Mon, 05 Dec 2016 16:54:19 +0000
parents c84629395040
children 983667969a82
comparison
equal deleted inserted replaced
1317:ea28ee929034 1318:f830a10bfbd6
18 #include "WavFileReader.h" 18 #include "WavFileReader.h"
19 #include "base/TempDirectory.h" 19 #include "base/TempDirectory.h"
20 #include "base/Exceptions.h" 20 #include "base/Exceptions.h"
21 #include "base/Profiler.h" 21 #include "base/Profiler.h"
22 #include "base/Serialiser.h" 22 #include "base/Serialiser.h"
23 #include "base/Resampler.h"
24 #include "base/StorageAdviser.h" 23 #include "base/StorageAdviser.h"
24
25 #include <bqresample/Resampler.h>
25 26
26 #include <stdint.h> 27 #include <stdint.h>
27 #include <iostream> 28 #include <iostream>
28 #include <QDir> 29 #include <QDir>
29 #include <QMutexLocker> 30 #include <QMutexLocker>
140 m_sampleRate = m_fileRate; 141 m_sampleRate = m_fileRate;
141 SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: rate (from file) = " << m_fileRate << endl; 142 SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: rate (from file) = " << m_fileRate << endl;
142 } 143 }
143 if (m_fileRate != m_sampleRate) { 144 if (m_fileRate != m_sampleRate) {
144 SVDEBUG << "CodedAudioFileReader: resampling " << m_fileRate << " -> " << m_sampleRate << endl; 145 SVDEBUG << "CodedAudioFileReader: resampling " << m_fileRate << " -> " << m_sampleRate << endl;
145 m_resampler = new Resampler(Resampler::FastestTolerable, 146 m_resampler = new breakfastquay::Resampler
146 m_channelCount, 147 (breakfastquay::Resampler::FastestTolerable,
147 m_cacheWriteBufferSize); 148 m_channelCount,
149 m_cacheWriteBufferSize);
148 double ratio = m_sampleRate / m_fileRate; 150 double ratio = m_sampleRate / m_fileRate;
149 m_resampleBuffer = new float 151 m_resampleBuffer = new float
150 [lrint(ceil(double(m_cacheWriteBufferSize) * m_channelCount * ratio + 1))]; 152 [lrint(ceil(double(m_cacheWriteBufferSize) * m_channelCount * ratio + 1))];
151 } 153 }
152 154