13
0

triggerbox: if bpm detection fails, don't try to stretch

This commit is contained in:
Paul Davis 2021-10-11 17:56:31 -06:00
parent 9e763c2672
commit 43993da7b4

View File

@ -739,6 +739,10 @@ AudioTrigger::compute_and_set_length ()
mbpm.setBPMRange (metric.tempo().quarter_notes_per_minute () * 0.75, metric.tempo().quarter_notes_per_minute() * 1.5);
double bpm = mbpm.estimateTempoOfSamples (data[0], data_length);
if (bpm == 0.0) {
/* no apparent tempo, just return since we'll use it as-is */
return;
}
cerr << name() << " Estimated bpm " << bpm << " from " << (double) data_length / _box.session().sample_rate() << " seconds\n";
const double seconds = (double) data_length / _box.session().sample_rate();