playing sound from command line

afflictedd2

Registered
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.
 
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.
 
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 "
 
Back
Top