DSOUND: noise with aRts driver
Jerry Jenkins
Jerry_J_Jenkins at hotmail.com
Sat Sep 14 00:37:09 CDT 2002
Changes:
1 dlls/dsound/dsound_main.c :
Added waveOutSeVolume when open sound driver for dsound. Otherwise, there is no sound if we use aRts.
2 dlls/winmm/winearts/audio.c :
Modified volume_effect8 for taking unsigned data as singed data, and wodPlayer_WriteMaxFrags because of wrong data length which lead to strange noise and volume control working incorrectly.
Here is the content of patch.diff :
Index: dlls/dsound/dsound_main.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/dsound_main.c,v
retrieving revision 1.64
diff -u -r1.64 dsound_main.c
--- dlls/dsound/dsound_main.c 12 Sep 2002 22:07:02 -0000 1.64
+++ dlls/dsound/dsound_main.c 14 Sep 2002 04:21:07 -0000
@@ -668,6 +668,8 @@
}
(*ippDS)->drvdesc.dnDevNode--; /* take away last increment */
+
+ /* for aRts sound server */
+ if (err == DS_OK) waveOutSetVolume( (*ippDS)->drvdesc.dnDevNode, 0xFFFFFFFFL );
}
if (drv && (err == DS_OK))
Index: dlls/winmm/winearts/audio.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winearts/audio.c,v
retrieving revision 1.6
diff -u -r1.6 audio.c
--- dlls/winmm/winearts/audio.c 17 Aug 2002 00:43:18 -0000 1.6
+++ dlls/winmm/winearts/audio.c 14 Sep 2002 04:21:11 -0000
@@ -202,8 +202,8 @@
void volume_effect8(void *bufin, void* bufout, int length, int left,
int right, int nChannels)
{
- char *d_out = (char *)bufout;
- char *d_in = (char *)bufin;
+ BYTE *d_out = (BYTE *)bufout;
+ BYTE *d_in = (BYTE *)bufin;
int i, v;
/*
@@ -214,11 +214,11 @@
for(i = 0; i < length; i+=(nChannels))
{
- v = (char) ((*(d_in++) * left) / 100);
+ v = (BYTE) ((*(d_in++) * left) / 100);
*(d_out++) = (v>255) ? 255 : ((v<0) ? 0 : v);
if(nChannels == 2)
{
- v = (char) ((*(d_in++) * right) / 100);
+ v = (BYTE) ((*(d_in++) * right) / 100);
*(d_out++) = (v>255) ? 255 : ((v<0) ? 0 : v);
}
}
@@ -645,7 +645,7 @@
{
/* apply volume to the buffer we are about to send */
volume_effect8(wwo->lpPlayPtr->lpData + wwo->dwPartialOffset,
- wwo->sound_buffer, toWrite>>1, wwo->volume_left,
+ wwo->sound_buffer, toWrite, wwo->volume_left,
wwo->volume_right, wwo->format.wf.nChannels);
} else
{
More information about the wine-patches
mailing list