Modifies or returns the sound volume.
Remark: If the current computer has no sound card, the function has no effect and it always return 0.
// Modify the sound volume for the "WAV" files
ResVolume = MCIVolume("WAV", 200)
Syntax
Finding out and modifying the sound volume (all files) Hide the details
<Result> = MCIVolume(<Type of files> , <Element> [, <Volume> [, <Parameters> [, <Name of the message window>]]])
<Result>: Integer
Corresponds to:- the current sound volume.
- the sound volume before modification.
- 0 if an error occurs.
<Type of files>: Character string
Name or alias of the file or device to open.
<Element>: Constant
Element whose sound volume must be modified: | |
MciBass | Bass volume |
MciLeftVolume | Left volume |
MciRightVolume | Right volume |
MciTreble | Treble volume |
<Volume>: Optional integer
New sound volume for the specified <Element> (included between 0 and 65535).
<Parameters>: Optional character string
Additional parameters if necessary. These parameters can be known by checking the documentation of the Windows MCI function named "Set".
The MciWait constant can be added to this string. This constant is used to indicate that the program must wait for the end of the MCI command to run the rest of application.
<Name of the message window>: Optional character string
Name of the window used to intercept and manage the different messages sent by MMSYSTEM.DLL. These messages are in MM_xxxxxx format and can be retrieved with Event. You can for example get messages regarding the management of the CD ROM or Joystick.
Finding out and modifying the sound volume (WAV and MID only) Hide the details
<Result> = MCIVolume(<Type of files> , <New volume> , <New volume 2>)
<Result>: Integer
Corresponds to:- the current sound volume.
- the sound volume before modification.
- 0 if an error occurs.
<Type of files>: Character string
Type of files:- "WAV" for the ".WAV" files.
- "MID" for the ".MID" files.
- Name or alias of the file or device to open.
<New volume>: Integer
New sound volume (included between 0 and 65535). If <New volume 2> is not specified, corresponds to the general sound volume; otherwise, corresponds to the left sound volume. Only taken into account by the WAV and MID files.
<New volume 2>: Integer
New sound volume (included between 0 and 65535). Corresponds to the right sound volume. Only taken into account by the WAV and MID files.