Mercurial > hg > sonic-annotator
comparison runner/FeatureExtractionManager.cpp @ 113:297f9e415e39 multiplex
Fix channel counting
author | Chris Cannam |
---|---|
date | Thu, 02 Oct 2014 16:46:39 +0100 |
parents | 0c2d8c945bbf |
children | 1c0799754670 |
comparison
equal
deleted
inserted
replaced
112:0c2d8c945bbf | 113:297f9e415e39 |
---|---|
466 | 466 |
467 retrievalProgress.done(); | 467 retrievalProgress.done(); |
468 | 468 |
469 cerr << "File or URL \"" << audioSource.toStdString() << "\" opened successfully" << endl; | 469 cerr << "File or URL \"" << audioSource.toStdString() << "\" opened successfully" << endl; |
470 | 470 |
471 if (willMultiplex) { | 471 if (!willMultiplex) { |
472 ++m_channels; // channel count is simply number of sources | |
473 } else { | |
474 if (m_channels == 0) { | 472 if (m_channels == 0) { |
475 m_channels = reader->getChannelCount(); | 473 m_channels = reader->getChannelCount(); |
476 cerr << "Taking default channel count of " | 474 cerr << "Taking default channel count of " |
477 << reader->getChannelCount() << " from file" << endl; | 475 << reader->getChannelCount() << " from file" << endl; |
478 } | 476 } |
484 << reader->getNativeRate() << "Hz from file" << endl; | 482 << reader->getNativeRate() << "Hz from file" << endl; |
485 cerr << "(Note: Default may be overridden by transforms)" << endl; | 483 cerr << "(Note: Default may be overridden by transforms)" << endl; |
486 } | 484 } |
487 | 485 |
488 m_readyReaders[audioSource] = reader; | 486 m_readyReaders[audioSource] = reader; |
487 } | |
488 | |
489 if (willMultiplex) { | |
490 ++m_channels; // channel count is simply number of sources | |
491 cerr << "Multiplexing, incremented target channel count to " | |
492 << m_channels << endl; | |
489 } | 493 } |
490 } | 494 } |
491 | 495 |
492 void FeatureExtractionManager::extractFeatures(QString audioSource) | 496 void FeatureExtractionManager::extractFeatures(QString audioSource) |
493 { | 497 { |
571 cerr << "Audio file \"" << audioSource.toStdString() << "\": " | 575 cerr << "Audio file \"" << audioSource.toStdString() << "\": " |
572 << reader->getChannelCount() << "ch at " | 576 << reader->getChannelCount() << "ch at " |
573 << reader->getNativeRate() << "Hz" << endl; | 577 << reader->getNativeRate() << "Hz" << endl; |
574 if (reader->getChannelCount() != m_channels || | 578 if (reader->getChannelCount() != m_channels || |
575 reader->getNativeRate() != m_sampleRate) { | 579 reader->getNativeRate() != m_sampleRate) { |
576 cerr << "NOTE: File will be mixed or resampled for processing: " | 580 cerr << "NOTE: File will be mixed or resampled for processing, to: " |
577 << m_channels << "ch at " | 581 << m_channels << "ch at " |
578 << m_sampleRate << "Hz" << endl; | 582 << m_sampleRate << "Hz" << endl; |
579 } | 583 } |
580 | 584 |
581 // allocate audio buffers | 585 // allocate audio buffers |