GetVolume

Description:

baGetVolume gets the current system volume level.

Platforms:

Windows and Macintosh

Usage:

Result = baGetVolume( Device )

Arguments:

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

Windows NT/2000/XP

"master" 

gets the master volume

"wave"

gets the volume of wave and video files

"cd"

gets the volume of audio CD playback

"midi"

gets the volume of an external midi device

"synth"

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

"master" 

gets the master volume

"master mute"

gets the master mute state

"record"

gets the master recording volume

"record mute"

gets the master recording mute state

Macintosh

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

Returns:

Integer.
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.

Examples:

Director:
Volume = baGetVolume( "wave" )

Authorware:
Volume := baGetVolume( "wave" )
 

Notes:

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:

baSetVolume