tags:

views:

53

answers:

2

Is there a way in windows by which I can toggle the audio output between a built-in speaker and the headphone jack using a python library.

I am thinking someone with .NET experience would be able to give me some pointers (I could use IronPython if there is a .NET library to do that).

I have no idea where to start. Any hints would help. Thanks a lot.

A: 

The device selected for output in the Control Panel is just a default, each application can choose to output through that device or select a new one. You can get a handle to the device you want to output through, and subsequently use it for playback, by using the Win32 API for multimedia (winmm.dll). Some of those functions are on this page: http://msdn.microsoft.com/en-us/library/dd743586%28VS.85%29.aspx

I'm not aware of any standard .Net assemblies that provide this functionality, but I'm admittedly in unfamiliar territory on this one.

Jacob Ewald