NCOF: fix null sample rate condition

pull/1162/head
f4exb 2022-02-21 02:18:44 +01:00
rodzic 4c2ca8fa20
commit c678b40988
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -46,8 +46,8 @@ NCOF::NCOF()
void NCOF::setFreq(Real freq, Real sampleRate)
{
m_phaseIncrement = (freq * TableSize) / sampleRate;
qDebug("NCOF::setFreq: freq: %f m_phaseIncrement: %f", freq, m_phaseIncrement);
m_phaseIncrement = sampleRate == 0 ? 0 : (freq * TableSize) / sampleRate;
qDebug("NCOF::setFreq: freq: %f sr: %f m_phaseIncrement: %f", freq, sampleRate, m_phaseIncrement);
}
float NCOF::next()