or Connect
AppleInsider › Forums › General › Genius Bar › How to disable sound output through internal speakers
New Posts  All Forums:Forum Nav:

How to disable sound output through internal speakers

post #1 of 15
Thread Starter 
Does anyone know how to disable sound output through an iMac's internal speakers so that sound output is limited to the headphone jack? I muted the sound in system preferences so that you can only get sound through the jack, but the computers are un-muted by raising the volume.

Kids are constantly playing loud music in our computer labs (no matter how many times you tell them not to). The only thread that I found on this did not answer the question but rather concluded that you should make it a policy not to listen to music in the labs. While stating the obvious, this is not a technical solution to the problem. First, there are multiple labs and I can't be in all of them at the same time to enforce this, and second, enforcing this policy is tiring and I'd rather not have to deal with it.

Thanks.
post #2 of 15
One thing you could try, and I have not done this, is to install a driver for a sound card that doesn't exist. Then go into the sound options and choose the fake sound card as your output. Like I said if that doesn't work I haven't tried it, but it may be worth checking out. Good luck.
Don't click here, addictions may follow!

16GB iPhone 4 - Black
16GB iPad
2ghz Intel Macbook
1.6Ghz Intel Mini
Reply
Don't click here, addictions may follow!

16GB iPhone 4 - Black
16GB iPad
2ghz Intel Macbook
1.6Ghz Intel Mini
Reply
post #3 of 15
Quote:
Originally Posted by Neruda View Post

Does anyone know how to disable sound output through an iMac's external speakers so that sound output is limited to the headphone jack?

Remove the external speakers.
post #4 of 15
Thread Starter 
Quote:
Originally Posted by Taskiss View Post

Remove the external speakers.

Sorry. I meant internal speakers. Original message has been corrected.
post #5 of 15
Quote:
Originally Posted by Neruda View Post

Sorry. I meant internal speakers. Original message has been corrected.

Those should be easily disconnected also.
post #6 of 15
Thread Starter 
Quote:
Originally Posted by Taskiss View Post

Those should be easily disconnected also.

Not so easy to do on 60+ iMacs. Also, the external speakers do need to be used occasionally for classes, so disconnecting all of the internal speakers is not really a viable solution.
post #7 of 15
No temporary, easy solution will withstand the onerous onslaught of dedicated users.

You could possibly set up an expect script to establish a ssh session and use something like:

http://www.cs.cmu.edu/~rbd/doc/nyquist/part15.html

... to spam the systems with commands to turn off the sound.
post #8 of 15
Thread Starter 
Quote:
Originally Posted by Taskiss View Post

No temporary, easy solution will withstand the onerous onslaught of dedicated users.

The only option right now is to select the computers through Remote Desktop and sending the following unix command:

case "`uname -r`" in
7*) osascript -e 'set volume 0 with output muted' ;;
8*) osascript -e 'set volume output volume 50 with output muted' ;;
esac

That mutes the computer, but the user is able to increase the volume again immediately afterwards.

You'd think this would be a simple thing to do.
post #9 of 15
I have the same problem and would love to find a solution. I tell them ALL THE TIME to get headphones!

Let me know if you've found a solution.



Quote:
Originally Posted by Neruda View Post

The only option right now is to select the computers through Remote Desktop and sending the following unix command:

case "`uname -r`" in
7*) osascript -e 'set volume 0 with output muted' ;;
8*) osascript -e 'set volume output volume 50 with output muted' ;;
esac

That mutes the computer, but the user is able to increase the volume again immediately afterwards.

You'd think this would be a simple thing to do.
post #10 of 15
Have them use a restricted user account, and ban access to iTunes. Most kids won't bother to look for a way around this.
Apple Product Professional
Apple Certified Macintosh Technician
Reply
Apple Product Professional
Apple Certified Macintosh Technician
Reply
post #11 of 15
We use NetSupport 10 in our computer labs. When someone decides to ignore requests to use head phones I mute the sound from my station. The student can not activate the sound until I release it. Sadly, this mutes all users. Even students using headphones.
post #12 of 15
I had the same problem in my classroom. I modified an open source program to do just this. I wrote it 4 years ago and have used it in several labs.

