| View previous topic :: View next topic |
| Author |
Message |
Loila Guest
|
Posted: Sat Mar 15, 2008 2:02 pm Post subject: |
|
|
Sorry but i don't understand anything :/ I'm a bit familiar with autohotkey, but concretly, how to mute 'line in' with a hotkey?
Is there only the script to run? Must we copy the com.ahk script before yours?
How do we access to all the functions?
Sorry if i'm a nub but i'd really like to use it
Thanks |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4469 Location: Qld, Australia
|
Posted: Sat Mar 15, 2008 3:38 pm Post subject: |
|
|
COM.ahk and VA.ahk should be placed in a function library folder. This allows AutoHotkey to automatically load VA.ahk (and COM.ahk) when the script starts if it calls any VA_() functions. Then, assuming the subunit name contains the word "Line", you may use this to toggle mute:
| Code: | COM_Init()
VA_SetMute(!VA_GetMute("Line"),"Line")
COM_Term() | ..or if you call COM_Init() at the start of your script, you may omit COM_Init() and COM_Term() from the above. For instance, | Code: | COM_Init()
^Volume_Mute::
VA_SetMute(!VA_GetMute("Line"),"Line")
return |
|
|
| Back to top |
|
 |
Loila Guest
|
Posted: Sat Mar 15, 2008 3:58 pm Post subject: |
|
|
Thanks for your quick answer
I've moved VA and COM in a new directory 'Lib' at the same level than autohotkey.exe
in my main script i wrote:
| Code: | #!o::
COM_Init()
VA_SetMute(!VA_GetMute("Line"),"Line")
COM_Term()
return |
but nothing happen :s |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4469 Location: Qld, Australia
|
Posted: Sat Mar 15, 2008 4:25 pm Post subject: |
|
|
Not even an error message? I guess the subunit name "Line" is incorrect. (It only needs to be a partial name.) Try running the Device Topology script in my first post, and post the list of "MUTE SUBUNITS" it outputs. I get the following:
| Code: | Master Mute
Mic Mute
Line Mute
CD Mute
Video Mute
Aux Mute
SPDIF
MIDI Mute |
|
|
| Back to top |
|
 |
Guest
|
Posted: Sat Mar 15, 2008 4:41 pm Post subject: |
|
|
Weird :/ That's what i get:
| Code: | VOLUME SUBUNITS
Speakers
PC Beep
Microphone
Aux
CD Audio
Line In
MUTE SUBUNITS
Master Mute
Mute
Mute
Mute
Mute
Mute |
|
|
| Back to top |
|
 |
Loila Guest
|
Posted: Sat Mar 15, 2008 9:28 pm Post subject: |
|
|
| and no error message at all |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4469 Location: Qld, Australia
|
Posted: Sun Mar 16, 2008 1:18 am Post subject: |
|
|
| You'll need to use a number (between 1 and the number of mute subunits) instead of "Line". Figure out which one by trial and error. |
|
| Back to top |
|
 |
Loila Guest
|
Posted: Sun Mar 16, 2008 1:49 am Post subject: |
|
|
It was the 6 ! Thanks thanks thanks  |
|
| Back to top |
|
 |
hjbotha
Joined: 04 Apr 2008 Posts: 4
|
Posted: Fri Apr 04, 2008 3:15 pm Post subject: |
|
|
Thanks very much for this lib, Lexikos. It's helped me adapt Rajat's OSD script for Vista, as you can see here: http://www.autohotkey.com/forum/viewtopic.php?t=30432
I've noticed that, at least on my machine, VA_SetMasterVolume doesn't seem to be able to reduce the volume to 0.
Running a script with
| Code: |
COM_Init()
VA_SetMasterVolume(0)
|
has no effect
But running
| Code: |
COM_Init()
VA_SetMasterVolume(0.01)
|
does.
H |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4469 Location: Qld, Australia
|
Posted: Sat Apr 05, 2008 12:48 am Post subject: |
|
|
Perhaps it is a driver quirk. It works on my end.
| The SDK docs wrote: | | The volume level is normalized to the range from 0 to 1, where 0 is the minimum volume level and 1 is the maximum level. | (VA_SetMasterVolume divides by 100.) |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 814 Location: Germany
|
Posted: Sun May 04, 2008 12:38 pm Post subject: |
|
|
Hi,
I've the problem that for some subunits the db2scalar and scalar2db functions won't work well. One subunit will move the slider in the mixer with bigger steps at the beginning and another subunit has bigger steps at the end. _________________ Tekl |
|
| Back to top |
|
 |
