Ecco un AppleScript che corregge il formato audio predefinito della scheda di output predefinita prima di avviare Spotify (testato solo su El Capitan), ma preferisco una soluzione che non dipenda dalla 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