Add 'wavemap' support for 48 and 96kHz formats

Francois Gouget fgouget at codeweavers.com
Wed Dec 11 21:30:17 CST 2002


i810 sound cards only support one sound format: 48kHz 16 bit stereo. Any 
other format must be converted to this format first. The problem is that 
Wine's wavemaper and msacm libraries did not know abouve the 48kHz 
formats. With this patch the conversion should be successful and thus 
applications should be able to play the sound correctly.

Changelog:

    Francois Gouget <fgouget at codeweavers.com>

  * dlls/msacm/pcmconverter.c,
    dlls/winmm/wavemap/wavemap.c

    Add support for the 48 and 96kHz formats

-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
Index: dlls/msacm/pcmconverter.c
===================================================================
RCS file: /home/wine/wine/dlls/msacm/pcmconverter.c,v
retrieving revision 1.13
diff -u -r1.13 pcmconverter.c
@@ -103,12 +103,14 @@
     {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;
 
Index: dlls/winmm/wavemap/wavemap.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/wavemap/wavemap.c,v
retrieving revision 1.24
diff -u -r1.24 wavemap.c
--- dlls/winmm/wavemap/wavemap.c	31 Oct 2002 00:54:27 -0000	1.24
+++ dlls/winmm/wavemap/wavemap.c	12 Dec 2002 03:05:28 -0000
@@ -189,26 +192,34 @@
                         {wom->avgSpeedInner = wfx.nAvgBytesPerSec; goto found;}
 
         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);


More information about the wine-patches mailing list