changeset 113:297f9e415e39 multiplex

Fix channel counting
author Chris Cannam
date Thu, 02 Oct 2014 16:46:39 +0100
parents 0c2d8c945bbf
children 34a0dad473c3
files runner/FeatureExtractionManager.cpp
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/runner/FeatureExtractionManager.cpp	Thu Oct 02 15:23:25 2014 +0100
+++ b/runner/FeatureExtractionManager.cpp	Thu Oct 02 16:46:39 2014 +0100
@@ -468,9 +468,7 @@
 
         cerr << "File or URL \"" << audioSource.toStdString() << "\" opened successfully" << endl;
 
-        if (willMultiplex) {
-            ++m_channels; // channel count is simply number of sources
-        } else {
+        if (!willMultiplex) {
             if (m_channels == 0) {
                 m_channels = reader->getChannelCount();
                 cerr << "Taking default channel count of "
@@ -487,6 +485,12 @@
 
         m_readyReaders[audioSource] = reader;
     }
+
+    if (willMultiplex) {
+        ++m_channels; // channel count is simply number of sources
+        cerr << "Multiplexing, incremented target channel count to " 
+             << m_channels << endl;
+    }
 }
 
 void FeatureExtractionManager::extractFeatures(QString audioSource)
@@ -573,7 +577,7 @@
          << reader->getNativeRate() << "Hz" << endl;
     if (reader->getChannelCount() != m_channels ||
         reader->getNativeRate() != m_sampleRate) {
-        cerr << "NOTE: File will be mixed or resampled for processing: "
+        cerr << "NOTE: File will be mixed or resampled for processing, to: "
              << m_channels << "ch at " 
              << m_sampleRate << "Hz" << endl;
     }