Skip navigation
This discussion is archived

Set audio in/output with shell command

1625 Views 2 Replies Latest reply: Aug 12, 2009 9:52 AM by Tohu RSS
Tohu Calculating status...
Currently Being Moderated
Aug 12, 2009 8:14 AM
I want to switch the systems audio input and output with a shell command. I've found a command that can set the volume. Maybe someone can tell me if this is possible and if so, which command i need.

osascript -e "set Volume 0"
Mac OS X (10.5.8), Allways got the latest updates installed.
  • SillyWilly Calculating status...
    Currently Being Moderated
    Aug 12, 2009 9:24 AM (in response to Tohu)
    I think there's a messy way of doing it in AppleScript by addressing the menus in the System Preferences. But if I were you I would have a look at the tool that someone has created here:

    It addresses CoreAudio directly I think to change the input/output method:

    will@Newton:~/Downloads/SwitchAudioSource-v1> ./SwitchAudioSource
    Please specify audio device.
    Usage: ./SwitchAudioSource [-a] [-c] [-t type] -s device_name
    -a : shows all devices
    -c : shows current device

    -t type : device type (input/output/system). Defaults to output.
    -s device_name : sets the audio device to the given device by name

    will@Newton:~/Downloads/SwitchAudioSource-v1> ./SwitchAudioSource -a
    Built-in Microphone (input)
    Built-in Input (input)
    Built-in Output (output)
    will@Newton:~/Downloads/SwitchAudioSource-v1> ./SwitchAudioSource -c
    Built-in Output
    will@Newton:~/Downloads/SwitchAudioSource-v1> ./SwitchAudioSource -t input -s 'Built-in Input'
    input audio device set to "Built-in Input"
    MacBook Air, Mac OS X (10.5.4)


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.