Skip to content

Commit

Permalink
Fix issue in PitchYINFFT when no peaks were found by PeakDetection.
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviliz committed Sep 19, 2023
1 parent 043df33 commit ee31729
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/algorithms/tonal/pitchyinfft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ void PitchYinFFT::compute() {
yinMin = -_amplitudes[0];
}
else {
// TODO this should never happen, but some people reported it happening in their real time applications.
throw EssentiaException("PitchYinFFT: it appears that no peaks were found by PeakDetection. If you read this message, PLEASE, report this issue to the developers with an example of audio on which it happened.");
tau = 0.0; // it will provide zero-pitch and zero-pitch confidence.
// launch warning message for user feedbacking
E_WARNING("PitchYinFFT: it appears that no peaks were found by PeakDetection algorithm. So, pitch and confidence will be set to zero.");
}
}
else {
Expand Down

0 comments on commit ee31729

Please sign in to comment.