Change the sound (or other) system settings in Mac OS X

I would like to be able to switch the sound source in Mac OS X without interacting with the GUI.

There are tools for controlling the sound output, such as SoundSource and applescript, to open the settings dialog .

What I'm looking for is what instantly switches preferences like SoundSource , but it should be scriptable . The goal is to switch between my digital and analog output with the click of a button. I have a helper application that will run a program or applescript on one click. All I need now is an application or application that quickly switches the sound source without any user interaction.

I am willing to write some Objective-C if that is what is required, but I am pretty much new to Cocoa development.

Do you have a one-click solution or can you give me a good guide on managing your sound system settings from a Cocoa application or command line?

EDIT . I created a command line application to do just that. You can download it at http://code.google.com/p/switchaudio-osx/downloads . Source code is also available on the project website.

+5
source share
2 answers

Do not think about it in terms of preferences; There is no centralized preference system for this. I believe that you need to use Core Audio to set properties kAudioHardwarePropertyDefaultOutputDeviceand kAudioHardwarePropertyDefaultSystemOutputDevice AudioSystemObject(using AudioHardwareSetProperty()).

+8
source

I created a command line application to do just that.

http://code.google.com/p/switchaudio-osx/downloads. .

UPDATE ( 2014 .): github - https://github.com/deweller/switchaudio-osx. .

+9

All Articles