mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-21 21:05:50 +12:00
Add volume curve setting (#658)
* Add volume curve setting * Qt: Add missing translations
This commit is contained in:
parent
545ac81d81
commit
5f822b32d5
7 changed files with 60 additions and 5 deletions
|
@ -134,6 +134,12 @@ void MiniAudioDevice::init(Samples& samples, bool safe) {
|
|||
} else {
|
||||
// If our volume is in [0.0, 1.0) then just multiply by the volume. No need to clamp, since there is no danger of our samples wrapping
|
||||
// around due to overflow
|
||||
|
||||
// If we're applying cubic volume curve, raise volume to the power of 3
|
||||
if (self->audioSettings.volumeCurve == AudioDeviceConfig::VolumeCurve::Cubic) {
|
||||
audioVolume = audioVolume * audioVolume * audioVolume;
|
||||
}
|
||||
|
||||
for (usize i = 0; i < samplesWritten; i += 2) {
|
||||
s16 l = s16(float(sample[0]) * audioVolume);
|
||||
s16 r = s16(float(sample[1]) * audioVolume);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue