PDA

View Full Version : Use PlaySound and control left/right volume independently



xltrader100
06-11-2012, 03:12 PM
I'm using the PlaySound function in Excel 11 to play wave files through the WINMM.DLL api. This is working well, and I can control the volume of the playback using waveOutGetVolume and waveOutSetVolume, but both left and right outputs are locked to the same volume.

I'd like to set left/right volumes independently.

In KB118377 (from 2003) they describe a method to control the left and right volumes independently, and it looks like it should do exactly what I want. Only I can't get it to work.

They use the MMSYSTEM.DLL, and when I try to run the sample code I get an error that MMSYSTEM.DLL is not found, although it's just where it should be in the System32 folder.

Searching in other Excel forums, there was a suggestion that MMSYSTEM.DLL is for 16-bit systems and is obsolete. Even so, it seems unlikely that Excel couldn't find it.

So, is this KB article still valid and should it still work to give independent control of left/right volume?

If not, is there any other way of doing that?

xltrader100
06-11-2012, 07:01 PM
Sorry, I should have posted a link to the KB article.

http://support.microsoft.com/kb/118377