Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Vista Audio Control Functions


  • Please log in to reply
182 replies to this topic
Skrollster
  • Guests
  • Last active:
  • Joined: --
Forgot to write that i also utilize an icon to show in the tray if the mic is muted or not

and it also shows a tray tip with information about volume level.

I'v been looking quite much today after a script that can mute / unmute my microphone but not found one, but this thread atleast got me on the way

my code here utilize the volume up / down / mute keys in conjunction with ctrl, it only works for the second set of microphone (witch i wanted it to work for)

(code omitted)

it might help someone else in the future.

[Moderator's note: Shortened quote.]

  • Guests
  • Last active:
  • Joined: --
Is any AHKv2 compatible version of VA.ahk exist?

I just tried v2 alpha and:
Posted Image
But VA.ahk didn't work even if all load time errors fixed.

naroyya978
  • Members
  • 26 posts
  • Last active: Nov 04 2013 05:13 PM
  • Joined: 28 Dec 2012

I didn't understand content in this thread, Is possible to create hot keys like below for win-7 ?

 

f1  -->  increase volume

f2  -->  decrease volume



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

I have updated VA.ahk to include some additional interface functions.

 

See also AutoHotkey v1.1.10 Alpha Release - updated SoundSet/SoundGet.



goat314
  • Members
  • 2 posts
  • Last active: Apr 21 2013 07:49 PM
  • Joined: 23 Mar 2013

So, I built a new pc.  I used to use soundset on my old pc to mute/unmute line-in which I use for my television audio.  For some reason, I have not been able to make that work on the same OS.  I found your script, and seem to have what I need to make it work, but it doesn't seem to be actually muting/unmuting the line-in.  While I am debugging, I am using the following:
 

 

COM_Init()
prefix_list = playback:,capture:
Loop, Parse, prefix_list, `,
{
Loop {
if !(device := VA_GetDevice(A_LoopField A_Index))
break
device_list .= A_LoopField A_Index "=" VA_GetDeviceName(device) "`n"
COM_Release(device)
}
}
MsgBox % device_list

IF VA_GetMute("1","capture")
{
VA_SetMute(0, "1","capture")
msgbox moo
}
else
{
VA_SetMute(1, "1","capture")
msgbox eep
}
COM_Term()
 

 

 

I get the following output:

playback:1=Realtek Digital Output (Optical) (Realtek High Definition Audio)

playback:2=Speakers (Realtek High Definition Audio)

playback:3=Realtek Digital Output (Realtek High Definition Audio)

capture:1=Line In (Realtek High Definition Audio)

capture:2=Microphone (HD Webcam C310)

Each execution then alternates between displaying "moo" and "eep" indicating that each execution is actually muting/unmuting the device, yet this is not actually happening at all (audio or display in my volume mixer).

 

Your help would be greatly appreciated in helping me achieve this 1 last bit of laziness. :-)



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Refer to the Levels tab on the device's properties page in the Sound control panel applet. It shows the volume and mute of each subunit. What you probably want to do is mute the device, not a specific subunit. In that case, use VA_SetMasterMute() rather than VA_SetMute().

I suggest trying the AutoHotkey v1.1.10 alpha release which supports SoundSet/SoundGet on Vista and later.

Donls
  • Members
  • 4 posts
  • Last active: Apr 14 2013 12:24 AM
  • Joined: 17 Sep 2011

Hi, need some help here please.

 

I made a volume control using the mouse wheel to change the volume.  This works fine with my sound blaster live card.  I need to use it with a Realtek HD.  On the Realtek the volume goes up or down in jumps rather than smoothly.  I think I need to use the ScalartoDB function but I can't even get it to display a response in a message box.  Can someone post a short example of how to use this function?  Is there another solution to my problem?

 

Thanks,

 

Don

 

 

I didn't understand content in this thread, Is possible to create hot keys like below for win-7 ?

 

f1  -->  increase volume

f2  -->  decrease volume

 

 

Yes



goat314
  • Members
  • 2 posts
  • Last active: Apr 21 2013 07:49 PM
  • Joined: 23 Mar 2013

