# playing sound from command line



## afflictedd2 (Jan 5, 2011)

Hi everyone,

I need to play a sound from command line, but without actually opening itunes or any of the sort. Anyone know how to do this?

Ted.


----------



## artov (Jan 6, 2011)

Answer to the first part: "open" command handles most of audio files. I tried an .au file (from some Java program) and it played on QuickTime Player. A mp3 file was played on ITunes. But on both cases the file was played by the program.


----------



## HomelyPoet (Jan 10, 2012)

In Terminal:
afplay "/path/to/music/file/with.suffix"

Also, if you found the file in Spotlight~Finder, drag-and-drop into Terminal after typing "afplay "


----------

