baGetVolume gets the current system volume level.


Windows and Macintosh


Result = baGetVolume( Device )


Device is the device to get the volume of. Can be:

Windows NT/2000/XP


gets the master volume


gets the volume of wave and video files


gets the volume of audio CD playback


gets the volume of an external midi device


gets the volume of the internal FM synthesizer

"master mute"

gets the master mute state

"wave mute"

gets the wave mute state

"cd mute"

gets the CD mute state

"synth mute"

gets the built-in synthesizer mute state

Windows Vista


gets the master volume

"master mute"

gets the master mute state


gets the master recording volume

"record mute"

gets the master recording mute state


"speakers" gets the volume of external speaker
"wave" gets the volume of internal speaker


Returns the volume of the requested device. The volume level can be between 0 (silence) and 100 (maximum). The mute options will return 1 if the mute is on, or 0 if it isn't.
Returns -1 if the function is not supported.


Volume = baGetVolume( "wave" )

Volume := baGetVolume( "wave" )


Not all sound cards support this function. Some cards will only support some of the device types. They will return -1 if the function is not supported.

The function will get the volume from the first sound card found.

If the left and right channels are at different levels, then the average of the two is returned.

Some sound cards do not set the volume precisely. For example, if you set the volume to 50 using the baSetVolume function, then call this function, it may return an 48 or 49.

On Windows Vista, Microsoft made some big changes to the way the sound API works, you can no longer set the level for individual device types.

On Macintosh, you can also use "master" for "speakers".


See also: