[DSD] Reduce volume level of decimator output
As the decimator has shown to be twice as loud as it should be, the volume should be reduced by half when converting DSD to PCM with it. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
4537a72275
commit
fe82b5ed65
|
@ -783,6 +783,10 @@ tryagain:
|
|||
}
|
||||
|
||||
if(inpOffset != inpSize && floatOffset == floatSize) {
|
||||
#if DSD_DECIMATE
|
||||
const float scaleModifier = (inputFormat.mBitsPerChannel == 1) ? 0.5f : 1.0f;
|
||||
#endif
|
||||
|
||||
size_t inputSamples = (inpSize - inpOffset) / floatFormat.mBytesPerPacket;
|
||||
|
||||
ioNumberPackets = (UInt32)inputSamples;
|
||||
|
@ -864,7 +868,11 @@ tryagain:
|
|||
|
||||
amountReadFromFC = (int)(outputDone * floatFormat.mBytesPerPacket);
|
||||
|
||||
scale_by_volume((float *)floatBuffer, amountReadFromFC / sizeof(float), volumeScale);
|
||||
scale_by_volume((float *)floatBuffer, amountReadFromFC / sizeof(float), volumeScale
|
||||
#if DSD_DECIMATE
|
||||
* scaleModifier
|
||||
#endif
|
||||
);
|
||||
|
||||
floatSize = amountReadFromFC;
|
||||
floatOffset = 0;
|
||||
|
|
Loading…
Reference in New Issue