Refer to the Levels tab on the device's properties page in the Sound control panel applet. It shows the volume and mute of each subunit. What you probably want to do is mute the device, not a specific subunit. In that case, use VA_SetMasterMute() rather than VA_SetMute().

I suggest trying the AutoHotkey v1.1.10 alpha release which supports SoundSet/SoundGet on Vista and later.

 

So, you were correct and it showed the script to be "working" in the levels tab of the properties.  Had I not been working with the Mixer open and the line-in always muted to start, I would have seen the desired effect.

 

That said, I would prefer it controlled from the master instead of the levels and replacing the SetMute with SetMasterMute was not toggling the mute at all.  Really appreciate your help and effort, happy to have my remote working again.



azurewelkin
  • Members
  • 1 posts
  • Last active: Apr 22 2013 12:15 AM
  • Joined: 21 Apr 2013

I encountered a few warnings in VA.ahk if I include #Warn in my script.  The problem can be simply reproduced in a 3-line script:

 

 

#Warn  ; Recommended for catching common errors.
#Include VA.ahk
VA_SetMasterVolume(0)

 

The first warning is

 

 

---------------------------
Test.ahk
---------------------------
Warning in #include file "......\VA.ahk":
     Using value of uninitialized variable.
 
Specifically: devices  (a local variable)
 
Line#
357: Loop,count
358: if VA_IMMDeviceCollection_Item(devices, A_Index-1, device) = 0  
359: if InStr(VA_GetDeviceName(device), m1) && (m2 = "" || ++index = m2)  
360: Goto,VA_GetDevice_Return
361: Else
362: ObjRelease(device), device:=0  
365: ObjRelease(deviceEnumerator)  
---> 366: if devices  
367: ObjRelease(devices)  
369: Return,device
370: }
373: {
375: if !VarSetCapacity(PKEY_Device_FriendlyName)  
376: VarSetCapacity(PKEY_Device_FriendlyName, 20),VA_GUID(PKEY_Device_FriendlyName :="{A45C254E-DF1C-4EFD-8020-67D146A850E0}"),NumPut(14, PKEY_Device_FriendlyName, 16)  
379: VarSetCapacity(prop, 16)  
 
Is this expected behavior (so I can never use #Warn in my script)?
 
I am using VA.ahk v2.2 and AutoHotkey_L v1.1.09.04.  Thank you very much.


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
I never bothered to update VA.ahk for #Warn. At this point, I'd recommend either disabling warnings or replacing VA.ahk with SoundSet/SoundGet in AutoHotkey v1.1.10-alpha.

No_Speak_Eng
  • Members
  • 6 posts
  • Last active: Oct 25 2013 10:33 AM
  • Joined: 22 Apr 2013

Hello!

 

Is there a script "DeviceTopology" for AHK_L & VA v2.2. I can not find.

I want to get all the properties of devices, and their use.

 

Thank you.



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

For v1.1.09.x, no.  See v1.1.10-alpha.



No_Speak_Eng
  • Members
  • 6 posts
  • Last active: Oct 25 2013 10:33 AM
  • Joined: 22 Apr 2013
v1.1.10-alpha this is great!
http://www.autohotke...me/#entry584153 and how to implement it?

nugged
  • Members
  • 7 posts
  • Last active: Jun 19 2013 06:16 AM
  • Joined: 17 May 2012

Lexikos,

you helping here so much so I am shy to load you more, but... can't google/find another way and straight solution for my question.

 

I have "Speakers" and "SPDIF" outputs, which I switch frequent, but manually.

 

Many (all I find) solutions for sound device switching with lovely AHK gives answer through

"Run, mmsys.cpl ..." and play keys, or some peoples dive into registry (mostly without success) or use external utilities: http://www.autohotke...o-device/page-7 (external ones I'd tried nircmd and Vista Audio Changer).

 

How to switch DEFAULT audio output on 7/Vista with VA lib?

So single hotkey press will switch my playing sound from one audio output to another (spdif / speakers in my case)?

 

Thanks.


AHK_L / Windows 7 user.
Creator and maintainer of ladoshki.com / patent.km.ua

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

No can do.  My belief was that it is something Microsoft intended the user to be in control of, and as such, did not provide an easy way for other programs to change it.