Hello,
I need more help please.
I'm trying to make my machine convert some .ogg files to mp3 using twolame (my distro doesn't have lame, only twolame) and I'm trying to do it like this :-
for t in {01..15}*.ogg; do twolame -b 320 $t $t.mp3; done
but it's failing with this message 'Usage: twolame [options] <infile> [outfile]'
All the filenames are like this '02 - I Close My Eyes And Count To Ten.ogg' with perhaps 15 or so tracks per folder.
In order to find my error, I tried this - for t in {01..15}*.ogg;do echo 'found tracks '$t;done and that lists all 15 tracks but despite hacking away for almost an hour, I can't persuade it to convert the files.
So what *should* I be typing to make this work?
On 24/04/14 12:21, Chris Walker wrote:
Hello,
I need more help please.
I'm trying to make my machine convert some .ogg files to mp3 using twolame (my distro doesn't have lame, only twolame) and I'm trying to do it like this :-
for t in {01..15}*.ogg; do twolame -b 320 $t $t.mp3; done
but it's failing with this message 'Usage: twolame [options] <infile> [outfile]'
All the filenames are like this '02 - I Close My Eyes And Count To Ten.ogg' with perhaps 15 or so tracks per folder.
In order to find my error, I tried this - for t in {01..15}*.ogg;do echo 'found tracks '$t;done and that lists all 15 tracks but despite hacking away for almost an hour, I can't persuade it to convert the files.
So what *should* I be typing to make this work?
Guessing here, but I think it's the spaces. If it's the spaces, you'll have to work out either a way to escape all of them with a "\ " (using sed perhaps?), or perhaps simpler, you may find that your distro accepts quotes.
Does for t in {01..15}*.ogg; do twolame -b 320 "$t" "$t.mp3"; done work? Alternatively, single quote ' or the character on the Pipe key, which I believe is called "tick" may work In theory, a "tick" follows this colon: `
HTH Steve
On Thu, 24 Apr 2014 13:34:21 +0100 steve-ALUG@hst.me.uk wrote:
On 24/04/14 12:21, Chris Walker wrote:
Hello,
I need more help please.
I'm trying to make my machine convert some .ogg files to mp3 using twolame (my distro doesn't have lame, only twolame) and I'm trying to do it like this :-
for t in {01..15}*.ogg; do twolame -b 320 $t $t.mp3; done
but it's failing with this message 'Usage: twolame [options] <infile> [outfile]'
All the filenames are like this '02 - I Close My Eyes And Count To Ten.ogg' with perhaps 15 or so tracks per folder.
In order to find my error, I tried this - for t in {01..15}*.ogg;do echo 'found tracks '$t;done and that lists all 15 tracks but despite hacking away for almost an hour, I can't persuade it to convert the files.
So what *should* I be typing to make this work?
Guessing here, but I think it's the spaces. If it's the spaces, you'll have to work out either a way to escape all of them with a "\ " (using sed perhaps?), or perhaps simpler, you may find that your distro accepts quotes.
Does for t in {01..15}*.ogg; do twolame -b 320 "$t" "$t.mp3"; done work?
Nope.
Input Filename: 01 - You Don't Have To Say You Love Me.ogg.mp3 Output Filename: 01 - You Don't Have To Say You Love Me.ogg.mp2 Failed to open input file (01 - You Don't Have To Say You Love Me.ogg.mp3): System error : No such file or directory.
Alternatively, single quote ' or the character on the Pipe key, which I believe is called "tick" may work
That didn't work either but with a different error :- bash: 02: command not found bash: 02: command not found twolame: option requires an argument -- 'b'
In theory, a "tick" follows this colon: `
It did :-)
On 24/04/14 14:26, Chris Walker wrote:
On Thu, 24 Apr 2014 13:34:21 +0100 steve-ALUG@hst.me.uk wrote:
On 24/04/14 12:21, Chris Walker wrote:
Hello,
I need more help please.
I'm trying to make my machine convert some .ogg files to mp3 using twolame (my distro doesn't have lame, only twolame) and I'm trying to do it like this :-
for t in {01..15}*.ogg; do twolame -b 320 $t $t.mp3; done
but it's failing with this message 'Usage: twolame [options] <infile> [outfile]'
All the filenames are like this '02 - I Close My Eyes And Count To Ten.ogg' with perhaps 15 or so tracks per folder.
In order to find my error, I tried this - for t in {01..15}*.ogg;do echo 'found tracks '$t;done and that lists all 15 tracks but despite hacking away for almost an hour, I can't persuade it to convert the files.
So what *should* I be typing to make this work?
Guessing here, but I think it's the spaces. If it's the spaces, you'll have to work out either a way to escape all of them with a "\ " (using sed perhaps?), or perhaps simpler, you may find that your distro accepts quotes.
Does for t in {01..15}*.ogg; do twolame -b 320 "$t" "$t.mp3"; done work?
Nope.
OK, you'll have to use SED then or something else. NB, you'll have to escape any spaces, and single quotes - that's probably why the single quote attempt failed. If you have any files with ? or * in and poss some other characters, you may have to escape them too. Good luck!
Or try Martijn's approach.
Steve
On Thu, Apr 24, 2014 at 02:32:31PM +0100, steve-ALUG@hst.me.uk wrote:
Does for t in {01..15}*.ogg; do twolame -b 320 "$t" "$t.mp3"; done work?
Nope.
OK, you'll have to use SED then or something else. NB, you'll have to escape any spaces, and single quotes - that's probably why the single quote attempt failed. If you have any files with ? or * in and poss some other characters, you may have to escape them too. Good luck!
Or try Martijn's approach.
Would it be possible to rename the files, then convert them, then rename them back? Try it out on one file first.
On Fri, 25 Apr 2014 11:27:31 +0100 Chris Green cl@isbd.net wrote:
On Thu, Apr 24, 2014 at 02:32:31PM +0100, steve-ALUG@hst.me.uk wrote:
Does for t in {01..15}*.ogg; do twolame -b 320 "$t" "$t.mp3"; done work?
Nope.
OK, you'll have to use SED then or something else. NB, you'll have to escape any spaces, and single quotes - that's probably why the single quote attempt failed. If you have any files with ? or * in and poss some other characters, you may have to escape them too. Good luck!
Or try Martijn's approach.
Would it be possible to rename the files, then convert them, then rename them back? Try it out on one file first.
By renaming, do you mean removing the spaces etc, in the filenames?
Yes that's possible. But Martin has sent me version of his command line which does it all. Like an idiot, I didn't send my reply to the list but direct to Martijn so people may not have seen his final version.
But it works very well. I've now finished ripping the latest crop of CDs (I want them as MP3 files to play from USB in my car) but I'm hopeful that when the time comes to do some more ripping, I can remember that I've stored the email to enable me to find it again.
Can I issue a public thank you to both Steve and Martijn for their help. I wouldn't have managed to do it however long I'd struggled.
On Fri, Apr 25, 2014 at 11:40:38AM +0100, Chris Walker wrote:
On Fri, 25 Apr 2014 11:27:31 +0100 Chris Green cl@isbd.net wrote:
On Thu, Apr 24, 2014 at 02:32:31PM +0100, steve-ALUG@hst.me.uk wrote:
Does for t in {01..15}*.ogg; do twolame -b 320 "$t" "$t.mp3"; done work?
Nope.
OK, you'll have to use SED then or something else. NB, you'll have to escape any spaces, and single quotes - that's probably why the single quote attempt failed. If you have any files with ? or * in and poss some other characters, you may have to escape them too. Good luck!
Or try Martijn's approach.
Would it be possible to rename the files, then convert them, then rename them back? Try it out on one file first.
By renaming, do you mean removing the spaces etc, in the filenames?
Yes, that's what I meant.
Yes that's possible. But Martin has sent me version of his command line which does it all. Like an idiot, I didn't send my reply to the list but direct to Martijn so people may not have seen his final version.
Excellent!
On 25/04/14 11:40, Chris Walker wrote:
Yes that's possible. But Martin has sent me version of his command line which does it all. Like an idiot, I didn't send my reply to the list but direct to Martijn so people may not have seen his final version. But it works very well.
[]
I can remember that I've stored the email to enable me to find it again. Can I issue a public thank you to both Steve and Martijn for their help. I wouldn't have managed to do it however long I'd struggled.
a) Glad you got it sorted and if I managed to help b) could you post the final version here if it's not here already? That way you'll be able to find it again, but also, if anyone googles for a similar problem, and finds this thread, they'll find the exact solution.
Happy ripping! :-)
Steve
On Sat, 26 Apr 2014 01:21:55 +0100 steve-ALUG@hst.me.uk wrote:
a) Glad you got it sorted and if I managed to help b) could you post the final version here if it's not here already? That way you'll be able to find it again, but also, if anyone googles for a similar problem, and finds this thread, they'll find the exact solution.
Sure. Here it is
for t in $(seq -f '%02.0f' 1 15); do f=`ls ${t}*.ogg`; if [ -f "$f" ]; then t=$(echo "$f" | sed 's/.ogg/.mp3/'); twolame -b 320 "$f" "$t"; fi; done
For any future seekers of information, all that has to be tweeked is the '1 15' bit to reflect the numbers of tracks you need to manipulate. It's also possible of course to substitute wav for ogg and so on.
Chris,
It isn’t the way you code, and it isn’t the way that you try, it isn’t the commands you say you run that makes twolame hate you so ... I close my eyes, and count to ten, but without leading zeros and when I open them I see missing quotes still here*
Try:
for t in $(seq -f '%02.0f' 1 15); do f=`ls ${t}*.ogg`; if [ -f "$f" ]; then twolame -b 320 "$f" "$f".mp3; fi; done
I haven’t got twolame around to test, but for example:
mak@crab cw $ touch '02 - I Close My Eyes And Count To Ten.ogg' mak@crab cw $ touch '03 - I Close My Eyes And Count To Eleven.ogg’ mak@crab cw $ for t in $(seq -f '%02.0f' 2 3); do f=`ls ${t}*.ogg`; if [ -f "$f" ]; then echo twolame -b 320 "$f" "$f".mp3; fi; done twolame -b 320 02 - I Close My Eyes And Count To Ten.ogg 02 - I Close My Eyes And Count To Ten.ogg.mp3 twolame -b 320 03 - I Close My Eyes And Count To Eleven.ogg 03 - I Close My Eyes And Count To Eleven.ogg.mp3
but I expect you also want to get rid of the “.ogg.mp3” from the result, so perhaps something like:
for t in $(seq -f '%02.0f' 1 15); do f=`ls ${t}*.ogg`; if [ -f "$f" ]; then t=$(echo "$f" | sed 's/.ogg/.mp3/'); echo twolame -b 320 "$f" "$t"; fi; done
— Martijn *) with apologies to Dusty Springfield
On 24 Apr 2014, at 12:21, Chris Walker alug_cdw@the-walker-household.co.uk wrote:
Hello,
I need more help please.
I'm trying to make my machine convert some .ogg files to mp3 using twolame (my distro doesn't have lame, only twolame) and I'm trying to do it like this :-
for t in {01..15}*.ogg; do twolame -b 320 $t $t.mp3; done
but it's failing with this message 'Usage: twolame [options] <infile> [outfile]'
All the filenames are like this '02 - I Close My Eyes And Count To Ten.ogg' with perhaps 15 or so tracks per folder.
In order to find my error, I tried this - for t in {01..15}*.ogg;do echo 'found tracks '$t;done and that lists all 15 tracks but despite hacking away for almost an hour, I can't persuade it to convert the files.
So what *should* I be typing to make this work?
-- __ __| |_ __ __ .----------------------------------------------. / _/ _` \ V V / | mailto:alug_cdw@the-walker-household.co.uk | ____,_|_/_/ |______________________________________________|
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!