AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Vista Audio Control Functions v2.0
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Loila
Guest





PostPosted: Sat Mar 15, 2008 2:02 pm    Post subject: Reply with quote

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 Smile

Thanks
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4469
Location: Qld, Australia

PostPosted: Sat Mar 15, 2008 3:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Loila
Guest





PostPosted: Sat Mar 15, 2008 3:58 pm    Post subject: Reply with quote

Thanks for your quick answer Smile

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

PostPosted: Sat Mar 15, 2008 4:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sat Mar 15, 2008 4:41 pm    Post subject: Reply with quote

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





PostPosted: Sat Mar 15, 2008 9:28 pm    Post subject: Reply with quote

and no error message at all
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4469
Location: Qld, Australia

PostPosted: Sun Mar 16, 2008 1:18 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Loila
Guest





PostPosted: Sun Mar 16, 2008 1:49 am    Post subject: Reply with quote

It was the 6 ! Thanks thanks thanks Smile
Back to top
hjbotha



Joined: 04 Apr 2008
Posts: 4

PostPosted: Fri Apr 04, 2008 3:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 4469
Location: Qld, Australia

PostPosted: Sat Apr 05, 2008 12:48 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Tekl



Joined: 24 Sep 2004
Posts: 814
Location: Germany

PostPosted: Sun May 04, 2008 12:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
..:: Free Radical ::..



Joined: 20 Sep 2006
Posts: 47

PostPosted: Sun Jul 06, 2008 6:55 am    Post subject: Reply with quote

Awesome function man. Thank you for this.
Back to top
View user's profile Send private message
Guest






PostPosted: Sat Jul 12, 2008 2:35 am    Post subject: Still can not control the line-in volume or Mute functionali Reply with quote

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

PostPosted: Sat Jul 12, 2008 6:41 am    Post subject: Re: Still can not control the line-in volume or Mute functio Reply with quote

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
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sat Jul 12, 2008 1:13 pm    Post subject: Got it working.. Thanks!!! Reply with quote

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

VA_SetMute(!VA_GetMute("5"),"5")

SHOULD have been

VA_SetMute(!VA_GetMute(5),5)


What was I thinking...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 3 of 7

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group