Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
69d088ca
Commit
69d088ca
authored
Apr 24, 2023
by
Anton Baskanov
Committed by
Alexandre Julliard
May 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Take distance and Doppler factor into account.
parent
23eca82a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
14 deletions
+3
-14
sound3d.c
dlls/dsound/sound3d.c
+3
-2
ds3d.c
dlls/dsound/tests/ds3d.c
+0
-12
No files found.
dlls/dsound/sound3d.c
View file @
69d088ca
...
...
@@ -168,7 +168,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
float
a
,
ingain
;
/* doppler shift related stuff */
D3DVECTOR
vRelativeVel
;
D3DVALUE
flFreq
,
flRelativeVel
,
flLimitedVel
;
D3DVALUE
flFreq
,
flRelativeVel
,
flLimitedVel
,
flVelocityFactor
;
TRACE
(
"(%p)
\n
"
,
dsb
);
...
...
@@ -308,7 +308,8 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
NOTE: if buffer moves TOWARDS the listener, its velocity component is NEGATIVE
if buffer moves AWAY from listener, its velocity component is POSITIVE */
flRelativeVel
=
ProjectVector
(
&
vRelativeVel
,
&
vDistance
);
flLimitedVel
=
max
(
-
DEFAULT_VELOCITY
/
2
,
min
(
DEFAULT_VELOCITY
/
2
,
flRelativeVel
));
flVelocityFactor
=
dsb
->
device
->
ds3dl
.
flDistanceFactor
*
dsb
->
device
->
ds3dl
.
flDopplerFactor
;
flLimitedVel
=
max
(
-
DEFAULT_VELOCITY
/
2
,
min
(
DEFAULT_VELOCITY
/
2
,
flRelativeVel
*
flVelocityFactor
));
/* formula taken from Gianicoli D.: Physics, 4th edition: */
flFreq
=
dsb
->
ds3db_freq
*
(
DEFAULT_VELOCITY
/
(
DEFAULT_VELOCITY
+
flLimitedVel
));
TRACE
(
"doppler: Relative velocity (component) = %f => Doppler shift: %ld Hz -> %f Hz
\n
"
,
...
...
dlls/dsound/tests/ds3d.c
View file @
69d088ca
...
...
@@ -1459,17 +1459,11 @@ static void test_doppler(GUID *guid, BOOL play)
hr
=
IDirectSound3DListener_SetDistanceFactor
(
listener
,
10
,
DS3D_DEFERRED
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
/* Wine TODO: The distance factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
0
,
0
.
1
f
,
-
9
,
22050
,
29400
);
/* Wine TODO: The distance factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
0
,
0
.
1
f
,
9
,
22050
,
17640
);
/* Wine TODO: The distance factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
9
,
0
.
1
f
,
0
,
22050
,
29400
);
/* Wine TODO: The distance factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
-
9
,
0
.
1
f
,
0
,
22050
,
17640
);
/* Wine TODO: The distance factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
0
,
0
.
1
f
,
-
24
,
22050
,
44100
);
/* Wine TODO: The distance factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
0
,
0
.
1
f
,
24
,
22050
,
14700
);
hr
=
IDirectSound3DListener_SetDistanceFactor
(
listener
,
DS3D_DEFAULTDISTANCEFACTOR
,
DS3D_DEFERRED
);
...
...
@@ -1478,17 +1472,11 @@ static void test_doppler(GUID *guid, BOOL play)
hr
=
IDirectSound3DListener_SetDopplerFactor
(
listener
,
2
,
DS3D_DEFERRED
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
/* Wine TODO: The Doppler factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
0
,
1
,
-
45
,
22050
,
29400
);
/* Wine TODO: The Doppler factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
0
,
1
,
45
,
22050
,
17640
);
/* Wine TODO: The Doppler factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
45
,
1
,
0
,
22050
,
29400
);
/* Wine TODO: The Doppler factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
-
45
,
1
,
0
,
22050
,
17640
);
/* Wine TODO: The Doppler factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
0
,
1
,
-
120
,
22050
,
44100
);
/* Wine TODO: The Doppler factor has no effect. */
check_doppler
(
dsound
,
listener
,
play
,
DS3DMODE_NORMAL
,
0
,
0
,
1
,
120
,
22050
,
14700
);
hr
=
IDirectSound3DListener_SetDopplerFactor
(
listener
,
DS3D_DEFAULTDOPPLERFACTOR
,
DS3D_DEFERRED
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment