mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-07 09:54:55 +00:00
OK, hopefully really fixed the volume -> attenuation conversion. Used VLC
as a reference implementation.
This commit is contained in:
parent
cd15ece9f0
commit
928a74e4d5
@ -130,7 +130,11 @@ void DirectSoundOut::SetVolume(double volume) {
|
||||
if (this->secondaryBuffer) {
|
||||
double db = (volume < 0.0001f)
|
||||
? DSBVOLUME_MIN
|
||||
: log(this->volume) * 434.294482f;
|
||||
: log10f(this->volume) * 6000.f;
|
||||
|
||||
if (db > DSBVOLUME_MAX) {
|
||||
db = DSBVOLUME_MAX;
|
||||
}
|
||||
|
||||
this->secondaryBuffer->SetVolume((LONG) db);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user