mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
[AFV] Change output format and processing to 32 bit float
32 bit float is what is used in C# reference and has a much higher dynamic range. 16 bit integer was clipping very often with all the VHF simulation applied.
This commit is contained in:
committed by
Mat Sutcliffe
parent
fbb126370c
commit
240df93406
@@ -13,25 +13,19 @@ namespace BlackSound
|
||||
setupPreset(preset);
|
||||
}
|
||||
|
||||
int CEqualizerSampleProvider::readSamples(QVector<qint16> &samples, qint64 count)
|
||||
int CEqualizerSampleProvider::readSamples(QVector<float> &samples, qint64 count)
|
||||
{
|
||||
int samplesRead = m_sourceProvider->readSamples(samples, count);
|
||||
if (m_bypass) return samplesRead;
|
||||
|
||||
QVector<double> doubleSamples = convertFromShortToDouble(samples);
|
||||
|
||||
for (int n = 0; n < samplesRead; n++)
|
||||
{
|
||||
// TODO stereo implementation
|
||||
|
||||
for (int band = 0; band < m_filters.size(); band++)
|
||||
{
|
||||
doubleSamples[n] = m_filters[band].transform(doubleSamples[n]);
|
||||
samples[n] = m_filters[band].transform(samples[n]);
|
||||
}
|
||||
doubleSamples[n] *= m_outputGain;
|
||||
samples[n] *= m_outputGain;
|
||||
}
|
||||
|
||||
samples = convertFromDoubleToShort(doubleSamples);
|
||||
return samplesRead;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user