I have a similar problem. When we figure it out -- lets share. Mine has to do with making a little frontend to my mp3 player's interface. I hate typing all the crap in. Make a little script that handles it all.....
ok - it works nicely if i don't have mp3s with spaces in the name, if i hvve spaces in the name then it no worky...
Code:#!/bin/bash for i in `ls *.mp3` do mpg123 -w "$i".wav "@i" oggenc -q 7 -t "$i".wav rm "$i".wav done
I have a similar problem. When we figure it out -- lets share. Mine has to do with making a little frontend to my mp3 player's interface. I hate typing all the crap in. Make a little script that handles it all.....
sounds groovy! i was hoping the quote marks would help, but no luck.
How about:
Code:#!/bin/bash for i in `ls *.mp3` do mpg123 -w "\"$i.wav\"" "\"@i\"" oggenc -q 7 -t "\"$i.wav\"" rm "\"$i.wav\"" done
hum - no dice...
also it should read
$i, not @i in the mpg123 line...
now this method is truely bad bad bad.Code:#!/bin/bash for i in `ls *.mp3` do mpg123 -w "$i".wav "$i" oggenc "$i".wav rm "$i".wav done
my ogg files will wind up being named filename.mp3.ogg - anyone with a btter idea but not simply converting an mp3 to ogg with the perl method please let me know. i would like this to be as lossless as possible
[quote author=pbharris link=board=9;threadid=4424;start=0#44031 date=1028159484]
anyone with a btter idea but not simply converting an mp3 to ogg with the perl method please let me know. i would like this to be as lossless as possible
[/quote]
actually, if ur talking about the MP3::Info perl module that a lot of scripts use, it won't lose more quality than the way u are doing it now... in fact, most scripts do it the exact same way as u do except that they use that perl module so the ID3 tag of the mp3 gets converted to ogg vorbis headers (i'm not sure if it's called headers in ogg, but i thought i read it somewhere).
oh, and the problem with spaces in the names, i had that too... turned out to be a problem with mpg123 as it can't handle spaces in the names. i'm affraid ur gonna have to rename ur files so they don't have spaces in them.
[quote author=pbharris link=board=9;threadid=4424;start=0#44031 date=1028159484][/quote]Code:#!/bin/bash for i in `ls *.mp3` do mpg123 -w "$i".wav "$i" oggenc "$i".wav rm "$i".wav done
Well, the first problem I see here is `ls *.mp3`. If you have spaces in your filenames, then your $i variable will be set to all the different fragments of the filenames, so you lose right from the get-go.
I'm a little rusty with my bash (I use perl for everything), but I believe that for i in *.mp3 will work as expected.
Also, to fix your naming problems, you'll want to remove the .mp3 from the filename. Ultimately, you'll want something like this:
This should work fine. I haven't had to convert mp3s in a long time, but it looks much like the script that I used (as far as I can remember it). The end result is that "filename.mp3" is converted into "filename.wav", which is then converted into "filename.ogg".Code:#!/bin/bash for i in *.mp3 do name=$(echo $i|sed 's/\.mp3$//') mpg123 -w "$name.wav" "$i" oggenc "$name.wav" rm "$name.wav" done
Also, if all of your files are named in a consistent manner (as in "Artist - Title.mp3", then I have something that will ease the transition to ogg: a script that will auto matically fill in the ogg "headers" with info that it finds in the filename. By default, it looks for "Artist - Title.mp3", but this is easily overrided. You can get it from here. Then you won't need the MP3::Info thing that ralinx is talking about to preserve your ID3 tags in the oggs.
![]()
hmm .. maybe a little OT, but if i convert my mp3s to oggs wouldnt i loose quality ?
[quote author=ch-b link=board=9;threadid=4424;start=0#44081 date=1028192425]
hmm .. maybe a little OT, but if i convert my mp3s to oggs wouldnt i loose quality ?
[/quote]
technically, yes
i converted all of my mp3s to ogg using -q5 for quality and i don't notice any difference whatsoever, except that all the files are smaller than the original mp3s
it helped me save 3.2 gigs in total
[quote author=Ralinx link=board=9;threadid=4424;start=0#44082 date=1028194209]
technically, yes
i converted all of my mp3s to ogg using -q5 for quality and i don't notice any difference whatsoever, except that all the files are smaller than the original mp3s
it helped me save 3.2 gigs in total
[/quote]
thx - if ill get the ogg packages to compile ill conver them ..
Bookmarks