Geek Posted December 7, 2010 Posted December 7, 2010 <div class="KonaBody"><p>You don’t need to use iTunes to play music on your Mac. Mac OS X comes with an included <a href="http://osxdaily.com/category/command-line/">command line</a> audio player that you can use to play most audio files with. In this example we’re going to use an MP3 file but you can also play AIFF, WAV, m4a, and more.</p> <p>Launch the Terminal and type the following command: <code>afplay audiofile.mp3</code> Obviously you need to replace audiofile.mp3 with your filename and path to that file. For reference, the path to your iTunes folder is: ~/Music/iTunes/iTunes Music/ and then you can use tab completion to select artist names quickly.</p> <p>Once the command is executed the audio file will start to play immediately, you can stop the audio from playing at any time by hitting Control+C within the Terminal window. </p> <p>You can also use the afplay command to play an audio file in the background simply by appending an ampersand to the end of the command, as shown: <code>afplay audiofile.mp3 &</code> Now the song will play within the background and does not require the Terminal window to stay open. The audio file will play until it’s over, otherwise you can type:<code>killall afplay</code> to stop the audio immediately.</p> <p>In the past I have combined this with the <a href="http://osxdaily.com/2010/03/28/how-to-make-your-mac-talk-text-to-speech/">text to speech</a> ’say’ command to play some amusing pranks on friends.</p> </div> <p><a href="http://feedads.g.doubleclick.net/~a/i6ewS9EoGTliURiE76E9Wm2RjPg/0/da"><img src="http://feedads.g.doubleclick.net/~a/i6ewS9EoGTliURiE76E9Wm2RjPg/0/di" border="0" ismap="true"></img></a><br/> <a href="http://feedads.g.doubleclick.net/~a/i6ewS9EoGTliURiE76E9Wm2RjPg/1/da"><img src="http://feedads.g.doubleclick.net/~a/i6ewS9EoGTliURiE76E9Wm2RjPg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare"> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=DbXZxxAXHrA:1yUetxONrwE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=DbXZxxAXHrA:1yUetxONrwE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=DbXZxxAXHrA:1yUetxONrwE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=DbXZxxAXHrA:1yUetxONrwE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=DbXZxxAXHrA:1yUetxONrwE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=DbXZxxAXHrA:1yUetxONrwE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=DbXZxxAXHrA:1yUetxONrwE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=qj6IDK7rITs" border="0"></img></a> </div><img src="http://feeds.feedburner.com/~r/osxdaily/~4/DbXZxxAXHrA" height="1" width="1"/> View the full article
Recommended Posts