Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How do we set the volume via command line?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How do we set the volume via command line?
Authored by: chimerical on Apr 16, '09 06:04:02PM

How do we set the volume via command line?



[ Reply to This | # ]
How do we set the volume via command line?
Authored by: leamanc on Apr 16, '09 06:27:08PM

The only way I know of to do this is by calling AppleScript via the osascript command:

sudo osascript -e "set Volume 0"
sudo osascript -e "set Volume 10"

The first line will set your Mac's sound to mute. The last one represents maximum volume. You can use any whole number in between. I believe you can use decimals (i.e., 6.5) for finer-grained control also.



[ Reply to This | # ]
How do we set the volume via command line?
Authored by: henryhbk on Apr 17, '09 09:59:07AM

For ease you can create aliases:

alias full='sudo osascript -e "set Volume 4"'
(4 seems to max out our macs' volume)

For true hilarity, ssh into someone's mac, (assuming they aren't playing music) execute the above statement, then do :

say -v whisper "<insert funny whispered quote here>"

Sit back and watch the hilarity ensue. This works as the speaker is a shared resource between all jobs on the system, rather than the display which is not. So while you can't pop up things on the user's screen, feel free to have a mac talk to them.

---
Henry Feldman, MD
Medical Informatics
NYU School of Medicine



[ Reply to This | # ]
How do we set the volume via command line?
Authored by: chimerical on Apr 17, '09 11:34:45PM
http://xkcd.com/530

:)

also, thanks for the tips, guys!

[ Reply to This | # ]