Mercurial > hg > sonic-annotator
changeset 219:d0fe861bb116
Fix grisly error in multiplexed audio reader (calling itself!)
author | Chris Cannam |
---|---|
date | Fri, 20 Nov 2015 09:32:11 +0000 |
parents | dc82579c9a26 |
children | 20bf837f53ab |
files | runner/FeatureExtractionManager.cpp runner/MultiplexedReader.cpp |
diffstat | 2 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/runner/FeatureExtractionManager.cpp Fri Nov 20 09:31:55 2015 +0000 +++ b/runner/FeatureExtractionManager.cpp Fri Nov 20 09:32:11 2015 +0000 @@ -616,6 +616,12 @@ if (!reader) { throw FailedToOpenFile(source); } + if (reader->getChannelCount() != m_channels || + reader->getNativeRate() != m_sampleRate) { + cerr << "NOTE: File will be mixed or resampled for processing, to: " + << m_channels << "ch at " + << m_sampleRate << "Hz" << endl; + } return reader; } @@ -628,12 +634,6 @@ cerr << "Audio file \"" << audioSource.toStdString() << "\": " << reader->getChannelCount() << "ch at " << reader->getNativeRate() << "Hz" << endl; - if (reader->getChannelCount() != m_channels || - reader->getNativeRate() != m_sampleRate) { - cerr << "NOTE: File will be mixed or resampled for processing, to: " - << m_channels << "ch at " - << m_sampleRate << "Hz" << endl; - } // allocate audio buffers float **data = new float *[m_channels];
--- a/runner/MultiplexedReader.cpp Fri Nov 20 09:31:55 2015 +0000 +++ b/runner/MultiplexedReader.cpp Fri Nov 20 09:32:11 2015 +0000 @@ -60,7 +60,7 @@ for (int out_chan = 0; out_chan < out_chans; ++out_chan) { AudioFileReader *reader = m_readers[out_chan]; - SampleBlock readerBlock = getInterleavedFrames(start, frameCount); + SampleBlock readerBlock = reader->getInterleavedFrames(start, frameCount); int in_chans = reader->getChannelCount();