summaryrefslogtreecommitdiff
path: root/libs/audiographer
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-12 12:42:51 +0100
committerRobin Gareus <robin@gareus.org>2016-02-12 12:42:51 +0100
commit50145a93e697ab73a54187fff9d7ff8f8064bd6c (patch)
treeec37bd7a53016688cc7c3cb6ff4cedd64dc9244c /libs/audiographer
parenta60312cfeaa3b46fd5b8d8bafde7b7f7cb788cc0 (diff)
export analysis: include true-peak positions.
Diffstat (limited to 'libs/audiographer')
-rw-r--r--libs/audiographer/src/general/analyser.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/audiographer/src/general/analyser.cc b/libs/audiographer/src/general/analyser.cc
index 23c85e8a7c..d969095b08 100644
--- a/libs/audiographer/src/general/analyser.cc
+++ b/libs/audiographer/src/general/analyser.cc
@@ -248,13 +248,21 @@ Analyser::result ()
}
}
+ const unsigned cmask = _result.n_channels - 1; // [0, 1]
for (unsigned int c = 0; c < _channels; ++c) {
if (!_dbtp_plugin[c]) { continue; }
Vamp::Plugin::FeatureSet features = _dbtp_plugin[c]->getRemainingFeatures ();
- if (!features.empty () && features.size () == 1) {
+ if (!features.empty () && features.size () == 2) {
_result.have_dbtp = true;
float p = features[0][0].values[0];
if (p > _result.truepeak) { _result.truepeak = p; }
+
+ for (std::vector<float>::const_iterator i = features[1][0].values.begin();
+ i != features[1][0].values.end(); ++i) {
+ const framecnt_t pk = (*i) / _spp;
+ const unsigned int cc = c & cmask;
+ _result.truepeakpos[cc].insert (pk);
+ }
}
}