Anton Baskanov : dsound: Enable Doppler shift.
Module: wine Branch: master Commit: 24fa177c004bc55e3c72767448f8588de00bb94f URL: https://gitlab.winehq.org/wine/wine/-/commit/24fa177c004bc55e3c72767448f8588... Author: Anton Baskanov <baskanov(a)gmail.com> Date: Sun Apr 23 21:49:55 2023 +0700 dsound: Enable Doppler shift. --- dlls/dsound/sound3d.c | 6 +----- dlls/dsound/tests/ds3d.c | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c index 4e98cdc0b8d..3dc563b3579 100644 --- a/dlls/dsound/sound3d.c +++ b/dlls/dsound/sound3d.c @@ -167,6 +167,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) int i, num_main_speakers; float a, ingain; /* doppler shift related stuff */ + D3DVALUE flFreq, flBufferVel, flListenerVel; TRACE("(%p)\n",dsb); @@ -290,10 +291,6 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) dsb->freq = dsb->ds3db_freq; - /* FIXME: Doppler Effect disabled since i have no idea which frequency to change and how to do it */ -if(0) -{ - D3DVALUE flFreq, flBufferVel, flListenerVel; /* doppler shift*/ if (!VectorMagnitude(&dsb->ds3db_ds3db.vVelocity) && !VectorMagnitude(&dsb->device->ds3dl.vVelocity)) { @@ -317,7 +314,6 @@ if(0) flBufferVel, flListenerVel, dsb->ds3db_freq, flFreq); dsb->freq = flFreq; } -} DSOUND_RecalcFormat(dsb); diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index 4b70e0cc0ee..e71041e3a00 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -1436,9 +1436,9 @@ static void test_doppler(GUID *guid, BOOL play) check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, 0, 22050, 22050); check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, -90, 1, -90, 22050, 22050); - /* Wine TODO: Doppler shift is missing. */ + /* Wine TODO: The frequency is slightly off. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, -90, 22050, 29400); - /* Wine TODO: Doppler shift is missing. */ + /* Wine TODO: The frequency is slightly off. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, 90, 22050, 17640); IDirectSound3DListener_Release(listener);
participants (1)
-
Alexandre Julliard