
/audacity-open-5bc9e7ac46e0fb0051322806.png)
It is necessary to specify both the file format and the codec. The general format for the afconvert command is as follows:Īfconvert -f FORMAT -d CODEC SOURCEFILE

Control-click on the main folder and select New Terminal at Folder. To do this the easy way, open up the folder which contains the file you want to convert.
#CAN YOU CONVERT A WAV FILE FOR A MAC MAC#
Related: Fun and Cool Mac Terminal Commands to Try They are many complicated uses of this command, but we'll be focusing on simply converting one audio file format to another. The afconvert command allows you to do this. If you want to stop the audio playing after you've closed the window, you'll need to open up Terminal again and run a killall command to stop it:Īudio files can also be converted from one format to another from within Terminal. Related: The Mac Terminal Commands Cheat Sheet You'll find that the song will keep playing nevertheless. Select Terminate and the window will close. Once you close the window, you might get a warning that closing Terminal will terminate the afplay process. To do this, add & disown after the path to the audio file:Īfplay /Users/itechno8/Downloads/file.wav & disown You can also choose to close the Terminal window after starting a song this will keep the song playing in the background, but you need to change the command you use. Once a song starts, you can stop the afplay command by pressing Control + C. (To get the file path for any file, simply select the file in Finder and press Cmd + Option + C to copy it to your keyboard.)

To play an audio file from inside Terminal, run the afplay command followed by the path of the audio file you want to play.Īfplay /Users/itechno8/Downloads/file.wav There are commands that you can use to not only play audio files directly from inside Terminal, but to convert audio files as well.įirst, launch the Terminal app on your Mac from Applications > Utilities or from Spotlight. If you frequently find yourself working inside Terminal and want to play an audio file, there's no need to leave the app. The Terminal app is the gateway for command-line access in macOS.
