Disabling Internal Audio

Cranappras
Release Candidate Programs Tester

I know that this question isn't directly related to Casper, but does anyone know of a way to disable the internal speakers on a system via a script or managed setting in Casper? I've been getting complaints from students that the noise levels in the computer labs are getting out of hand, so I'm trying to find a solution that forces the use of headphones without causing me a lot of grief in the process.

1 ACCEPTED SOLUTION

Nix4Life
Valued Contributor

These two Utilities allow control from the command line

I found two command line utilities to change output devices:

audiodevice

Examples: audiodevice output 'Line Out'

audiodevice output 'Digital Out'

SwitchAudioSource

Examples: SwitchAudioSource -s 'Built-in Line Output'

SwitchAudioSource -s 'Built-in Digital Output'

I use SwitchAudioSource to set HDMI defaults for new smartboards

View solution in original post

5 REPLIES 5

CypherCookie
Contributor

Hi,

I've had a similar request to change the default audio device on a set of MacPro's to use the lineout instead of the internal speaker.

We are using nothing but 10.8 machines so i do not know if this will apply to you or not.

What i have found is that the audio plist writes an entry for EACH user. I am looking at seeing if i can write a MCX for the default & current output device.

misterfriendly
New Contributor

Nix4Life
Valued Contributor

These two Utilities allow control from the command line

I found two command line utilities to change output devices:

audiodevice

Examples: audiodevice output 'Line Out'

audiodevice output 'Digital Out'

SwitchAudioSource

Examples: SwitchAudioSource -s 'Built-in Line Output'

SwitchAudioSource -s 'Built-in Digital Output'

I use SwitchAudioSource to set HDMI defaults for new smartboards

bradtchapman
Valued Contributor II

This is weird. How did a discussion from >2 years ago just get marked as solved today?

Also, it would be nice to have someone re-upload the scripts in question. They were covered in this blog post: http://whoshacks.blogspot.com/2009/01/change-audio-devices-via-shell-script.html

Cranappras
Release Candidate Programs Tester

@bradtchapman Here is the script that I ended up using with the utility. Since I don't want this running on an infinite loop, I have it in a policy that is triggered to execute upon check-in. As for why it was just marked, I was logged in and looking for something in an old thread, and noticed that I never marked the solution that I ended up going with in this one. Sorry for the confusion...

#!/bin/sh

# This is reliant on /bin/audiodevice

#http://forums.appleinsider.com/t/79221/how-to-disable-sound-output-through-internal-speakers

#http://whoshacks.blogspot.co.uk/2009/01/change-audio-devices-via-shell-script.html

#http://whosawhatsis.com/paraphernalia/audiodevice.zip

#infinite loop while system is on
# uncomment ## for loop
#turn off speakers if enabled


##while [ 1 ]
##do
OUTPUT=`audiodevice output`

if [ "$OUTPUT" = "Internal Speakers" ] ; then
osascript -e "set Volume 0"
fi
##done