5 VA_GetMasterVolume(channel="", device_desc="playback")
7 aev := VA_GetAudioEndpointVolume(device_desc)
9 VA_IAudioEndpointVolume_GetMasterVolumeLevelScalar(aev, vol)
11 VA_IAudioEndpointVolume_GetChannelVolumeLevelScalar(aev, channel-1, vol)
16 VA_SetMasterVolume(vol, channel="", device_desc="playback")
18 vol := vol>100 ? 100 : vol<0 ? 0 : vol
19 aev := VA_GetAudioEndpointVolume(device_desc)
21 VA_IAudioEndpointVolume_SetMasterVolumeLevelScalar(aev, vol/100)
23 VA_IAudioEndpointVolume_SetChannelVolumeLevelScalar(aev, channel-1, vol/100)
27 VA_GetMasterChannelCount(device_desc="playback")
29 aev := VA_GetAudioEndpointVolume(device_desc)
30 VA_IAudioEndpointVolume_GetChannelCount(aev, count)
35 VA_SetMasterMute(mute, device_desc="playback")
37 aev := VA_GetAudioEndpointVolume(device_desc)
38 VA_IAudioEndpointVolume_SetMute(aev, mute)
42 VA_GetMasterMute(device_desc="playback")
44 aev := VA_GetAudioEndpointVolume(device_desc)
45 VA_IAudioEndpointVolume_GetMute(aev, mute)
54 VA_GetVolume(subunit_desc="1", channel="", device_desc="playback")
56 avl := VA_GetDeviceSubunit(device_desc, subunit_desc, "{7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC}")
59 VA_IPerChannelDbLevel_GetChannelCount(avl, channel_count)
66 VA_IPerChannelDbLevel_GetLevelRange(avl, A_Index-1, min_dB, max_dB, step_dB)
67 VA_IPerChannelDbLevel_GetLevel(avl, A_Index-1, this_vol)
68 this_vol := VA_dB2Scalar(this_vol, min_dB, max_dB)
70 ; "Speakers Properties" reports the highest channel as the volume.
75 else if channel between 1 and channel_count
78 VA_IPerChannelDbLevel_GetLevelRange(avl, channel, min_dB, max_dB, step_dB)
79 VA_IPerChannelDbLevel_GetLevel(avl, channel, vol)
80 vol := VA_dB2Scalar(vol, min_dB, max_dB)
86 VA_SetVolume(vol, subunit_desc="1", channel="", device_desc="playback")
88 avl := VA_GetDeviceSubunit(device_desc, subunit_desc, "{7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC}")
92 vol := vol<0 ? 0 : vol>100 ? 100 : vol
94 VA_IPerChannelDbLevel_GetChannelCount(avl, channel_count)
98 ; Simple method -- resets balance to "center":
99 ;VA_IPerChannelDbLevel_SetLevelUniform(avl, vol)
103 Loop, %channel_count%
105 VA_IPerChannelDbLevel_GetLevelRange(avl, A_Index-1, min_dB, max_dB, step_dB)
106 VA_IPerChannelDbLevel_GetLevel(avl, A_Index-1, this_vol)
107 this_vol := VA_dB2Scalar(this_vol, min_dB, max_dB)
109 channel%A_Index%vol := this_vol
110 channel%A_Index%min := min_dB
111 channel%A_Index%max := max_dB
113 ; Scale all channels relative to the loudest channel.
114 ; (This is how Vista's "Speakers Properties" dialog seems to work.)
115 if (this_vol > vol_max)
119 Loop, %channel_count%
121 this_vol := channel%A_Index%vol / vol_max * vol
122 this_vol := VA_Scalar2dB(this_vol/100, channel%A_Index%min, channel%A_Index%max)
123 VA_IPerChannelDbLevel_SetLevel(avl, A_Index-1, this_vol)
126 else if channel between 1 and %channel_count%
129 VA_IPerChannelDbLevel_GetLevelRange(avl, channel, min_dB, max_dB, step_dB)
130 VA_IPerChannelDbLevel_SetLevel(avl, channel, VA_Scalar2dB(vol/100, min_dB, max_dB))
135 VA_GetChannelCount(subunit_desc="1", device_desc="playback")
137 avl := VA_GetDeviceSubunit(device_desc, subunit_desc, "{7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC}")
140 VA_IPerChannelDbLevel_GetChannelCount(avl, channel_count)
145 VA_SetMute(mute, subunit_desc="1", device_desc="playback")
147 amute := VA_GetDeviceSubunit(device_desc, subunit_desc, "{DF45AEEA-B74A-4B6B-AFAD-2366B6AA012E}")
150 VA_IAudioMute_SetMute(amute, mute)
154 VA_GetMute(subunit_desc="1", device_desc="playback")
156 amute := VA_GetDeviceSubunit(device_desc, subunit_desc, "{DF45AEEA-B74A-4B6B-AFAD-2366B6AA012E}")
159 VA_IAudioMute_GetMute(amute, muted)
168 VA_GetAudioMeter(device_desc="playback")
170 if ! device := VA_GetDevice(device_desc)
172 VA_IMMDevice_Activate(device, "{C02216F6-8C67-4B5B-9D00-D008E73E0064}", 7, 0, audioMeter)
176 VA_GetDevicePeriod(device_desc, ByRef default_period, ByRef minimum_period="")
178 defaultPeriod := minimumPeriod := 0
179 if ! device := VA_GetDevice(device_desc)
181 VA_IMMDevice_Activate(device, "{1CB9AD4C-DBFA-4c32-B178-C2F568A703B2}", 7, 0, audioClient)
183 ; IAudioClient::GetDevicePeriod
184 DllCall(NumGet(NumGet(audioClient+0)+36), "uint",audioClient, "int64*",default_period, "int64*",minimum_period)
185 ; Convert 100-nanosecond units to milliseconds.
186 default_period /= 10000
187 minimum_period /= 10000
188 COM_Release(audioClient)
194 COM_GUID4String(IID_IAudioEndpointVolume,"{5CDF2C82-841E-4546-9722-0CF74078229A}")
195 COM_GUID4String(IID_IAudioVolumeLevel,"{7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC}")
196 COM_GUID4String(IID_IAudioMute,"{DF45AEEA-B74A-4B6B-AFAD-2366B6AA012E}")
197 COM_GUID4String(IID_IAudioAutoGainControl,"{85401FD4-6DE4-4b9d-9869-2D6753A82F3C}")
200 VA_GetAudioEndpointVolume(device_desc="playback")
202 if ! device := VA_GetDevice(device_desc)
204 VA_IMMDevice_Activate(device, "{5CDF2C82-841E-4546-9722-0CF74078229A}", 7, 0, endpointVolume)
206 return endpointVolume
209 VA_GetDeviceSubunit(device_desc, subunit_desc, subunit_iid)
211 device := VA_GetDevice(device_desc)
214 subunit := VA_FindSubunit(device, subunit_desc, subunit_iid)
219 VA_FindSubunit(device, target_desc, target_iid)
221 if target_desc is integer
222 target_index := target_desc
224 RegExMatch(target_desc, "(?<_name>.*?)(?::(?<_index>\d+))?$", target)
225 ; v2.01: Since target_name is now a regular expression, default to case-insensitive mode if no options are specified.
226 if !RegExMatch(target_name,"[imsxADJUXPS`n`r`a ]+\)")
227 target_name := "i)" target_name
231 VarSetCapacity(cbinfo, 8, 0)
232 NumPut(target_index ? target_index : 1, cbinfo, 0)
233 r := VA_EnumSubunits(device, "VA_FindSubunitCallback", target_name, target_iid, &cbinfo)
234 DllCall("GlobalFree", "uint", callback)
238 VA_FindSubunitCallback(part, interface, prm)
240 NumPut(index := 1 + NumGet(prm+4), prm+4)
241 if NumGet(prm+0) = index
243 COM_AddRef(interface)
248 VA_EnumSubunits(device, callback, target_name="", target_iid="", callback_param="")
250 VA_IMMDevice_Activate(device, "{2A07407E-6497-4A18-9787-32F79BD0D98F}", 7, 0, deviceTopology)
251 VA_IDeviceTopology_GetConnector(deviceTopology, 0, conn)
252 COM_Release(deviceTopology)
253 VA_IConnector_GetConnectedTo(conn, conn_to)
254 VA_IConnector_GetDataFlow(conn, data_flow)
257 return ; blank to indicate error
258 part := COM_QueryInterface(conn_to, "{AE2DE0E4-5BCA-4F2D-AA46-5D13F8FDB3A9}")
260 r := VA_EnumSubunitsEx(part, data_flow, callback, target_name, target_iid, callback_param)
262 return r ; value returned by callback, or zero.
265 VA_EnumSubunitsEx(part, data_flow, callback, target_name="", target_iid="", callback_param="")
269 VA_IPart_GetPartType(part, type)
271 if type = 1 ; Subunit
273 VA_IPart_GetName(part, name)
275 ; v2.01: target_name is now a regular expression.
276 if RegExMatch(name, target_name)
279 r := %callback%(part, 0, callback_param)
281 if VA_IPart_Activate(part, 7, target_iid, interface) = 0
283 r := %callback%(part, interface, callback_param)
284 ; The callback is responsible for calling COM_AddRef()
285 ; if it intends to keep the interface pointer.
286 COM_Release(interface)
290 return r ; early termination
295 VA_IPart_EnumPartsIncoming(part, parts)
297 VA_IPart_EnumPartsOutgoing(part, parts)
299 VA_IPartsList_GetCount(parts, count)
302 VA_IPartsList_GetPart(parts, A_Index-1, subpart)
303 r := VA_EnumSubunitsEx(subpart, data_flow, callback, target_name, target_iid, callback_param)
306 break ; early termination
309 return r ; continue/finished enumeration
312 ; device_desc = device_id
313 ; | ( friendly_name | 'playback' | 'capture' ) [ ':' index ]
314 VA_GetDevice(device_desc="playback")
316 if ! deviceEnumerator := COM_CreateObject("{BCDE0395-E52F-467C-8E3D-C4579291692E}","{A95664D2-9614-4F35-A746-DE8DB63617E6}")
321 ; deviceEnumerator->GetDevice(device_id, [out] device)
322 if DllCall(NumGet(NumGet(deviceEnumerator+0)+20), "uint",deviceEnumerator, "uint",COM_Unicode4Ansi(wstr, device_desc), "uint*",device) = 0
323 goto VA_GetDevice_Return
325 if device_desc is integer
328 RegExMatch(device_desc, "(.*?)\s*(?::(\d+))?$", m)
331 m1 := "", flow := 0 ; eRender
332 else if m1 in capture,c
333 m1 := "", flow := 1 ; eCapture
334 else if (m1 . m2) = "" ; no name or number specified
335 m1 := "", flow := 0 ; eRender (default)
339 if (m1 . m2) = "" ; no name or number (maybe "playback" or "capture")
340 { ; deviceEnumerator->GetDefaultAudioEndpoint(dataFlow, role, [out] device)
341 DllCall(NumGet(NumGet(deviceEnumerator+0)+16), "uint",deviceEnumerator, "uint",flow, "uint",0, "uint*",device)
342 goto VA_GetDevice_Return
345 ; deviceEnumerator->EnumAudioEndpoints(dataFlow, stateMask, [out] devices)
346 DllCall(NumGet(NumGet(deviceEnumerator+0)+12), "uint",deviceEnumerator, "uint",flow, "uint",1, "uint*",devices)
348 ; devices->GetCount([out] count)
349 DllCall(NumGet(NumGet(devices+0)+12), "uint",devices, "uint*",count)
352 { ; devices->Item(m2-1, [out] device)
353 DllCall(NumGet(NumGet(devices+0)+16), "uint",devices, "uint",m2-1, "uint*",device)
354 goto VA_GetDevice_Return
359 ; devices->Item(A_Index-1, [out] device)
360 if DllCall(NumGet(NumGet(devices+0)+16), "uint",devices, "uint",A_Index-1, "uint*",device) = 0
361 if InStr(VA_GetDeviceName(device), m1) && (m2 = "" || ++index = m2)
362 goto VA_GetDevice_Return
364 COM_Release(device), device:=0
367 COM_Release(deviceEnumerator)
371 return device ; may be 0
374 VA_GetDeviceName(device)
376 static PKEY_Device_FriendlyName
377 if !VarSetCapacity(PKEY_Device_FriendlyName)
378 VarSetCapacity(PKEY_Device_FriendlyName, 20)
379 ,COM_GUID4String(PKEY_Device_FriendlyName, "{A45C254E-DF1C-4EFD-8020-67D146A850E0}")
380 ,NumPut(14, PKEY_Device_FriendlyName, 16)
381 VarSetCapacity(prop, 16)
382 VA_IMMDevice_OpenPropertyStore(device, 0, store)
383 ; store->GetValue(.., [out] prop)
384 DllCall(NumGet(NumGet(store+0)+20), "uint",store, "uint",&PKEY_Device_FriendlyName, "uint",&prop)
386 return COM_Ansi4Unicode(NumGet(prop,8)), COM_CoTaskMemFree(NumGet(prop,8))
390 VA_dB2Scalar(dB, min_dB, max_dB) {
391 min_s := 10**(min_dB/20), max_s := 10**(max_dB/20)
392 return ((10**(dB/20))-min_s)/(max_s-min_s)*100
395 VA_Scalar2dB(s, min_dB, max_dB) {
396 min_s := 10**(min_dB/20), max_s := 10**(max_dB/20)
397 return log((max_s-min_s)*s+min_s)*20
403 ; Reference: Core Audio APIs in Windows Vista -- Programming Reference
404 ; http://msdn2.microsoft.com/en-us/library/ms679156(VS.85).aspx
410 VA_IMMDevice_Activate(this, iid, ClsCtx, ActivationParams, ByRef Interface) {
411 return DllCall(NumGet(NumGet(this+0)+12), "uint", this, "uint", COM_GUID4String(iid,iid), "uint", ClsCtx, "uint", ActivationParams, "uint*", Interface)
413 VA_IMMDevice_OpenPropertyStore(this, Access, ByRef Properties) {
414 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "uint", Access, "uint*", Properties)
416 VA_IMMDevice_GetId(this, ByRef Id) {
417 hr := DllCall(NumGet(NumGet(this+0)+20), "uint", this, "uint*", Id)
418 Id := (COM_Ansi4Unicode(Id),COM_CoTaskMemFree(Id))
421 VA_IMMDevice_GetState(this, ByRef State) {
422 return DllCall(NumGet(NumGet(this+0)+24), "uint", this, "uint*", State)
428 VA_IDeviceTopology_GetConnectorCount(this, ByRef Count) {
429 return DllCall(NumGet(NumGet(this+0)+12), "uint", this, "uint*", Count)
431 VA_IDeviceTopology_GetConnector(this, Index, ByRef Connector) {
432 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "uint", Index, "uint*", Connector)
434 VA_IDeviceTopology_GetSubunitCount(this, ByRef Count) {
435 return DllCall(NumGet(NumGet(this+0)+20), "uint", this, "uint*", Count)
437 VA_IDeviceTopology_GetSubunit(this, Index, ByRef Subunit) {
438 return DllCall(NumGet(NumGet(this+0)+24), "uint", this, "uint", Index, "uint*", Subunit)
440 VA_IDeviceTopology_GetPartById(this, Id, ByRef Part) {
441 return DllCall(NumGet(NumGet(this+0)+28), "uint", this, "uint", Id, "uint*", Part)
443 VA_IDeviceTopology_GetDeviceId(this, ByRef DeviceId) {
444 hr := DllCall(NumGet(NumGet(this+0)+32), "uint", this, "uint*", DeviceId)
445 DeviceId := (COM_Ansi4Unicode(DeviceId),COM_CoTaskMemFree(DeviceId))
448 VA_IDeviceTopology_GetSignalPath(this, PartFrom, PartTo, RejectMixedPaths, ByRef Parts) {
449 return DllCall(NumGet(NumGet(this+0)+36), "uint", this, "uint", PartFrom, "uint", PartTo, "int", RejectMixedPaths, "uint*", Parts)
455 VA_IConnector_GetType(this, ByRef Type) {
456 return DllCall(NumGet(NumGet(this+0)+12), "uint", this, "int*", Type)
458 VA_IConnector_GetDataFlow(this, ByRef Flow) {
459 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "int*", Flow)
461 VA_IConnector_ConnectTo(this, ConnectTo) {
462 return DllCall(NumGet(NumGet(this+0)+20), "uint", this, "uint", ConnectTo)
464 VA_IConnector_Disconnect(this) {
465 return DllCall(NumGet(NumGet(this+0)+24), "uint", this)
467 VA_IConnector_IsConnected(this, ByRef Connected) {
468 return DllCall(NumGet(NumGet(this+0)+28), "uint", this, "int*", Connected)
470 VA_IConnector_GetConnectedTo(this, ByRef ConTo) {
471 return DllCall(NumGet(NumGet(this+0)+32), "uint", this, "uint*", ConTo)
473 VA_IConnector_GetConnectorIdConnectedTo(this, ByRef ConnectorId) {
474 hr := DllCall(NumGet(NumGet(this+0)+36), "uint", this, "uint*", ConnectorId)
475 ConnectorId := (COM_Ansi4Unicode(ConnectorId),COM_CoTaskMemFree(ConnectorId))
478 VA_IConnector_GetDeviceIdConnectedTo(this, ByRef DeviceId) {
479 hr := DllCall(NumGet(NumGet(this+0)+40), "uint", this, "uint*", DeviceId)
480 DeviceId := (COM_Ansi4Unicode(DeviceId),COM_CoTaskMemFree(DeviceId))
487 VA_IPart_GetName(this, ByRef Name) {
488 hr := DllCall(NumGet(NumGet(this+0)+12), "uint", this, "uint*", Name)
489 Name := (COM_Ansi4Unicode(Name),COM_CoTaskMemFree(Name))
492 VA_IPart_GetLocalId(this, ByRef Id) {
493 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "uint*", Id)
495 VA_IPart_GetGlobalId(this, ByRef GlobalId) {
496 hr := DllCall(NumGet(NumGet(this+0)+20), "uint", this, "uint*", GlobalId)
497 GlobalId := (COM_Ansi4Unicode(GlobalId),COM_CoTaskMemFree(GlobalId))
500 VA_IPart_GetPartType(this, ByRef PartType) {
501 return DllCall(NumGet(NumGet(this+0)+24), "uint", this, "int*", PartType)
503 VA_IPart_GetSubType(this, ByRef SubType) {
504 VarSetCapacity(SubType,16,0)
505 hr := DllCall(NumGet(NumGet(this+0)+28), "uint", this, "uint", &SubType)
506 SubType := COM_String4GUID(&SubType)
509 VA_IPart_GetControlInterfaceCount(this, ByRef Count) {
510 return DllCall(NumGet(NumGet(this+0)+32), "uint", this, "uint*", Count)
512 VA_IPart_GetControlInterface(this, Index, ByRef InterfaceDesc) {
513 return DllCall(NumGet(NumGet(this+0)+36), "uint", this, "uint", Index, "uint*", InterfaceDesc)
515 VA_IPart_EnumPartsIncoming(this, ByRef Parts) {
516 return DllCall(NumGet(NumGet(this+0)+40), "uint", this, "uint*", Parts)
518 VA_IPart_EnumPartsOutgoing(this, ByRef Parts) {
519 return DllCall(NumGet(NumGet(this+0)+44), "uint", this, "uint*", Parts)
521 VA_IPart_GetTopologyObject(this, ByRef Topology) {
522 return DllCall(NumGet(NumGet(this+0)+48), "uint", this, "uint*", Topology)
524 VA_IPart_Activate(this, ClsContext, iid, ByRef Object) {
525 return DllCall(NumGet(NumGet(this+0)+52), "uint", this, "uint", ClsContext, "uint", COM_GUID4String(iid,iid), "uint*", Object)
527 VA_IPart_RegisterControlChangeCallback(this, iid, Notify) {
528 return DllCall(NumGet(NumGet(this+0)+56), "uint", this, "uint", COM_GUID4String(iid,iid), "uint", Notify)
530 VA_IPart_UnregisterControlChangeCallback(this, Notify) {
531 return DllCall(NumGet(NumGet(this+0)+60), "uint", this, "uint", Notify)
537 VA_IPartsList_GetCount(this, ByRef Count) {
538 return DllCall(NumGet(NumGet(this+0)+12), "uint", this, "uint*", Count)
540 VA_IPartsList_GetPart(this, INdex, ByRef Part) {
541 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "uint", INdex, "uint*", Part)
545 ; IAudioEndpointVolume
547 VA_IAudioEndpointVolume_RegisterControlChangeNotify(this, Notify) {
548 return DllCall(NumGet(NumGet(this+0)+12), "uint", this, "uint", Notify)
550 VA_IAudioEndpointVolume_UnregisterControlChangeNotify(this, Notify) {
551 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "uint", Notify)
553 VA_IAudioEndpointVolume_GetChannelCount(this, ByRef ChannelCount) {
554 return DllCall(NumGet(NumGet(this+0)+20), "uint", this, "uint*", ChannelCount)
556 VA_IAudioEndpointVolume_SetMasterVolumeLevel(this, LevelDB, GuidEventContext="") {
557 return DllCall(NumGet(NumGet(this+0)+24), "uint", this, "float", LevelDB, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
559 VA_IAudioEndpointVolume_SetMasterVolumeLevelScalar(this, Level, GuidEventContext="") {
560 return DllCall(NumGet(NumGet(this+0)+28), "uint", this, "float", Level, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
562 VA_IAudioEndpointVolume_GetMasterVolumeLevel(this, ByRef LevelDB) {
563 return DllCall(NumGet(NumGet(this+0)+32), "uint", this, "float*", LevelDB)
565 VA_IAudioEndpointVolume_GetMasterVolumeLevelScalar(this, ByRef Level) {
566 return DllCall(NumGet(NumGet(this+0)+36), "uint", this, "float*", Level)
568 VA_IAudioEndpointVolume_SetChannelVolumeLevel(this, Channel, LevelDB, GuidEventContext="") {
569 return DllCall(NumGet(NumGet(this+0)+40), "uint", this, "uint", Channel, "float", LevelDB, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
571 VA_IAudioEndpointVolume_SetChannelVolumeLevelScalar(this, Channel, Level, GuidEventContext="") {
572 return DllCall(NumGet(NumGet(this+0)+44), "uint", this, "uint", Channel, "float", Level, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
574 VA_IAudioEndpointVolume_GetChannelVolumeLevel(this, Channel, ByRef LevelDB) {
575 return DllCall(NumGet(NumGet(this+0)+48), "uint", this, "uint", Channel, "float*", LevelDB)
577 VA_IAudioEndpointVolume_GetChannelVolumeLevelScalar(this, Channel, ByRef Level) {
578 return DllCall(NumGet(NumGet(this+0)+52), "uint", this, "uint", Channel, "float*", Level)
580 VA_IAudioEndpointVolume_SetMute(this, Mute, GuidEventContext="") {
581 return DllCall(NumGet(NumGet(this+0)+56), "uint", this, "int", Mute, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
583 VA_IAudioEndpointVolume_GetMute(this, ByRef Mute) {
584 return DllCall(NumGet(NumGet(this+0)+60), "uint", this, "int*", Mute)
586 VA_IAudioEndpointVolume_GetVolumeStepInfo(this, ByRef Step, ByRef StepCount) {
587 return DllCall(NumGet(NumGet(this+0)+64), "uint", this, "uint*", Step, "uint*", StepCount)
589 VA_IAudioEndpointVolume_VolumeStepUp(this, GuidEventContext="") {
590 return DllCall(NumGet(NumGet(this+0)+68), "uint", this, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
592 VA_IAudioEndpointVolume_VolumeStepDown(this, GuidEventContext="") {
593 return DllCall(NumGet(NumGet(this+0)+72), "uint", this, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
595 VA_IAudioEndpointVolume_QueryHardwareSupport(this, ByRef HardwareSupportMask) {
596 return DllCall(NumGet(NumGet(this+0)+76), "uint", this, "uint*", HardwareSupportMask)
598 VA_IAudioEndpointVolume_GetVolumeRange(this, ByRef MinDB, ByRef MaxDB, ByRef IncrementDB) {
599 return DllCall(NumGet(NumGet(this+0)+80), "uint", this, "float*", MinDB, "float*", MaxDB, "float*", IncrementDB)
604 ; Applies to IAudioVolumeLevel, IAudioBass, IAudioMidrange and IAudioTreble.
606 VA_IPerChannelDbLevel_GetChannelCount(this, ByRef Channels) {
607 return DllCall(NumGet(NumGet(this+0)+12), "uint", this, "uint*", Channels)
609 VA_IPerChannelDbLevel_GetLevelRange(this, Channel, ByRef MinLevelDB, ByRef MaxLevelDB, ByRef Stepping) {
610 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "uint", Channel, "float*", MinLevelDB, "float*", MaxLevelDB, "float*", Stepping)
612 VA_IPerChannelDbLevel_GetLevel(this, Channel, ByRef LevelDB) {
613 return DllCall(NumGet(NumGet(this+0)+20), "uint", this, "uint", Channel, "float*", LevelDB)
615 VA_IPerChannelDbLevel_SetLevel(this, Channel, LevelDB, GuidEventContext="") {
616 return DllCall(NumGet(NumGet(this+0)+24), "uint", this, "uint", Channel, "float", LevelDB, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
618 VA_IPerChannelDbLevel_SetLevelUniform(this, LevelDB, GuidEventContext="") {
619 return DllCall(NumGet(NumGet(this+0)+28), "uint", this, "float", LevelDB, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
621 VA_IPerChannelDbLevel_SetLevelAllChannels(this, LevelsDB, ChannelCount, GuidEventContext="") {
622 return DllCall(NumGet(NumGet(this+0)+32), "uint", this, "uint", LevelsDB, "uint", ChannelCount, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
628 VA_IAudioMute_SetMute(this, Muted, GuidEventContext="") {
629 return DllCall(NumGet(NumGet(this+0)+12), "uint", this, "int", Muted, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
631 VA_IAudioMute_GetMute(this, ByRef Muted) {
632 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "int*", Muted)
636 ; IAudioAutoGainControl
638 VA_IAudioAutoGainControl_GetEnabled(this, ByRef Enabled) {
639 return DllCall(NumGet(NumGet(this+0)+12), "uint", this, "int*", Enabled)
641 VA_IAudioAutoGainControl_SetEnabled(this, Enable, GuidEventContext="") {
642 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "int", Enable, "uint", GuidEventContext ? COM_GUID4String(GuidEventContext,GuidEventContext) : 0)
646 ; IAudioMeterInformation
648 VA_IAudioMeterInformation_GetPeakValue(this, ByRef Peak) {
649 return DllCall(NumGet(NumGet(this+0)+12), "uint", this, "float*", Peak)
651 VA_IAudioMeterInformation_GetMeteringChannelCount(this, ByRef ChannelCount) {
652 return DllCall(NumGet(NumGet(this+0)+16), "uint", this, "uint*", ChannelCount)
654 VA_IAudioMeterInformation_GetChannelsPeakValues(this, ChannelCount, PeakValues) {
655 return DllCall(NumGet(NumGet(this+0)+20), "uint", this, "uint", ChannelCount, "uint", PeakValues)
657 VA_IAudioMeterInformation_QueryHardwareSupport(this, ByRef HardwareSupportMask) {
658 return DllCall(NumGet(NumGet(this+0)+24), "uint", this, "uint*", HardwareSupportMask)