Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: AIF to MP3 with sample rate conversion on Linux Command Line (Read 7206 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

AIF to MP3 with sample rate conversion on Linux Command Line

Okay,

On a linux box I want to go directly from AIF files to MP3 files with down conversion of sample rate and conversion to mono.

My normal LAME setting is:

lame -b 40 -m m --resample 22.05 -S infile outfile

With SOX I usually use:

sox infile.aif outfile.wav

I'd like to merge the two into one command line function for programatic reasons.

Something like:

sox  'infile.aif' - | lame -b 40 -m m --resample 22.05 -S - 'outfile.mp3'

But when I do, I get errors. With the '-' on the SOX side, I get "sox FAIL formats: can't determine type of `-' ". If I leave out the dash, I get "sox FAIL sox: Not enough input filenames specified"

I'm fairly new to SOX and LAME, so I'm sure I must be missing something simple. ?? or am I??

AIF to MP3 with sample rate conversion on Linux Command Line

Reply #1
While I'm just a Windows user, I don't think you're using sox correctly.

Try something like this:
sox -t aiff 'infile.aif' -t wav - | ...

AIF to MP3 with sample rate conversion on Linux Command Line

Reply #2
Try LAME compiled with libsndfile. It should read AIFF files (and it doesn't support pipes).

AIF to MP3 with sample rate conversion on Linux Command Line

Reply #3
While I'm just a Windows user, I don't think you're using sox correctly.

Try something like this:
sox -t aiff 'infile.aif' -t wav - | ...


Hey GreyNol,

You are TOP MAN. I have been scratching my head for a day or two with SOX and couldn't get the format right. You solved my problem!! MANY THANKS INDEED. The double -t option worked. Again thanks.

LOL being 'just' a Windows user - you should be promoted to Unix User!!

Azhar