If you don’t want to use iTunes to play MP3 files on your Mac, you can use the command line pointer on your Mac OS. This guide will help you to understand how to use the Command Line MP3 Player in Mac OS X.
You can also use the command line pointer to play other audio formats such as AIFF, WAV, m4a, and many others by using the afplay or open commands.
Playing MP3 Files on the Command Line in Mac OS
Open the afplay terminal (found in /Applications/Utilities/) and type the command:
afplay audiofile.mp3
Replace “audiofile.mp3” with the file name and path of the file you want to play. You can also use tab completion to quickly select artist names from the ~/Music/iTunes/iTunes Music/ folder.
For instance, to play a file that’s already in your iTunes library with afplay, use the following syntax, including the full path to the filename:
afplay ~/Music/iTunes/iTunes Music/Grateful Dead/Ripple-live.mp3
Afplay command works well, not only with mp3 files but with any other audio files that you point to. You can also use the ‘open’ command to launch a song on iTunes:
open /path/to/mp3file.mp3
This will launch the mp3 file type in the actual GUI application associated with it.
The audio file will start playing immediately, and you can stop playing the audio at any time by typing Control + C in the Terminal window.
Play Sound from the Command Line in Background
You can play audio files in the background by using the afplay command and simply adding an ampersand to the end of the command:
afplay audiofile.mp3 &
You can launch iTunes in the background from the ‘open’ command using the same character:
open /path/to/mp3file.mp3 &
The audio file is played until it finishes, and you can stop the sound immediately by typing:
killall afplay
or
killall iTunes
In the past, some have even consolidated this text to speech command into a fun way to play pranks on friends.
Benefits of Command Line MP3 Player in Mac OS X
- Free to access.
- Easy to follow and understand.
FAQs
Final Words
If you have any queries or questions regarding the Command Line MP3 Player in Mac OS X, you can directly reach out to us through the comment section or via our contact page. This guide is for educational purposes only. If you spot any inaccuracy or misinformation in this guide, please feel free to contact us. Also, please let us know if you want to add more methods to the Command Line MP3 Player in Mac OS X guide.