Added detector for invalid sample values in plugin output
This commit is contained in:
parent
8c9749a90c
commit
d900572506
@ -116,6 +116,8 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id)
|
||||
String infotext = String(processor.getPreBufferingPercent(), 1) + "% buffered "
|
||||
+ String(processor.getStretchSource()->m_param_change_count)+" param changes "+m_last_err+" FFT size "+
|
||||
String(processor.getStretchSource()->getFFTSize());
|
||||
if (processor.m_abnormal_output_samples > 0)
|
||||
infotext += " " + String(processor.m_abnormal_output_samples) + " invalid sample values";
|
||||
m_info_label.setText(infotext, dontSendNotification);
|
||||
}
|
||||
if (id == 2)
|
||||
|
@ -416,6 +416,15 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M
|
||||
|
||||
AudioSourceChannelInfo aif(buffer);
|
||||
m_buffering_source->getNextAudioBlock(aif);
|
||||
for (int i = 0; i < buffer.getNumChannels(); ++i)
|
||||
{
|
||||
for (int j = 0; j < buffer.getNumSamples(); ++j)
|
||||
{
|
||||
float sample = buffer.getSample(i,j);
|
||||
if (std::isnan(sample) || std::isinf(sample))
|
||||
++m_abnormal_output_samples;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
@ -110,6 +110,7 @@ public:
|
||||
double getPreBufferingPercent();
|
||||
void timerCallback(int id) override;
|
||||
double getSampleRateChecked();
|
||||
int m_abnormal_output_samples = 0;
|
||||
private:
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user