AutoHotkey Community

It is currently May 26th, 2012, 8:47 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 151 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 11  Next
Author Message
 Post subject:
PostPosted: March 15th, 2008, 2:02 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 3:38 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 3:58 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 4:25 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 4:41 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 9:28 pm 
and no error message at all


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2008, 1:18 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2008, 1:49 am 
It was the 6 ! Thanks thanks thanks :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2008, 3:15 pm 
Offline

Joined: April 4th, 2008, 2:34 pm
Posts: 4
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2008, 12:48 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 4th, 2008, 12:38 pm 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 6th, 2008, 6:55 am 
Offline

Joined: September 20th, 2006, 2:05 pm
Posts: 73
Awesome function man. Thank you for this.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 12th, 2008, 2:35 am 
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)


Report this post
Top
  
Reply with quote  
PostPosted: July 12th, 2008, 6:41 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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%


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 12th, 2008, 1:13 pm 
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...


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 151 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 11  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], fusion1920, SKAN, Stigg, tomL and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group