49

Question broadened, as this still works in 2021

On previous versions of Mac OS X pressing ++volume+ would adjust the volume by quarter increments. This seems to have been removed in Lion.

Is there any way to do fine volume adjustment now?

3
  • 1
    as seen on SuperUser: superuser.com/questions/314661/…
    – ghoppe
    Commented Jul 29, 2011 at 0:29
  • I miss this feature. I can't imagine why they'd get rid of it. It was useful for brightness adjustment, too, although it never worked for keyboard backlight adjustment.
    – hairboat
    Commented Jul 29, 2011 at 0:41
  • I'm so confused. I'm on 10.7 (10.7.4, installed on a fresh 10.6), and option-shift-F11/F12 (volume keys) does indeed change volume in quarter-block increments.
    – Ken
    Commented May 26, 2012 at 16:12

7 Answers 7

22

++F11 and ++F12 were restored in 10.7.4.

22

You can do precise volume adjustment with AppleScript, controlled on a scale of 0 thru 100.

set volume output volume 0 --mute
set volume output volume 100 --100%
set volume output volume 27 --27%

You can get the current volume (also 0 thru 100):

set currentVolume to output volume of (get volume settings)

So, you can write a little script to increment the volume by 2% (approximately what one quarter square used to be):

set currentVolume to output volume of (get volume settings)
set volume output volume (currentVolume + 2)

You can make one for decrementing by changing that plus sign to a minus sign:

set currentVolume to output volume of (get volume settings)
set volume output volume (currentVolume - 2)

If you want to get the volume sound like usual, add the following line:

do shell script "afplay /System/Library/LoginPlugins/BezelServices.loginPlugin/Contents/Resources/volume.aiff"

You can save this as a script or app, and bind it to a mouse or keyboard button (if your driver lets you), give it a keyboard shortcut (as a Service or with another app), or put it in your menu bar (with an app like FastScripts).

2
  • 2
    I ended up binding these scripts to F11 and F12, so that fine volume adjust is now fn+volume+ using Quicksilver. (thanks to this answer and Jurawa's). Next step is to fake the bezel window.
    – cobbal
    Commented Aug 2, 2011 at 18:39
  • 1
    How do I set volume above original? (as VLC does)
    – Davi Lima
    Commented Jul 22, 2015 at 11:13
7

I don't have a keyboard shortcut or AppleScript for you, but I did notice - and others seem to confirm - that the slider you can use when you click the volume icon in the menu bar moves much more smoothly in Lion than it did in previous versions of OS X. As I recall it used to sort of jump from level to level, sort of like how it did when you pushed the volume buttons on the keyboard. Now it slides easily between increments.

6

I don't have enough reputation or else I would have entered this as a comment to Nathan Greenstein's answer.

I turned his information into a simple command line script to adjust the volume:

#!/bin/bash

usage()
{
    echo 1>&2 "Usage:" "$0" "[relative volume change in the range -100..100 (default -2)]"
    exit -1
}

case $# in
    0)
        VOLCHANGE=-2
        ;;
    1)
        VOLCHANGE=$1
        ;;
    *)
        usage
        ;;
esac

## Check the VOLCHANGE parameter.
if ! ( echo "${VOLCHANGE}" | egrep '^-?[0-9]+$' > /dev/null )
then
    echo 1>&2 "ERROR: Bad volume adjustment parameter:" "${VOLCHANGE}"
    usage
fi

osascript -e "set volume output volume ((output volume of (get volume settings)) + ${VOLCHANGE})"

echo "New volume:" $(osascript -e 'output volume of (get volume settings)') "(adjusted by ${VOLCHANGE})"
2
  • :) I saw the top answer and was just about to do this
    – Xster
    Commented Jan 24, 2012 at 21:07
  • 1
    set volume actually accepts floating points numbers between 0 and 100. The smallest actual adjustment value seems to vary between systems. See this answer and its comments to this question about the lowest possible volume achievable. The docs only state support for a range of 0-100. Use this regex to accept floats '^-?\d*\.?\d*$'.
    – pkfm
    Commented Aug 11, 2019 at 6:15
2

To get much finer sound volume control I use soundflower from http://code.google.com/p/soundflower/. You have to restart after installing it. Then go to preferences/sound/output and choose soundflower(2ch). Start soundflower from the applications folder, click on the flower symbol in the top pannel and soundflower(2ch) built in output. Then go to Audio setup and change the master for soundflower(2ch). This way you can get the global sound less loud or you can amplify it.

2
  • A caveat on Soundflower - it is getting more & more broken since Mavericks & causes kernel panics on Yosemite. It is no longer supported by either Cycling74 or Rogue Amoeba. Current repo is here - github.com/RogueAmoeba/Soundflower but hasn't seen an update in a long time.
    – Tetsujin
    Commented Oct 8, 2015 at 6:19
  • Note for 2021 - Soundflower was taken over by Matt Ingalls - github.com/mattingalls/Soundflower - I haven't used it in a decade so idk its current behaviour.
    – Tetsujin
    Commented Jun 15, 2021 at 11:41
2

There's also a way to make the volume decrease in 1/4 steps by default. There's a tool you can install called Karabiner, and it already has this logic built in.

So just install it, open the preferences, search for fine grained volume controls, click it, and bam! It just works. What's great is that it switches it so the typical fine-grained keyboard command is now used for large volume steps, and just pressing the volume key will increase/decrease it by a 1/4 step.

https://pqrs.org/osx/karabiner/index.html.en

-1

You can also change the output volume exactly as a percentage (for example 20%) with the terminal via Apple Script.

osascript -e 'set volume output volume 20'
1
  • 2
    How does this improve on other answers and answer the question? The user wants to kinow what to press when in the GUI - this answer might be better linked / suited in apple.stackexchange.com/a/36663/237 which has much more detail.
    – mmmmmm
    Commented Jun 6, 2021 at 16:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .