poorboy
asked on
mciSendString
Using VB5 and the API call (mciSendString), i have built a CD player. Everything works fine except i want to add a
volume control to the program using the same API call. I
can't figure out how to do that one. Could you show me how
this is done?
volume control to the program using the same API call. I
can't figure out how to do that one. Could you show me how
this is done?
ASKER
I have placed a SLIDER CONTROL on my form and i would like to change the volume
using it. Is there an API call i can use to do this?
using it. Is there an API call i can use to do this?
ASKER
Adjusted points to 30
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The API call waveOutSetVolume and waveOutGetVolume are new to me. Both functions
are indentical except for one letter. Here is the full function call for one of them.
"Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long" Could you tell me how to get the (uDeviceID) in the call.
I assume that (dwVolume) means the value of my slider control. If this is wrong please let me know.
are indentical except for one letter. Here is the full function call for one of them.
"Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long" Could you tell me how to get the (uDeviceID) in the call.
I assume that (dwVolume) means the value of my slider control. If this is wrong please let me know.
I think you need to use the waveOutGetNumDevs to find out how many playback devices there are. Then use the waveOutGetDevCaps to iterate through these until you find the desired device number. This number is uDeviceID.
dwVolume is a DWORD. The loworder word specifies the left channel, the high order the right.
So 0xFF00 represents silence on the left, full volume on the right.
0x00FF represents silence on the right, full volume on the left.
0xFFFF represents silence on the left, full volume on the right.
0x0000 represents silence.
0xFFFF represents full volume.
dwVolume is a DWORD. The loworder word specifies the left channel, the high order the right.
So 0xFF00 represents silence on the left, full volume on the right.
0x00FF represents silence on the right, full volume on the left.
0xFFFF represents silence on the left, full volume on the right.
0x0000 represents silence.
0xFFFF represents full volume.
//Viktor