Browse through the topics in the contents list to the right.
Gets the master volume level of an audio endpoint device.
Returns | A value between 0.0 and 100.0, inclusive. |
channel | (optional)The one-based index of the channel to retrieve. |
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Volume levels returned by this function follow the same curve as the Windows Vista Sound Mixer.
; Get the master volume of the default playback device. volume := VA_GetMasterVolume() ; Get the volume of the first and second channels. volume1 := VA_GetMasterVolume(1) volume2 := VA_GetMasterVolume(2) ; Get the master volume of a device by name. lineout_volume := VA_GetMasterVolume("", "Line Out") ; Get the master volume of the default recording device. recording_volume := VA_GetMasterVolume("", "capture") MsgBox, % "Playback volume:`t" volume . "`n Channel 1:`t" volume1 . "`n Channel 2:`t" volume2 . "`nLine Out volume:`t" lineout_volume . "`nRecording volume:`t" recording_volume
Sets the master volume level of an audio endpoint device.
vol | A value between 0.0 and 100.0, inclusive. |
channel | (optional)The one-based index of the channel to adjust. |
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Volume levels set by this function follow the same curve as the Windows Vista Sound Mixer.
Gets the number of channels an audio endpoint device has.
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Loop % VA_GetMasterChannelCount() Message .= "Channel " A_Index ": " VA_GetMasterVolume(A_Index) "`n" MsgBox %Message%
Gets the mute status of an audio endpoint device.
Returns | True if the audio endpoint device is muted, otherwise false. |
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Mutes or un-mutes an audio endpoint device.
mute | True to mute; false to un-mute. |
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Gets the volume level of a subunit.
Returns | A value between 0.0 and 100.0, inclusive. |
subunit_desc | (optional)See VA_FindSubunit. Defaults to "1". |
channel | (optional)The one-based index of the channel to retrieve. |
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Volume levels returned by this function follow the same curve as the Sound applet in Control Panel, not the Sound Mixer.
; Note that subunit names are audio driver-specific. ; The following will match "Line", "Line In", "Line Volume", etc. linein_feedback := VA_GetVolume("Line") mic_feedback := VA_GetVolume("Mic", "", "Line Out") MsgBox, % "Line In feedback through default playback device: " linein_feedback . "`nMicrophone feedback through Line Out: " mic_feedback . "`n(Note: these may be muted.)"
Sets the volume level of a subunit.
vol | A value between 0.0 and 100.0, inclusive. |
subunit_desc | (optional)See VA_FindSubunit. Defaults to "1". |
channel | (optional)The one-based index of the channel to retrieve. |
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Volume levels set by this function follow the same curve as the Sound applet in Control Panel, not the Sound Mixer.
Gets the number of channels a subunit has.
subunit_desc | (optional)See VA_FindSubunit. Defaults to "1". |
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Gets the mute status of a subunit.
Returns | True if the subunit is muted, otherwise false. |
subunit_desc | (optional)See VA_FindSubunit. Defaults to "1". |
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Mutes or un-mutes a subunit.
mute | True to mute; false to un-mute. |
subunit_desc | (optional)See VA_FindSubunit. Defaults to "1". |
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Gets a pointer to the IAudioEndpointVolume interface of an audio endpoint device.
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Use ObjRelease(pointer)
to release the interface pointer when it is no longer needed.
Gets a pointer to the IAudioMeterInformation interface of an audio endpoint device.
device_desc | (optional)See VA_GetDevice. Defaults to "playback". |
Use ObjRelease(pointer)
to release the interface pointer when it is no longer needed.
#SingleInstance, Force MeterLength = 30 audioMeter := VA_GetAudioMeter() VA_IAudioMeterInformation_GetMeteringChannelCount(audioMeter, channelCount) ; "The peak value for each channel is recorded over one device ; period and made available during the subsequent device period." VA_GetDevicePeriod("capture", devicePeriod) Loop { ; Get the peak value across all channels. VA_IAudioMeterInformation_GetPeakValue(audioMeter, peakValue) meter := MakeMeter(peakValue, MeterLength) ; Get the peak values of all channels. VarSetCapacity(peakValues, channelCount*4) VA_IAudioMeterInformation_GetChannelsPeakValues(audioMeter, channelCount, &peakValues) Loop %channelCount% meter .= "`n" MakeMeter(NumGet(peakValues, A_Index*4-4, "float"), MeterLength) ToolTip, %meter% Sleep, %devicePeriod% } MakeMeter(fraction, size) { global MeterLength Loop % fraction*size meter .= "|" Loop % (1-fraction)*size meter .= "." meter .= " " fraction return meter }
Gets a pointer to the IMMDevice interface of an audio endpoint device.
device_desc | device_id | device_number | ( friendly_name | 'playback' | 'capture' ) [ ':' index ] |
Use ObjRelease(device)
to release the interface pointer when it is no longer needed.
If device_desc is a device pointer returned by a previous call to VA_GetDevice, it is returned as-is. This behaviour is useful for other functions which accept a device_desc; these functions call VA_GetDevice internally.
device := VA_GetDevice("playback") ; default playback device device := VA_GetDevice("playback:1") ; first playback device device := VA_GetDevice("nvidia:2") ; second device whose name contains "nvidia" device := VA_GetDevice(3) ; third device
VA_IMMDevice_GetId(device, device_id) ; get a device id from a device pointer ;... device := VA_GetDevice(device_id) ; get a device pointer from an id
Gets the friendly name of an audio endpoint device.
device | A pointer to an IMMDevice interface. |
Retrieves the length of the periodic interval separating successive processing passes by the audio engine.
Returns | True on success, otherwise false. |
device_desc | See VA_GetDevice. |
default_period | (out) The default interval, in milliseconds. |
minimum_period | (out) The minimum interval, in milliseconds. |
Finds a subunit of a device, given a device description.
Returns | A pointer to the requested interface of a matching subunit, or 0 if none were found. |
device_desc | See VA_GetDevice. |
subunit_desc | See VA_FindSubunit (target_desc). |
subunit_iid | See VA_FindSubunit (target_iid). |
See VA_FindSubunit.
Enumerates matching subunits of a device.
Returns | See VA_EnumSubunitsEx. |
device | A pointer to an IMMDevice interface. |
callback | A callback accepting two parameters: part, interface. |
target_name | (optional)The full or partial friendly name of a subunit or subunits. |
target_iid | (optional)The ID of an interface which matching subunits must support. |
See VA_EnumSubunitsEx.
Enumerates matching subunits of a part (subunit or connector).
Returns | See Remarks. |
part | A pointer to an IPart interface. |
data_flow | 0 to enumerate incoming parts; 1 to enumerate outgoing parts. |
callback | A callback accepting two parameters: part, interface. |
target_name | (optional)The full or partial friendly name of a subunit or subunits. |
target_iid | (optional)The ID of an interface which matching subunits must support. |
The callback is called once for each matching subunit. The callback's first parameter is a pointer to the subunit (IPart), while the second parameter is a pointer to the required interface (or 0 if target_iid was omitted.) If the callback returns a non-zero value, enumeration is halted and the value is passed on to the caller.
Finds a subunit of a device, given a device pointer.
Returns | If a matching subunit is found, the return value is a pointer to the requested interface. Otherwise, the return value is 0. |
device | A pointer to an IMMDevice interface. |
target_desc | friendly_name | index | friendly_name:index |
target_iid | An interface ID. |
VA_FindSubunit requires a valid interface identifier. To retrieve a subunit by name alone, use VA_EnumSubunits or VA_EnumSubunitsEx.
Sets the default audio endpoint for a given role. Requires v2.3 or later.
Returns | |
device_desc | See VA_GetDevice. |
role | One of the following integer values: 0: eConsole - what Windows calls the "Default Device". 1: eMultimedia 2: eCommunications - what Windows calls the "Default Communication Device". |
This function relies on undocumented interfaces and therefore isn't guaranteed to work.
Converts a decibel value to a scalar value.
Returns | A value between 0.0 and 1.0. |
dB | A decibel value. |
min_dB | Minimum decibel value. |
max_dB | Maximum decibel value. |
The returned scalar value is usually consistent with values reported by the Sound applet in Control Panel, but not values reported by the Sound Mixer.
Converts a scalar value to a decibel value.
Returns | A decibel value. |
s | A value between 0.0 and 1.0. |
min_dB | Minimum decibel value. |
max_dB | Maximum decibel value. |
Functions with the naming pattern "VA_IInterface_Function" are direct equivalents of interface functions. These functions are defined under INTERFACE WRAPPERS in VA.ahk. For syntax and usage, see Core Audio APIs in Windows Vista (Programming Reference).
As of v2.0, interface wrappers for the following interfaces are included:
v2.1:
v2.1 on Windows 7 or later:
v2.2: