2

Is there a way to limit the output format of a soundcard on OSX, apart from Audio MIDI Setup? I have noticed that OSX has a bad habit of resampling audio while it is not needed at all (say the output from Spotify or Tidal). I would like to systematically prevent such a thing from happenning, while still having a choice on the output format. The solution can use shell or Apple script, so that I can run it with a shortcut.

3
  • What makes you think Spotify [idk Tidal so can't comment] is sending you audio at 16-bit 44.1 in the first place? It seems like just an arbitrary figure, arrived at because that's what CDs are recorded at. So long as you're not decoding to 48k on a 44.1 stream, whether it is 16 or 24-bit should make no practical difference, except to provide better correction for rounding errors, which are bound to occur when decoding a lossy format.
    – Tetsujin
    Commented Nov 4, 2015 at 7:32
  • Tidal is lossless, and that does make a difference. The stream from Spotify and Tidal is 44.1/16. If you use Amarra for Tidal, for instance, it switches the DAC to 44.1/16 when you turn upsampling off. Resampling 44.1 to 48 does introduce some quantization artefacts. The problem is not resampling from 48 to 96 to 192 nor from 44.1 to 88.2. I wouldn't really bother with controlling that. The problem is when OSX resamples from 44.1x to 48x, and that does not sound right at all, specially given CoreAudio's default resampling quality. Commented Nov 4, 2015 at 16:30
  • OK, yup - I'm with you on 44.1/48 I always have to remember to swap over manually whether I'm working to picture or for 'CD' output…
    – Tetsujin
    Commented Nov 4, 2015 at 16:36

1 Answer 1

1

Here is an AppleScript that fixes the default audio format of the default output card before launching Spotify (tested on El Capitan only), but I prefer very much a solution that does not depend on GUI:

set desiredRate to "44100.0 Hz"
set desiredDepth to "2ch-16bit Integer"

tell application "Audio MIDI Setup" to activate
tell application "System Events"
    tell application process "Audio MIDI Setup"
        if not (window "Audio Devices" exists) then
            click menu item "Show Audio Devices" of menu "Window" of menu bar item "Window" of menu bar 1
        end if
        tell group 1 of tab group 1 of group 1 of splitter group 1 of window "Audio Devices"
            click button 1 of combo box 1
            select (text field 1 of list 1 of scroll area 1 of combo box 1 whose value is desiredRate)
            keystroke return
            click pop up button 2
            click menu item desiredDepth of menu 1 of pop up button 2
        end tell
    end tell
end tell
tell application "Audio MIDI Setup" to quit
tell application "Spotify" to activate

You must log in to answer this question.

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