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 Sound questions

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
raven-gm



Joined: 25 Mar 2007
Posts: 24

PostPosted: Tue Jan 29, 2008 6:51 am    Post subject: Vista Sound questions Reply with quote

So I have a bit of a weird question...
I have vista, and it has some cool sound options, one of which is to have headphones and speakers plugged in, and then switch between which ports are being played to. (not sure if this was in XP, never found it if it was...)
But my case is not cool enough to recognise when I have headphones plugged in, and so it thinks I have both in, all the time.
I have solved this by switching between the two using the interface but it is a lengthy process and I wondered if I could automate it with a DllCall.
Any suggestions/tips/other things?

Also, this is a bit of a side-question, but is it possible to use Autohotkey to set Vista Sound settings for individual applications?
_________________
I would like to think that I know what I'm doing, but there's just to much stuff I've yet to learn...
Back to top
View user's profile Send private message AIM Address
Lexikos



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

PostPosted: Tue Jan 29, 2008 8:58 am    Post subject: Reply with quote

See my post in the topic [Select sound source].
Quote:
Also, this is a bit of a side-question, but is it possible to use Autohotkey to set Vista Sound settings for individual applications?
It may be possible through WASAPI (Windows Audio Session API, specific to Vista.) It would at least require knowing the GUID of the application's default audio session. Unfortunately I don't know how to access this information, but since Sndvol does it, it should be possible...

Edit: Seems not; see Accessing/Enumerating Audio Sessions. As with other parts of Vista's new audio API, MS decided the user must love the default user interface, so they (intentionally, it seems) do not provide an API that would allow third-party developers to emulate or replace it...
Evil or Very Mad
Back to top
View user's profile Send private message
Democratus



Joined: 01 Sep 2007
Posts: 120

PostPosted: Tue Jan 29, 2008 11:54 pm    Post subject: Reply with quote

Some pranksters were probably making people go deaf or something.

God knows I would.

With Vista, I couldn't even get my sound handles to respond at all, not even the master volume, so I'd say good luck with that.
Back to top
View user's profile Send private message
Lexikos



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

PostPosted: Wed Jan 30, 2008 1:34 am    Post subject: Reply with quote

Master volume is easy. Use Vista Audio/Volume Control Functions, or SoundSet/SoundGet + XP-compatibility mode.

the manual wrote:
On Windows Vista, SoundGet retrieves the script's own settings, not those of the active window. This may be resolved in a future version. To work around it, in the properties dialog for the file "AutoHotkey.exe" (or a compiled script), change the compatibility setting to "Windows XP".
Back to top
View user's profile Send private message
Democratus



Joined: 01 Sep 2007
Posts: 120

PostPosted: Wed Jan 30, 2008 2:53 am    Post subject: Reply with quote

Thanks. The only reason I hadn't researched the topic is due to the fact that I don't really need a volume control that much. However, I'm creating a media player that will be used by some Vista users, so I may have to implement such a feature after all.
However, it says that when you don't run in compatibility it still manipulates the volume for the macro, and I kind of like that idea (even though it was clearly and accident), but I don't notice a difference in volume when I use it in a script.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
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