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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-17-2003, 10:09 PM
|
#1
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Rep:
|
Audio conversion tools
Hello,
I am wondering if you all can give me some leads on good conversion tools. I don't care if they are cli or gui. What I need to do is change:
mp3 -> ogg
ogg -> wav (for burning)
unless someone knows of a tool that will convert ogg's on the fly while burning...My preference would be for a tool that allows me to convert a whole directory with one command.. so I can set it up and leave it.
TIA
|
|
|
01-18-2003, 01:02 AM
|
#2
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Original Poster
Rep:
|
Ok, well I got the ogg 2 wav, how about mp3 to ogg? Anyone?
|
|
|
01-18-2003, 02:36 AM
|
#3
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
Well, the tools I've seen that convert mp3 to ogg are usually 2 tools combined as one. It first requires turning the mp3 into a wav, then compressing it again with ogg.
mpg123 -w filename.wav filename.mp3 is how you get mp3 to wav (well 1 of many ways) and then oggenc would do the compression from wav to ogg.
There is talk about mp32ogg but I've not seen it work in practice, only in documentation. It seems to be part of the ogg packages, maybe I saw it over at www.vorbis.com
Good Luck
Cool
|
|
|
01-27-2003, 05:48 AM
|
#4
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Original Poster
Rep:
|
mp32ogg is a perl script that I tried but it broke on my machine (it never even got started). I figured I would write a quick and dirty shell script to do what I wanted. It works pretty good, with the same functionality as mp32ogg except it doesn't preserve id3 tags.
It will break if your mp3 filename has spaces or special characters in it. I am going to play around with it some more and try to add:
1. the ability to strip the '.mp3' suffix within the script
2. the ability to convert a whole directory in one shot
Hopefully someone might find this useful, and please keep in mind I'm not a programmer, so go easy on me...
I'm calling it MP32ogg until I think of a better name, of course, you can call it whatever you want.
Code:
#!/bin/bash
###############################################################################
# MP32ogg converts mp3 files to the free open source .ogg format. Ogg's are #
# about 20 - 25% smaller than mp3's, and I heard they sound better as well, #
# although I can't tell a difference with my shattered ears. Your mileage #
# may vary. This script basically converts the mp3's to wav's using mpg321 #
# then converts the wav's to ogg's using oggenc. Obviously you'll need both. #
# This script was written by Darren Kirby, linuxbot@shaw.ca #
###############################################################################
# Instructions: just type 'MP32ogg filename' where filename is the mp3 file #
# WITHOUT the '.mp3' suffix. So 'mysong.mp3' becomes 'mysong'. Have fun kids!#
###############################################################################
MINPARAMS=1
SONG=$1 # filename taken as shell parameter
# take the filename, add add appropriate suffixes for use in the script
SONGMP3=$SONG.mp3
SONGWAV=$SONG.wav
SONGOGG=$SONG.ogg
echo "$SONGMP3 will be converted to $SONGOGG"
echo
# converting mp3 to wav
echo "Currently converting mp3 to wav"
echo
mpg321 -w $SONGWAV $SONGMP3
echo
# converting wav to ogg
echo "Currently converting wav to ogg"
echo
oggenc $SONGWAV
# remove temporary wav (erase or comment the line if you want to keep it...)
rm $SONGWAV
# remove original mp3 (erase or comment the line if you want to keep it...)
rm $SONGMP3
# that's it...
echo "Done"
Last edited by bulliver; 01-27-2003 at 06:14 AM.
|
|
|
01-27-2003, 05:59 AM
|
#5
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
Got a suggestion for space names. I don't know jack about programming, but this would seem to be something easy for those who do.
Using something like awk you could convert spaces to underscores first. Then, go through the conversions, and prior to output convert the underscores back to spaces.
Also, check out jetblackz script for cdrecording, he does some mp3 conversion in there, this might help you with converting an entire directory:
http://jetblackz.freeservers.com/Installingcdcopy.html
Cool
|
|
|
01-28-2003, 11:36 PM
|
#6
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Original Poster
Rep:
|
Thanks MasterC,
That script worked perfect. I was able to pretty much cut and paste the relevant code into my script and simply change the variable names. I was able to figure out how it worked along the way too....
So I changed the name to dir2ogg, and rather than post it here I will direct interested people to my website
You can convert a whole directory OR just one file and you can use the full name (instead of dropping the ".mp3").
Thanks for the link...
|
|
|
01-29-2003, 03:46 AM
|
#7
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
You're welcome.  Maybe you and JBZ could get together and make an all out super burning wrapper!
Cool
|
|
|
03-31-2003, 07:08 PM
|
#8
|
Member
Registered: Feb 2003
Distribution: Mandy 9.1
Posts: 134
Rep:
|
Hey, what did you use for converting ogg to wav? I want to do this as well.
Actually, I see the option for it in Eroaster, but it won't actually let me add .ogg's to an audio CD (even though it even had a preference for "convert mp3/ogg to wav")
|
|
|
04-03-2003, 02:07 PM
|
#9
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Original Poster
Rep:
|
For ogg to wav you want to use ogg123 ie:
ogg123 -d wav -f song.wav song.ogg
which will convert song.ogg to to song.wav and leave the original. To do a directory at once you would use something like:
for i in *.ogg; do ogg123 -d wav -f `basename $i .ogg`.wav $i; done
|
|
|
All times are GMT -5. The time now is 12:52 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|