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
1e82007c
Commit
1e82007c
authored
Aug 30, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Aug 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test 32 bit float samples.
parent
79b1c4db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
3 deletions
+67
-3
capture.c
dlls/winmm/tests/capture.c
+27
-2
wave.c
dlls/winmm/tests/wave.c
+40
-1
No files found.
dlls/winmm/tests/capture.c
View file @
1e82007c
...
...
@@ -33,6 +33,7 @@
#include "mmreg.h"
extern
GUID
KSDATAFORMAT_SUBTYPE_PCM
;
extern
GUID
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
;
#include "winmm_test.h"
...
...
@@ -505,7 +506,7 @@ static void wave_in_test_device(int device)
waveInClose(win);
wave_in_test_deviceIn(device,&wfex.Format,0,0,&capsA);
} else
trace("waveInOpen(%s): 24 bit not supported\n",
trace("waveInOpen(%s): 24 bit
samples
not supported\n",
dev_name(device));
#endif
...
...
@@ -530,7 +531,31 @@ static void wave_in_test_device(int device)
waveInClose
(
win
);
wave_in_test_deviceIn
(
device
,
&
wfex
.
Format
,
0
,
0
,
&
capsA
);
}
else
trace
(
"waveInOpen(%s): 32 bit not supported
\n
"
,
trace
(
"waveInOpen(%s): 32 bit samples not supported
\n
"
,
dev_name
(
device
));
/* test if 32 bit float samples supported */
wfex
.
Format
.
wFormatTag
=
WAVE_FORMAT_EXTENSIBLE
;
wfex
.
Format
.
nChannels
=
2
;
wfex
.
Format
.
wBitsPerSample
=
32
;
wfex
.
Format
.
nSamplesPerSec
=
22050
;
wfex
.
Format
.
nBlockAlign
=
wfex
.
Format
.
nChannels
*
wfex
.
Format
.
wBitsPerSample
/
8
;
wfex
.
Format
.
nAvgBytesPerSec
=
wfex
.
Format
.
nSamplesPerSec
*
wfex
.
Format
.
nBlockAlign
;
wfex
.
Format
.
cbSize
=
22
;
wfex
.
Samples
.
wValidBitsPerSample
=
wfex
.
Format
.
wBitsPerSample
;
wfex
.
dwChannelMask
=
SPEAKER_ALL
;
wfex
.
SubFormat
=
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
;
rc
=
waveInOpen
(
&
win
,
device
,
&
wfex
.
Format
,
0
,
0
,
CALLBACK_NULL
|
WAVE_FORMAT_DIRECT
);
ok
(
rc
==
MMSYSERR_NOERROR
||
rc
==
WAVERR_BADFORMAT
||
rc
==
MMSYSERR_INVALFLAG
||
rc
==
MMSYSERR_INVALPARAM
,
"waveInOpen(%s): returned: %s
\n
"
,
dev_name
(
device
),
wave_in_error
(
rc
));
if
(
rc
==
MMSYSERR_NOERROR
)
{
waveInClose
(
win
);
wave_in_test_deviceIn
(
device
,
&
wfex
.
Format
,
0
,
0
,
&
capsA
);
}
else
trace
(
"waveInOpen(%s): 32 bit float samples not supported
\n
"
,
dev_name
(
device
));
}
...
...
dlls/winmm/tests/wave.c
View file @
1e82007c
...
...
@@ -54,6 +54,7 @@ static char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size)
int
nb_samples
;
char
*
buf
;
char
*
b
;
WAVEFORMATEXTENSIBLE
*
wfex
=
(
WAVEFORMATEXTENSIBLE
*
)
wfx
;
nb_samples
=
(
int
)(
duration
*
wfx
->
nSamplesPerSec
);
*
size
=
nb_samples
*
wfx
->
nBlockAlign
;
...
...
@@ -79,7 +80,9 @@ static char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size)
b
[
2
]
=
(
sample
>>
16
)
&
0xff
;
b
+=
3
;
}
}
else
if
(
wfx
->
wBitsPerSample
==
32
)
{
}
else
if
((
wfx
->
wBitsPerSample
==
32
)
&&
((
wfx
->
wFormatTag
==
WAVE_FORMAT_PCM
)
||
((
wfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
&&
IsEqualGUID
(
&
wfex
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
))))
{
signed
int
sample
=
(
signed
int
)(((
double
)
0x7fffffff
+
0
.
5
)
*
y
-
0
.
5
);
for
(
j
=
0
;
j
<
wfx
->
nChannels
;
j
++
)
{
b
[
0
]
=
sample
&
0xff
;
...
...
@@ -88,6 +91,17 @@ static char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size)
b
[
3
]
=
(
sample
>>
24
)
&
0xff
;
b
+=
4
;
}
}
else
if
((
wfx
->
wBitsPerSample
==
32
)
&&
(
wfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
&&
IsEqualGUID
(
&
wfex
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
))
{
union
{
float
f
;
char
c
[
4
];
}
sample
;
sample
.
f
=
y
;
for
(
j
=
0
;
j
<
wfx
->
nChannels
;
j
++
)
{
b
[
0
]
=
sample
.
c
[
0
];
b
[
1
]
=
sample
.
c
[
1
];
b
[
2
]
=
sample
.
c
[
2
];
b
[
3
]
=
sample
.
c
[
3
];
b
+=
4
;
}
}
}
return
buf
;
...
...
@@ -868,6 +882,31 @@ static void wave_out_test_device(int device)
}
else
trace
(
"waveOutOpen(%s): 32 bit samples not supported
\n
"
,
dev_name
(
device
));
/* test if 32 bit float samples supported */
wfex
.
Format
.
wFormatTag
=
WAVE_FORMAT_EXTENSIBLE
;
wfex
.
Format
.
nChannels
=
2
;
wfex
.
Format
.
wBitsPerSample
=
32
;
wfex
.
Format
.
nSamplesPerSec
=
22050
;
wfex
.
Format
.
nBlockAlign
=
wfex
.
Format
.
nChannels
*
wfex
.
Format
.
wBitsPerSample
/
8
;
wfex
.
Format
.
nAvgBytesPerSec
=
wfex
.
Format
.
nSamplesPerSec
*
wfex
.
Format
.
nBlockAlign
;
wfex
.
Format
.
cbSize
=
22
;
wfex
.
Samples
.
wValidBitsPerSample
=
wfex
.
Format
.
wBitsPerSample
;
wfex
.
dwChannelMask
=
SPEAKER_ALL
;
wfex
.
SubFormat
=
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
;
rc
=
waveOutOpen
(
&
wout
,
device
,
&
wfex
.
Format
,
0
,
0
,
CALLBACK_NULL
|
WAVE_FORMAT_DIRECT
);
ok
(
rc
==
MMSYSERR_NOERROR
||
rc
==
WAVERR_BADFORMAT
||
rc
==
MMSYSERR_INVALFLAG
||
rc
==
MMSYSERR_INVALPARAM
,
"waveOutOpen(%s): returned %s
\n
"
,
dev_name
(
device
),
wave_out_error
(
rc
));
if
(
rc
==
MMSYSERR_NOERROR
)
{
waveOutClose
(
wout
);
wave_out_test_deviceOut
(
device
,
1
.
0
,
&
wfex
.
Format
,
WAVE_FORMAT_2M16
,
0
,
&
capsA
);
}
else
trace
(
"waveOutOpen(%s): 32 bit float samples not supported
\n
"
,
dev_name
(
device
));
}
static
void
wave_out_tests
()
...
...
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