Developer's Corner > Mixer (Volume) Control
Demos screens

DLL and U32 libraries that control the volume

An accessory for programmers to control the volume in MS Windows.
© 1992-2005 MultiMedia SoftWare and Studio DMM, all rights reserved

Description
The volume is controlled by a DLL or U32. The libraries work in all the MS Windows versions (95, 98, ME, NT, 2000 and XP).

Libraries are compatible with
Authorware 3, 3.5, 4, 5, 6, 6.5
Delphi 2, 3, 4, 5, 6, 7
Toolbook 6, 6.5, 7, 7.1, 7.2, 8, 8.5 ...
Visual Basic, C Language and others
.NET Framework

Possibile utilization
Since the control of MIXER in MS Windows is not implemented in most of the programming languages and author tools, we have decided to develop our own controller. You can judge for yourself how successful we were. The Volume Control is driven by the DLL, U32, or XTRAS. The library works in all the MS Windows versions (95, 98, ME, NT, 2000, XP).

Specifications of functions-calling convention and description of functions
Manufacturers of sound cards do not always observe the Microsoft-allocated constants for API. We have found a way to solve this serious problem and our library can work with most sound cards. In the event that you do find a sound card problem while using our library, we will greatly appreciate your sending us its description. The best way to help us improve our product is to download the Testing Program (223 kB). This program will read the information about your sound card and save it to an RTF file that should be sent to us along with a description of your troubles. These two pieces of information will enable us to analyze the problem and add your sound card to our library.

List of functions
dmm_RegVolume Registration of DLL (U32)
dmm_GetVolume Getting the value of volume (0-100%)
dmm_SetVolume Adjustment of volume (0-100%)
dmm_IsSoundCard Sound card detection
dmm_FadeTo Fluent fading-in, fading-out to desired value
dmm_GetMute Check of the MUTE CheckBox
dmm_SetMute Adjustment of the MUTE CheckBox
dmm_GetSelect Check of the SELECT RadioButton/CheckBox
dmm_SetSelect Adjustment of the SELECT RadioButton/CheckBox

Notes

Descriptions of functions
void = dmm_RegVolume(code:string)
You have to call this function before you use the library dmm_volume.dll (dmm_volume.u32) for the first time. If you do not insert the right registration Code, a dialog "this is a demo version ..." will appear.

Parameters
The type of code is STRINGG (LPCSTR), for demo version code= "demo". In commercial versions the string is unique for each license.

Example
dmm_RegVolume("demo")

volume = dmm_GetVolume(channel:word)
The function returns the volume value (in %) of the selected channel. In case of an error the function returns 0 (zero).

Parametres
The type of channel is WORD and here you fill in the channel code (see the channel constants table).

Example
cd = dmm_GetVolume(13)

volume = dmm_SetVolume(channel:word, newVolume:word)
The function adjusts the volume value (in %) of the selected channel. The function returns the value of newly adjusted volume. In case of an error the function returns 0 (zero).

Parametres
The type of channel is WORD and here you fill in the channel code (see the channel constants table).
The type of NewVolume is WORD and it adjusts the volume level of the chosen channel (in %).

Example
wave = dmm_SetVolume(11,75)

result = dmm_IsSoundCard()
The function returns "true" in case the sound card is recognized by the OS. In case it is not recognized, the function returns "false".

Parametres
The function has no parametres.

Example
if dmm_IsSoundCard() then
    ......
   else
    ......
end if

dmm_FadeTo(channel:word, newVolume:word, fadeTime:word)
The function fluently adjusts the volume value of the selected channel from the actual value to the newVolume value. The transition period is equal to the fadeTime parameter. There is a possibility that this function may not work correctly in Win95.

Parametres
The type of channel is WORD and here you fill in the channel code (see the channel constants table).
The type of NewVolume is WORD and it adjusts the volume level of the chosen channel (in %).
The type of FadeTime is WORD and you work with miliseconds.

Note: The function uses threads and enables you to work with several channels at the same time.

Example
dmm_FadeTo(10,75,2000)
dmm_FadeTo(12,50,1000)

mute = dmm_GetMute(channel:word)
The function returns the state of the MUTE CheckBox. If the state is "true", the channel is switched off. In case of an error, or in case the channel is on, the function returns "false". We recommend to use this function together with the function "dmm_GetSelect".

Parametres
The type of channel is WORD and here you fill in the channel code (see the channel constants table).

Example
if dmm_GetMute(channel) then
    ......
   else
    ......
end if

mute = dmm_SetMute(channel:word, newMute:boolean)
The function adjusts the state of MUTE. The function gives you the level of the CheckBox MUTE. If it is "true", the channel is switched off. In case of an error or in case the channel is on the function gives "false". We recommend to use this function together with the function "dmm_SetSelect".

Parametres
The type of channel is WORD and here you fill in the channel code (see the channel constants table).
The type of NewMute is BOOLEAN and it adjusts the CheckBox MUTE. For newMute=true the chosen channel is switched off, for newMute=false the chosen channel is switched on.

Example
mute = dmm_SetMute(13,true)

select = dmm_GetSelect(channel:word)
The function gives you the state of the RadioButton/CheckBox SELECT. If it is "true" the channel is chosen. We recommend you to use this function together with the function "dmm_GetMute".

Parametres
The type of channel is WORD and here you fill in the channel code (see the channel constants table).

Example
select = dmm_GetSelect(12)

select = dmm_SetSelect(channel:word, newSelect:boolean)
The function adjusts SELECT. The function gives you the state of the RadioButton/CheckBox SELECT. If it is "true" the channel is chosen. In case of an error or in case the channel is off, the function gives "false". We recommend you to use this function together with the function "dmm_SetMute".

Parametres
The type of channel is WORD and here you fill in the channel code (see the channel constants table).
The type of NewSelect is BOOLEAN and it adjusts RadioButton/Check Box SELECT. If newSelect=true then the channel is chosen.

Example
select =dmm_SetSelect(14, true)

Channel constants:
MASTER play 10     MASTER rec 20
WaveAudio play 11 WaveAudio rec 21
MIDI play 12 MIDI rec 22
CD audio play 13

CD audio rec

23
Line In play 14 Line In rec 24
Microphone play 15 Microphone rec 25

Demoversion download
Fully-functional testing versions of the DLL (U32), that can be used in most of programming languages, are available for download (these demo versions are fully functional, but the library will show a dialog window).

Authorware 4, 5, 6 demo (220 kB)
Delphi 6 demo (300 kB)
ToolBook 6.5 ... demo (100 kB)
VB.NET demo (110 kB)

Licensing

Volume Component can be bought in our SHOP.