Subject: | Win32-Sound-0.47 |
Date: | Wed, 11 Jul 2007 23:50:28 +0200 |
To: | bug-libwin32 [...] rt.cpan.org |
From: | "Steffen Heinrich" <perl [...] atablis.com> |
Win32-Sound-0.47
Bug:
Win32::Sound::Volume(LEFT [, RIGHT]) doesn't work as expected.
Observed on Windows XP.
(And possibly any Windows Version >=2000(?)).
Symptoms:
After calling Volume() with any 1 or 2 arbitrary values the right
channel is mute.
Since 2000(?) this behaviour has been described a couple of times.
e.g. http://prlmnks.org/html/379308.html
Probable cause:
The signature of Microsoft's MM function waveOutSetVolume() was
amended somewhere around this time:
http://msdn2.microsoft.com/en-us/library/ms713762.aspx
It looks like the volume resolution (for 2 channels) has changed from
WORD to DWORD.
Irritatingly, the Win32::Sound documentation correctly states that
individual channel values may "range from 0 to 65535 (0xFFFF)",
but this insight has appearantly never ever affected the module's
perl code nor the XS code where each channel is clearly treated as
8bit.
Possible solution:
Shifting Bits based on detected Windows version.
Cheers,
Steffen Heinrich