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
014ab5e2
Commit
014ab5e2
authored
Nov 16, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Nov 16, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only convert bits per sample between different encoding formats.
parent
aa730cc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
45 deletions
+57
-45
wavemap.c
dlls/winmm/wavemap/wavemap.c
+57
-45
No files found.
dlls/winmm/wavemap/wavemap.c
View file @
014ab5e2
...
...
@@ -194,7 +194,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
}
}
if
((
dwFlags
&
WAVE_FORMAT_DIRECT
)
==
0
&&
lpDesc
->
lpFormat
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
if
((
dwFlags
&
WAVE_FORMAT_DIRECT
)
==
0
)
{
WAVEFORMATEX
wfx
;
wfx
.
wFormatTag
=
WAVE_FORMAT_PCM
;
...
...
@@ -208,51 +208,63 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
default: goto error; \
}
/* Our resampling algorithm is quite primitive so first try
* to just change the bit depth and number of channels
*/
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
wfx
.
nSamplesPerSec
=
lpDesc
->
lpFormat
->
nSamplesPerSec
;
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
wfx
.
nSamplesPerSec
,
16
);
TRY
(
wfx
.
nSamplesPerSec
,
8
);
wfx
.
nChannels
^=
3
;
TRY
(
wfx
.
nSamplesPerSec
,
16
);
TRY
(
wfx
.
nSamplesPerSec
,
8
);
}
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* first try with same stereo/mono option as source */
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
96000
,
16
);
TRY
(
48000
,
16
);
TRY
(
44100
,
16
);
TRY
(
22050
,
16
);
TRY
(
11025
,
16
);
/* 2^3 => 1, 1^3 => 2, so if stereo, try mono (and the other way around) */
wfx
.
nChannels
^=
3
;
TRY
(
96000
,
16
);
TRY
(
48000
,
16
);
TRY
(
44100
,
16
);
TRY
(
22050
,
16
);
TRY
(
11025
,
16
);
/* first try with same stereo/mono option as source */
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
96000
,
8
);
TRY
(
48000
,
8
);
TRY
(
44100
,
8
);
TRY
(
22050
,
8
);
TRY
(
11025
,
8
);
if
(
lpDesc
->
lpFormat
->
wFormatTag
!=
WAVE_FORMAT_PCM
)
{
/* Format changed so keep sample rate and number of channels
* the same and just change the bit depth
*/
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
wfx
.
nSamplesPerSec
=
lpDesc
->
lpFormat
->
nSamplesPerSec
;
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
wfx
.
nSamplesPerSec
,
16
);
TRY
(
wfx
.
nSamplesPerSec
,
8
);
}
}
else
{
/* Our resampling algorithm is quite primitive so first try
* to just change the bit depth and number of channels
*/
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
wfx
.
nSamplesPerSec
=
lpDesc
->
lpFormat
->
nSamplesPerSec
;
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
wfx
.
nSamplesPerSec
,
16
);
TRY
(
wfx
.
nSamplesPerSec
,
8
);
wfx
.
nChannels
^=
3
;
TRY
(
wfx
.
nSamplesPerSec
,
16
);
TRY
(
wfx
.
nSamplesPerSec
,
8
);
}
/* 2^3 => 1, 1^3 => 2, so if stereo, try mono (and the other way around) */
wfx
.
nChannels
^=
3
;
TRY
(
96000
,
8
);
TRY
(
48000
,
8
);
TRY
(
44100
,
8
);
TRY
(
22050
,
8
);
TRY
(
11025
,
8
);
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* first try with same stereo/mono option as source */
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
96000
,
16
);
TRY
(
48000
,
16
);
TRY
(
44100
,
16
);
TRY
(
22050
,
16
);
TRY
(
11025
,
16
);
/* 2^3 => 1, 1^3 => 2, so if stereo, try mono (and the other way around) */
wfx
.
nChannels
^=
3
;
TRY
(
96000
,
16
);
TRY
(
48000
,
16
);
TRY
(
44100
,
16
);
TRY
(
22050
,
16
);
TRY
(
11025
,
16
);
/* first try with same stereo/mono option as source */
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
96000
,
8
);
TRY
(
48000
,
8
);
TRY
(
44100
,
8
);
TRY
(
22050
,
8
);
TRY
(
11025
,
8
);
/* 2^3 => 1, 1^3 => 2, so if stereo, try mono (and the other way around) */
wfx
.
nChannels
^=
3
;
TRY
(
96000
,
8
);
TRY
(
48000
,
8
);
TRY
(
44100
,
8
);
TRY
(
22050
,
8
);
TRY
(
11025
,
8
);
}
}
#undef TRY
}
...
...
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