LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-04-2007, 06:49 AM   #1
mf5160
LQ Newbie
 
Registered: Oct 2006
Posts: 23

Rep: Reputation: 15
convert aif mp3


Hi,
Does anyone know of software that converts AIF to mp3 ?
Thanks
 
Old 02-04-2007, 09:49 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
ffmpeg can easily translate all kinds of multimedia files from one type to another. After installing it, simply open up a console, navigate to the directory with the files you want to process, and type:

Code:
ffmpeg -i inputfile.aif -f mp3 -ab 192 -ar 44100 outputfile.mp3
[-ab specifies the .mp3 bitrate you want. '-ar 44100' is the standard sample rate used in digital audio, just in case the input file is non-standard.]

To tag multiple files at once, you can use a "for" loop:

Code:
for file in *.aif ; do ffmpeg -i $file -f mp3 -ab 192 -ar 44100 $file.mp3 ; done
This will process every .aif file in the directory. Unfortunately, the input filenames will carry over as-is, giving you 'inputfile.aif.mp3' as your output file name. But you can easily fix the extension afterwards with the rename command:

Code:
rename s/.aif.mp3/.mp3/ *.aif.mp3
If anyone knows of a better way to take care of this, I'd like to know.

You'll have to use an external program such as audiotagtools to add the id3 tags to your finished files. One of the easiest ways to do that is to make sure your .mp3 file name includes all the info you want in the tags, something like "Pink_Floyd--Dark_Side_Of_The_Moon--05--Money.mp3", then use the "tag from file name" function to read that into the tags.
 
1 members found this post helpful.
Old 11-28-2008, 08:13 AM   #3
ancho
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
Thumbs down

Quote:
Originally Posted by David the H. View Post
If anyone knows of a better way to take care of this, I'd like to know.
Bash:

Code:
for file in *.aif ; do ffmpeg -i $file -f mp3 -ab 192 -ar 44100 ${file%.aif}.mp3 ; done
 
Old 02-16-2011, 09:26 AM   #4
Golf4Fun
LQ Newbie
 
Registered: Jan 2009
Posts: 16

Rep: Reputation: 0
Quote:
Originally Posted by ancho View Post
Bash:

Code:
for file in *.aif ; do ffmpeg -i $file -f mp3 -ab 192 -ar 44100 ${file%.aif}.mp3 ; done
You might get an error message by using the low audio bitrate - perhaps change 192 to 192k or a higher number.
 
Old 11-21-2013, 10:14 AM   #5
mrbrich
LQ Newbie
 
Registered: Nov 2013
Posts: 1

Rep: Reputation: Disabled
This won't work if there are spaces in the filename, I've found. You should put the file name in quotes. Also, the comment about the bitrate being 192k instead of 192 is correct, I think. You can also specify the audio codec (I've read that libmp3lame is good). So, the command should look like this:


Code:
for file in *.aif ; do ffmpeg -i "$file" -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 "${file%.aif}.mp3" ; done
 
  


Reply

Tags
convert, ffmpeg, mp3


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert mid to mp3 linuxmandrake Linux - Software 1 02-25-2006 09:42 AM
mp3 to wav convert shibainucan Suse/Novell 1 10-22-2004 10:46 AM
convert mp3 rosariowong Fedora 1 09-07-2004 01:24 PM
how to convert a wma to mp3?? yenonn Linux - General 2 04-26-2004 07:25 PM
how to convert cd to mp3 trutnev Linux - Software 7 04-19-2004 07:38 PM


All times are GMT -5. The time now is 01:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration