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 

switch between headphones <-> speakers
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources
View previous topic :: View next topic  
Author Message
Vrokolos
Guest





PostPosted: Thu Mar 27, 2008 3:46 pm    Post subject: switch between headphones <-> speakers Reply with quote

I made a program that can switch between speaker modes using the command line so you can use it in scripts.



Here it is: speakersetup
Back to top
wtg



Joined: 04 Oct 2006
Posts: 57
Location: Louisville, KY

PostPosted: Wed Apr 02, 2008 1:02 pm    Post subject: Reply with quote

Thanks for sharing that Vrokolos... I've been looking for a way to do exactly that.

Originally I was hoping to do it via an AutoHotkey script but the speaker setting doesn't appear to be accessible via the built-in sound support. Or at least didn't - I haven't looked for a while. Do you mind sharing what dll and function call you're using to change the setting?

Thanks again!
Back to top
View user's profile Send private message
Vrokolos
Guest





PostPosted: Wed Apr 02, 2008 3:02 pm    Post subject: Reply with quote

I use managed directsound. I don't think autohotkey can access it directly. Might be wrong though!
Back to top
n-l-i-d
Guest





PostPosted: Wed Apr 02, 2008 3:06 pm    Post subject: Reply with quote

Would you be willing to share the source code?

Cool
Back to top
Vrokolos
Guest





PostPosted: Wed Apr 02, 2008 4:02 pm    Post subject: Reply with quote

Not yet. But i'm willing to create a dll for you to use.
Back to top
n-l-i-d
Guest





PostPosted: Wed Apr 02, 2008 5:03 pm    Post subject: Reply with quote

k.

Would be nice to have a DLL too, but not absolutely necessary, the CLI version is fine as is... But sure, maybe others would like to have a DLL version.

I'm simply curious if this could be done with AHK-only...
Back to top
Vrokolos
Guest





PostPosted: Wed Apr 02, 2008 5:11 pm    Post subject: Reply with quote

let me give it a try with autohotkey only then Smile
Back to top
Vrokolos



Joined: 02 Apr 2008
Posts: 4

PostPosted: Wed Apr 02, 2008 5:19 pm    Post subject: Reply with quote

Can you create a complex object in AHK? This can't be done with just basic types like strings and ints. You need to create objects for devices and speakers and pass those objects to directsound.
_________________
http://vrokolos.blogspot.com
Back to top
View user's profile Send private message
n-l-i-d
Guest





PostPosted: Wed Apr 02, 2008 5:28 pm    Post subject: Reply with quote

I have no clue...

If the "complex object" you are talking about is a COM object, you might be able to use the COM lib for it.
Back to top
Vrokolos



Joined: 02 Apr 2008
Posts: 4

PostPosted: Wed Apr 02, 2008 5:43 pm    Post subject: Reply with quote

I'm pretty sure autohotkey can't make calls to managed dll assemblies using complex types as parameters. What you might want to do is research on how to do what I did using plain old directsound dlls and not the managed ones, for which I really have not clue where to start Smile
_________________
http://vrokolos.blogspot.com
Back to top
View user's profile Send private message
Oberon



Joined: 18 Feb 2008
Posts: 408

PostPosted: Wed Apr 02, 2008 5:46 pm    Post subject: Reply with quote

Vrokolos wrote:
I'm pretty sure autohotkey can't make calls to managed dll assemblies using complex types as parameters.
Yes it can. You don't even need to export your CLR as a COM-aware DLL. How has been discussed on the forum...
_________________
Back to top
View user's profile Send private message
Vrokolos



Joined: 02 Apr 2008
Posts: 4

PostPosted: Wed Apr 02, 2008 5:51 pm    Post subject: Reply with quote

Oops sorry didn't see that before. Well then it should be possible.. Let me try to create a script for it in the next few days. I'll report back Smile
_________________
http://vrokolos.blogspot.com
Back to top
View user's profile Send private message
n-l-i-d
Guest





PostPosted: Wed Apr 02, 2008 5:54 pm    Post subject: Reply with quote

Well, I'm not the right person to ask these questions. All I can say is that AHK does support creating structures (if that equals the complex types you are referencing to).

HTH
Back to top
n-l-i-d
Guest





PostPosted: Wed Apr 02, 2008 5:56 pm    Post subject: Reply with quote

Ah!

Cool
Back to top
Guest






PostPosted: Thu Apr 03, 2008 1:42 am    Post subject: Reply with quote

Why bothered to access the managed codes? You can access (unmanaged) DirectSound directly from AutoHotkey.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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