| View previous topic :: View next topic |
| Author |
Message |
Vrokolos Guest
|
Posted: Thu Mar 27, 2008 3:46 pm Post subject: switch between headphones <-> speakers |
|
|
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
|
Posted: Wed Apr 02, 2008 1:02 pm Post subject: |
|
|
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 |
|
 |
Vrokolos Guest
|
Posted: Wed Apr 02, 2008 3:02 pm Post subject: |
|
|
| 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
|
Posted: Wed Apr 02, 2008 3:06 pm Post subject: |
|
|
Would you be willing to share the source code?
 |
|
| Back to top |
|
 |
Vrokolos Guest
|
Posted: Wed Apr 02, 2008 4:02 pm Post subject: |
|
|
| Not yet. But i'm willing to create a dll for you to use. |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Wed Apr 02, 2008 5:03 pm Post subject: |
|
|
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
|
Posted: Wed Apr 02, 2008 5:11 pm Post subject: |
|
|
let me give it a try with autohotkey only then  |
|
| Back to top |
|
 |
Vrokolos
Joined: 02 Apr 2008 Posts: 4
|
Posted: Wed Apr 02, 2008 5:19 pm Post subject: |
|
|
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 |
|
 |
n-l-i-d Guest
|
Posted: Wed Apr 02, 2008 5:28 pm Post subject: |
|
|
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
|
Posted: Wed Apr 02, 2008 5:43 pm Post subject: |
|
|
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  _________________ http://vrokolos.blogspot.com |
|
| Back to top |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 408
|
Posted: Wed Apr 02, 2008 5:46 pm Post subject: |
|
|
| 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 |
|
 |
Vrokolos
Joined: 02 Apr 2008 Posts: 4
|
Posted: Wed Apr 02, 2008 5:51 pm Post subject: |
|
|
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  _________________ http://vrokolos.blogspot.com |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Wed Apr 02, 2008 5:54 pm Post subject: |
|
|
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
|
Posted: Wed Apr 02, 2008 5:56 pm Post subject: |
|
|
Ah!
 |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Apr 03, 2008 1:42 am Post subject: |
|
|
| Why bothered to access the managed codes? You can access (unmanaged) DirectSound directly from AutoHotkey. |
|
| Back to top |
|
 |
|