Add support for the 48 and 96kHz formats.

This commit is contained in:
Francois Gouget 2002-12-13 02:18:20 +00:00 committed by Alexandre Julliard
parent d1b77764ae
commit a522385e7d
2 changed files with 11 additions and 1 deletions

View File

@ -103,12 +103,14 @@ static struct {
{1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025},
{1, 8, 22050}, {2, 8, 22050}, {1, 16, 22050}, {2, 16, 22050},
{1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100},
{1, 8, 48000}, {2, 8, 48000}, {1, 16, 48000}, {2, 16, 48000},
{1, 8, 96000}, {2, 8, 96000}, {1, 16, 96000}, {2, 16, 96000}
};
/***********************************************************************
* PCM_GetFormatIndex
*/
static DWORD PCM_GetFormatIndex(LPWAVEFORMATEX wfx)
static DWORD PCM_GetFormatIndex(LPWAVEFORMATEX wfx)
{
int i;

View File

@ -191,24 +191,32 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
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);