Mercurial > hg > svcore
comparison data/fileio/CodedAudioFileReader.cpp @ 1329:5b04b8bc88ca 3.0-integration
Update to current bqresample API
author | Chris Cannam |
---|---|
date | Thu, 15 Dec 2016 08:58:43 +0000 |
parents | 54af1e21705c |
children | 97deefd38060 |
comparison
equal
deleted
inserted
replaced
1327:7d24f92158a7 | 1329:5b04b8bc88ca |
---|---|
142 m_sampleRate = m_fileRate; | 142 m_sampleRate = m_fileRate; |
143 SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: rate (from file) = " << m_fileRate << endl; | 143 SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: rate (from file) = " << m_fileRate << endl; |
144 } | 144 } |
145 if (m_fileRate != m_sampleRate) { | 145 if (m_fileRate != m_sampleRate) { |
146 SVDEBUG << "CodedAudioFileReader: resampling " << m_fileRate << " -> " << m_sampleRate << endl; | 146 SVDEBUG << "CodedAudioFileReader: resampling " << m_fileRate << " -> " << m_sampleRate << endl; |
147 m_resampler = new breakfastquay::Resampler | 147 |
148 (breakfastquay::Resampler::FastestTolerable, | 148 breakfastquay::Resampler::Parameters params; |
149 m_channelCount, | 149 params.quality = breakfastquay::Resampler::FastestTolerable; |
150 int(m_cacheWriteBufferFrames)); | 150 params.maxBufferSize = int(m_cacheWriteBufferFrames); |
151 params.initialSampleRate = m_fileRate; | |
152 m_resampler = new breakfastquay::Resampler(params, m_channelCount); | |
153 | |
151 double ratio = m_sampleRate / m_fileRate; | 154 double ratio = m_sampleRate / m_fileRate; |
152 m_resampleBufferFrames = int(ceil(double(m_cacheWriteBufferFrames) * | 155 m_resampleBufferFrames = int(ceil(double(m_cacheWriteBufferFrames) * |
153 ratio + 1)); | 156 ratio + 1)); |
154 m_resampleBuffer = new float[m_resampleBufferFrames * m_channelCount]; | 157 m_resampleBuffer = new float[m_resampleBufferFrames * m_channelCount]; |
155 } | 158 } |