..:: Free Radical ::..
Joined: 20 Sep 2006 Posts: 47
|
Posted: Sun Jul 06, 2008 6:55 am Post subject: |
|
|
| Awesome function man. Thank you for this. |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Jul 12, 2008 2:35 am Post subject: Still can not control the line-in volume or Mute functionali |
|
|
I can not seem to control any of the components volume nor Mute functionality. I've even tried using just a Number. (I tried 1 - 10)
any thoughts?
| Code: | #!o::
COM_Init()
VA_SetMute(!VA_GetMute("5"),"5")
return |
Here's my output from your GUI:
| Code: | VOLUME SUBUNITS
Volume
Volume
Volume
Volume
Volume
Volume
Volume
MUTE SUBUNITS
Mute
Mute
Mute
Mute
Mute
Mute
Mute |
With the Main window showing:
| Code: |
+ (CONNECTOR) Play Control : {4509F757-2D46-4637-8E62-CE7DB944F57B}
+ Mute : IAudioMute
+ Bass Balance : {A2B1A1D9-4DB3-425D-A2B2-BD335CB3E2E5}
+ Treble Balance : {0A717812-694E-4907-B74B-BAFA5CFDCA7B}
+ Volume : IAudioVolumeLevel
+ Sum
+ Mute : IAudioMute
+ Volume : IAudioVolumeLevel
+ (CONNECTOR) Microphone FP : {4509F757-2D46-4637-8E62-CE7DB944F57B}
+ (UNKNOWN)
+ Mute : IAudioMute
+ Volume : IAudioVolumeLevel
+ (CONNECTOR) Digital-In : {4509F757-2D46-4637-8E62-CE7DB944F57B}
+ (UNKNOWN)
+ (CONNECTOR) Wave : {4509F757-2D46-4637-8E62-CE7DB944F57B}
+ (UNKNOWN)
+ Mute : IAudioMute
+ Volume : IAudioVolumeLevel
+ (CONNECTOR) MIDI Synth : {4509F757-2D46-4637-8E62-CE7DB944F57B}
+ (UNKNOWN)
+ Mute : IAudioMute
+ Volume : IAudioVolumeLevel
+ (CONNECTOR) Line-In : {4509F757-2D46-4637-8E62-CE7DB944F57B}
+ (UNKNOWN)
+ Mute : IAudioMute
+ Volume : IAudioVolumeLevel
+ (CONNECTOR) Auxiliary : {4509F757-2D46-4637-8E62-CE7DB944F57B}
+ (UNKNOWN)
+ Mute : IAudioMute
+ Volume : IAudioVolumeLevel
+ (CONNECTOR) Microphone : {4509F757-2D46-4637-8E62-CE7DB944F57B}
+ (UNKNOWN) |
|
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4469 Location: Qld, Australia
|
Posted: Sat Jul 12, 2008 6:41 am Post subject: Re: Still can not control the line-in volume or Mute functio |
|
|
| Anonymous wrote: | | Code: | #!o::
COM_Init()
VA_SetMute(!VA_GetMute("5"),"5")
return |
| It probably isn't really a problem in this case, but generally you should either call COM_Init once at the start of the script, or COM_Term once for each COM_Init.
| Code: | COM_Init() ; Initialize COM once.
#!o::VA_SetMute(!VA_GetMute("5"),"5")
|
| Code: | #!o::
COM_Init() ; Load COM.
VA_SetMute(!VA_GetMute("5"),"5")
COM_Term() ; Unload COM.
return |
What does the following give you? Does it reflect the mute status shown in the properties of your playback device?
| Code: | COM_Init()
Loop 7
t .= VA_GetMute(A_Index) ", "
Clipboard := t
MsgBox %t% |
|
|
| Back to top |
|
 |
Guest
|
Posted: Sat Jul 12, 2008 1:13 pm Post subject: Got it working.. Thanks!!! |
|
|
I solved it!
I'm so stupid.. I Quoted the Integer i.e. "5" as the parameter, and should have just passed the integer
this hit me as I slept...
VA_SetMute(!VA_GetMute("5"),"5")
SHOULD have been
VA_SetMute(!VA_GetMute(5),5)
What was I thinking... |
|
| Back to top |
|
 |
|