Search code examples
audiooperating-systemcpuaudio-capture

Is there a way to choose the audio port for a particular program in a cpu with two audio outputs?


I have two audio outputs in my cpu. One is meant for speakers and the other for headphones.I want to create a program in which I can choose which program is allowed to play sound in which port. So that I can put headphones in one port, and play something on the speaker connected to another port. Currently the speaker in back port goes off if I connect earphones to the other port.

PS : Don't really know which tags to choose for this. Please suggest the right tags.


Solution

  • I don't know what would be the correct final solution, haven't worked with the sound APIs involving other applications (manipulating sound output options of a 3rd party closed-source application) and I'm not sure if it is generally supported scenario. But some tips to get you started might be:

    • 1. web search queries - that is what I used to "quickly" find the other tips:
      • application specific audio output
      • windows open source application specific audio output
      • windows audio mixer api
      • open source configurable audio mixer for windows
    • MSDN: Windows → Dev Center - Desktop → Audio Mixer Reference - this is probably the basic stuff you should learn, but probably the most low-level with steep learning curve
    • Super User: Assigning programs to specific audio outputs in Windows 7 - this is probably some ready-to-buy solution
    • SoundSwitch - open source, something to study/tweak - "With SoundSwitch you just configure once between which Playback devices you want to toggle and then you can press Ctrl+Alt+F11 to toggle automatically"
    • JACK Audio Connection Kit - open source - "JACK on Windows is a multi-purpose application that connects audio and MIDI using the Windows system drivers... It connects (OUTPUT) to those audio drivers using the PortAudio project"