Skip to content

Commit

Permalink
Merge pull request #20 from threebrooks/20191023_multichannel_issue
Browse files Browse the repository at this point in the history
There was a bug in the new multi-channel FileFeeder
  • Loading branch information
threebrooks authored Oct 23, 2019
2 parents 64674df + 476c62b commit 8226d0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/TimeStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ unordered_map<std::string, DecoderMessage_ptr> TimeStreams::getNewCoherent(int64
}
ss << std::endl;
}
GODEC_INFO << ss;
GODEC_INFO << ss.str();
}
#endif
// Can we slice all messages at this time?
Expand Down
6 changes: 4 additions & 2 deletions src/core_components/AudioPreProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void AudioPreProcessorComponent::ProcessMessage(const DecoderMessageBlock& msgBl
sampleRate = audioMsg->mSampleRate;
audioVecs.push_back(audioMsg->mAudio);
vtlStretch = audioMsg->getDescriptor("vtl_stretch") == "" ? vtlStretch : boost::lexical_cast<float>(audioMsg->getDescriptor("vtl_stretch"));
// message is in BinaryDecoderMessage format, need to decode first
// message is in BinaryDecoderMessage format, need to decode first
} else if (audioBaseMsg->getUUID() == UUID_BinaryDecoderMessage) {
auto binaryMsg =msgBlock.get<BinaryDecoderMessage>(SlotStreamedAudio);
auto& binaryData = binaryMsg->mData;
Expand Down Expand Up @@ -206,6 +206,9 @@ void AudioPreProcessorComponent::ProcessMessage(const DecoderMessageBlock& msgBl
}
}

// Maybe at some point this will be supported? It's not clear though what the timestamps would be if you suddenly have a new output stream that didn't exist before
if (numChannels != zeroMean.size()) GODEC_ERR << getLPId() << ": Number of incoming channels changed mid-stream (from " << zeroMean.size() << " to " << numChannels << "). This is currently not supported";

// Resample
std::vector<Vector> resampledAudio(numChannels);
for (int channelIdx = 0; channelIdx < numChannels; channelIdx++) {
Expand All @@ -226,7 +229,6 @@ void AudioPreProcessorComponent::ProcessMessage(const DecoderMessageBlock& msgBl
}
}


mUttReceivedResampledAudio += resampledAudio[0].size();

for (int channelIdx = 0; channelIdx < numChannels; channelIdx++) {
Expand Down
2 changes: 2 additions & 0 deletions src/core_components/FileFeeder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,12 @@ void parseAnalistLine(std::string& analistFileLine, std::string& waveFile, std::
if (lineEl.compare("") == 0 || lineEl.empty()) continue;
else if (lineEl == "-c") {
std::string channelString;
channels.resize(0);
iss >> channelString;
std::vector<std::string> channelEls;
boost::split(channelEls, channelString, boost::is_any_of(","));
for(int idx = 0; idx < channelEls.size(); idx++) {
if (channelEls[idx] == "") continue;
channels.push_back(boost::lexical_cast<int>(channelEls[idx]));
}
} else if (lineEl == "-t") {
Expand Down

0 comments on commit 8226d0a

Please sign in to comment.