LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-19-2004, 05:38 AM   #1
kevinlux
LQ Newbie
 
Registered: Sep 2004
Posts: 5

Rep: Reputation: 0
encode multiples files with lame


I everyone,
here's my problem:
I want to enconde my mp3 files which have various bitrate (196,256,ecc) to 128.
I have put my mp3 in a new directory, and try with lame to encode with one command my mp3.
But lame accept only one files in input at time, if i try lame -b 128 * - (which mean : select all files and downsample to 128 bitrate and leave self name).
It does'nt works.
sorry for my enghlish
have a good time.
 
Old 09-19-2004, 06:02 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Haven't worked with lame myself, but if it only takes one infile at the time you might do something like this:

for THIS in *mp3
do
lame <whatever options> ${THIS}
done


$THIS holds the one filename that is processed and gives the file, one at the time, to lame untill all files are processed.

The above can be done from the command line. Just press enter/return after each line, after you press enter after entering done the process will start.

Like I stated before: I'm not a lame user, so you need to check that section of the above code.

Hope this helps.
 
Old 09-19-2004, 07:24 AM   #3
kevinlux
LQ Newbie
 
Registered: Sep 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by druuna
Haven't worked with lame myself, but if it only takes one infile at the time you might do something like this:

for THIS in *mp3
do
lame <whatever options> ${THIS}
done


$THIS holds the one filename that is processed and gives the file, one at the time, to lame untill all files are processed.

The above can be done from the command line. Just press enter/return after each line, after you press enter after entering done the process will start.

Like I stated before: I'm not a lame user, so you need to check that section of the above code.

Hope this helps.

Thanks a lot.
It work very fine
i have userd this code
Code:
for XX in *.mp3
do 
lame -b 128 $XX newdir/$XX
done
but a more little problem with spaces.
If in a directory there are only files without spaces it works very very fine.
If a file is called for example "Elvis Presley - Lame RoX.mp3" lame don't recognize correctly variable $XX infact for lame input file is "$XX=RoX.mp3" that doesn't exist and it fail!
how i can resolve this problem???
thanks a lot!!

Last edited by kevinlux; 09-19-2004 at 07:29 AM.
 
Old 09-19-2004, 08:04 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Spaces in filenames........

You could try something like this:
Code:
#!/bin/bash

find . -name "*mp3" | \
while read FILE
do
  lame -b 128 "$FILE" "$FILE.new"
done
Code might need some work (newdir/$FILE instead of $FILE.new), but I hope the working is clear.
 
Old 09-19-2004, 11:53 AM   #5
kevinlux
LQ Newbie
 
Registered: Sep 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by druuna
Spaces in filenames........

You could try something like this:
Code:
#!/bin/bash

find . -name "*mp3" | \
while read FILE
do
  lame -b 128 "$FILE" "$FILE.new"
done
Code might need some work (newdir/$FILE instead of $FILE.new), but I hope the working is clear.
works greatly...!!
Thanks a lot for your help!!!
 
  


Reply



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
Installing multiples linux OS pas Linux - Newbie 5 06-02-2005 11:27 PM
How to get sound juicer to encode mp3 files sirius57 Linux - Software 3 05-11-2005 01:48 AM
Split large file into multiples jdozarchuk Linux - Newbie 1 11-04-2004 09:42 AM
Encode .vob files into given space? jago25_98 Linux - Software 0 04-26-2004 07:43 AM
email sending multiples of all messages Michele Linux - Newbie 1 02-19-2001 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:58 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration