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
c771fe92
Commit
c771fe92
authored
Feb 15, 2012
by
Jörg Höhle
Committed by
Alexandre Julliard
Feb 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi/tests: Produce audible 16bit output too.
parent
ee9689b4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
render.c
dlls/mmdevapi/tests/render.c
+7
-3
No files found.
dlls/mmdevapi/tests/render.c
View file @
c771fe92
...
...
@@ -75,8 +75,10 @@ static DWORD wave_generate_tone(PWAVEFORMATEX pwfx, BYTE* data, UINT32 frames)
DWORD
cn
,
i
;
double
delta
,
y
;
if
(
!
winetest_interactive
||
wfxe
->
Format
.
wFormatTag
!=
WAVE_FORMAT_EXTENSIBLE
||
!
IsEqualGUID
(
&
wfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
))
if
(
!
winetest_interactive
)
return
AUDCLNT_BUFFERFLAGS_SILENT
;
if
(
wfxe
->
Format
.
wBitsPerSample
!=
((
wfxe
->
Format
.
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
&&
IsEqualGUID
(
&
wfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
))
?
8
*
sizeof
(
float
)
:
16
))
return
AUDCLNT_BUFFERFLAGS_SILENT
;
for
(
delta
=
phase
,
cn
=
0
;
cn
<
wfxe
->
Format
.
nChannels
;
...
...
@@ -84,8 +86,10 @@ static DWORD wave_generate_tone(PWAVEFORMATEX pwfx, BYTE* data, UINT32 frames)
for
(
i
=
0
;
i
<
frames
;
i
++
){
y
=
sin
(
2
*
PI
*
(
440
.
*
i
/
wfxe
->
Format
.
nSamplesPerSec
+
delta
));
/* assume alignment is granted */
if
(
wfxe
->
Format
.
wBitsPerSample
==
16
)
((
short
*
)
data
)[
cn
+
i
*
wfxe
->
Format
.
nChannels
]
=
y
*
32767
.
9
;
else
((
float
*
)
data
)[
cn
+
i
*
wfxe
->
Format
.
nChannels
]
=
y
;
/* fixme: 16bit for exclusive mode */
}
}
phase
+=
440
.
*
frames
/
wfxe
->
Format
.
nSamplesPerSec
;
...
...
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