While typing afplay danger.mp3 in the Terminal will play the .mp3, doing sudo afplay danger.mp3 or sudo su and then afplay danger.mp3 does not.

Any idea why is this? How can I use the afplay command with sudo/su?

  • Ok this is totally weird. I looked at the console app and when I "sudo afplay" I see this 7/29/12 7:29:52.567 PM coreaudiod[140]: 2012-07-29 07:29:52.566586 PM [AirPlay] Stopping endpoint 'Living Room Apple TV' 7/29/12 7:29:52.630 PM coreaudiod[140]: 2012-07-29 07:29:52.629656 PM [AirPlay] Disconnected from [fe80::5a55:caff:fe0e:8cba%en0]:49152 (from [fe80::223:dfff:fefd:b8b5%en0]:53791) 7/29/12 7:29:52.631 PM coreaudiod[140]: 2012-07-29 07:29:52.631078 PM [AirPlay] Stopped endpoint 'Living Room Apple TV' – Scott Walter Jul 30 '12 at 0:30
  • I don't see those entries in the console when I run afplay without sudo. Also I verified my sound is set to go to the internal speaker. FYI--I am using Mountain Lion – Scott Walter Jul 30 '12 at 0:31
  • 1
    Works for me with sudo for local sound output. Are you trying to play the sound over Airplay ? – Tyr Jul 30 '12 at 0:40
  • I'm not trying to but thats would it seems like its doing. I checked my system preferences and sound output it set to "Internal speakers" although I do see my two air play devices also listed. Its weird the problem only occurs when I run afplay as sudo or su – Scott Walter Jul 30 '12 at 0:58
  • 1
    I can't reproduce it either. Have you tried disabling the AirPlay devices? – Lri Jul 30 '12 at 13:23

You must log in to answer this question.

Browse other questions tagged .