LinuxQuestions.org
Review your favorite Linux distribution.
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 01-17-2003, 10:09 PM   #1
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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
 
Old 01-18-2003, 01:02 AM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760

Original Poster
Blog Entries: 4

Rep: Reputation: 78
Ok, well I got the ogg 2 wav, how about mp3 to ogg? Anyone?
 
Old 01-18-2003, 02:36 AM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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
 
Old 01-27-2003, 05:48 AM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760

Original Poster
Blog Entries: 4

Rep: Reputation: 78
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.
 
Old 01-27-2003, 05:59 AM   #5
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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
 
Old 01-28-2003, 11:36 PM   #6
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760

Original Poster
Blog Entries: 4

Rep: Reputation: 78
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...
 
Old 01-29-2003, 03:46 AM   #7
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
You're welcome. Maybe you and JBZ could get together and make an all out super burning wrapper!

Cool
 
Old 03-31-2003, 07:08 PM   #8
guitargeek
Member
 
Registered: Feb 2003
Distribution: Mandy 9.1
Posts: 134

Rep: Reputation: 15
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")
 
Old 04-03-2003, 02:07 PM   #9
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760

Original Poster
Blog Entries: 4

Rep: Reputation: 78
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
 
  


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
Audio Conversion: FLAC to WAV timswim78 Linux - Software 4 12-06-2017 06:12 PM
audio conversion problems,,, Armon Linux - General 4 06-13-2005 03:51 PM
Audio Editing and Video capture tools... redrobin77 SUSE / openSUSE 2 11-25-2004 06:58 AM
clustering audio conversion? e1000 Linux - Software 2 06-15-2004 06:33 PM
MS-SQL to MySQL Conversion Tools naeric Programming 1 10-12-2003 05:36 PM

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

All times are GMT -5. The time now is 05:44 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