~~META:date created = 2009-06-19 16:17~~
====== Command Line Audio ======
===== Change Mac Audio Volume from Command Line =====
To change the audio volume from remote of my Mac at home, I needed a command line tool which I can use via ssh. I've found it here: [[http://osxdaily.com/2007/04/28/change-the-system-volume-from-the-command-line/|OS X Daily - Change the system volume from the command line]]. It's as easy as
sudo osascript -e "set Volume 10"
You can enter numbers from 0 (mute) to 10 (maximum).
===== Play Audio File =====
How to play an audio file from command line is described here: [[http://www.macosxhints.com/article.php?story=20081002080543392|macosxhints - Use a built-in command line audio player]]. You just enter
afplay file.wav
More information on how to use afplay is available via afplay -h.
{{tag>audio cli howto mac}}