It will turn down the volume on the internal speaker but allow for the use of the headphone jack.

Use this link to download the files and insructions. The source code is also included.

files.me.com/mcmick/d8iinj
post #13 of 15
Thread Starter 
Quote:
Originally Posted by mcmick View Post


files.me.com/mcmick/d8iinj


Wow. Can you provide a full link to this?

Thanks
post #14 of 15

I had a similar problem with the iMac computer labs that I manage. I searched and searched but didn't find anything so made my own solution. A launch daemon is used to run a script that continuously runs while the computer is on. This is what it does - 

 

Checks to see if the external speakers are selected for output

If so, it turns the volume to zero

Checks to see if system has been idle for whatever amount of time

Shuts down the computer if idle for whatever amount of time

 

When headphones are plugged in, the volume is not altered at all.

 

The site says I don't have permission to add attachments so here is the code for com.idle.restart.plist and idle.sh. If you want to recreate the files, use TextEdit. Make sure that it is set to plain text mode, copy the text below and use the correct extensions. It will try to put .txt by default but that will not work. I know it isn't a perfect solution but it does the job pretty well.

 

 

Quote: com.idle.restart.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.idle.restart</string>
    <key>OnDemand</key>
    <false/>
    <key>Program</key>
    <string>/Library/Management/idle.sh</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Library/Management/idle.sh</string>
    </array>
    <key>ServiceDescription</key>
    <string>Restarts the computer after it has been idle for 20 minutes</string>
</dict>
</plist>

 

Quote: idle.sh
#!/bin/sh
#infinite loop while system is on

#turn off speakers if enabled
while [ 1 ]
do
OUTPUT=`audiodevice output`

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

#idle reboot
idleTime=`ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print int($NF/1000000000); exit}'`

#If the idle time is more than x minutes (x*60 seconds) then restart the machine
if [ "$idleTime" -ge 1800 ]; then
INPUT=$( osascript \
-e 'tell application "System Events"' \
-e 'activate' \
-e 'set dialog_result to display dialog "Computer is idle and will restart soon" with title "Idle Computer" with icon caution buttons {"Continue Working"} default button 1 giving up after (60)' \
-e 'end tell' \
-e 'tell application "Terminal"' \
-e 'activate' \
-e 'end tell' \
-e 'get button returned of dialog_Result'
)

if [[ $INPUT != "Continue Working" ]]; then
shutdown -h now
fi
fi

# the longer the sleep time, the less cpu this will use. 3 seconds uses about 1% it seems
sleep 3
done
 

 

 

  1. Download "audiodevice" command line app from this site: http://whoshacks.blogspot.com/2009/01/change-audio-devices-via-shell-script.html
  2. Copy that command line app to a PATH directory (ie /bin/). Use terminal with root access.
  3. Place the com.idle.restart.plist file in /Library/LaunchDaemons.
  4. Make sure permissions for com.idle.restart are -rw-r--r-- (should be the same as the other permissions in that folder.) Also that the owner is root and group is wheel.
  5. Place idle.sh in /Library/Management

 

If you don't know how to do the file operations above, google it. Most of this you can easily do with the command line. If you don't want certain parts of the script to be active, just comment out the line(s) with a # symbol.

 

Hope it is useful to someone.


Edited by skier354 - 12/20/12 at 11:56am
post #15 of 15

This is an old post, but do you have the app to disable sound and does it work under OS 10.7? The IT department updated my lab to 10.7 from 10.6, even though I wanted to stay at 10.6, and a couple of things are "broken" that I'm tweaking. I'd used speakermute but that breaks under 10.7.

 

-Christopher

New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Genius Bar
AppleInsider › Forums › General › Genius Bar › How to disable sound output through internal speakers