LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   convert ogg to mp3 (https://www.linuxquestions.org/questions/linux-software-2/convert-ogg-to-mp3-306172/)

caleb star 03-26-2005 12:30 AM

convert ogg to mp3
 
What program can I use to convert ogg files to mp3, and where can I find it?

Thanx.

jschiwal 03-26-2005 12:45 AM

Try the 'sox' program. It may be on your installation disk.
Using it is easy. sox <filename.ogg> <filename.mp3>

Look at the info page because there are many options.

reddazz 03-26-2005 03:26 AM

There is a program called ogg2mp3.

UltimateZer0 03-27-2005 12:27 AM

I use a script that I wrote called oggbatch. It goes something like this

Code:

#!/bin/bash

oggdec *ogg
lame --preset 192 -ms -h *wav
rm -f *ogg
rm -f *wav
done

Hope this is helpful.

futhark 03-27-2005 04:56 PM

Is this a good idea? You're going to lose quality:
- You compress to mp3 and discard info in the process.
- By converting the mp3 to wav you don't lose anything.
- By converting the wav to ogg you lose some more.

I'm using ogg but I haven't tried to convert my mp3 library to that format. I only rip new cds into ogg.

n_hendrick 03-27-2005 05:01 PM

Everyone's always talking about xmms....try it, theres an option to change the input plug to LAME. You should be able to convert any audio file to mp3 within xmms. Thats what I do....but there are other open source techniques....

benjithegreat98 03-27-2005 08:13 PM

I would suggest the ogg2mp3 program that reddazz suggested because it keeps the id3 tags.

flickerfly 01-04-2007 07:38 AM

You may want to check out a program for your distro called soundconverter. There is another called soundconvert that is different. I've found it very useful in this sort of situation. Note though that converting lossy formats to lossy formats degrades the quality. If you could pull from the original media or some such lossless format instead you'd be in better shape.

miclem 01-04-2007 07:40 AM

K3B will also convert files well & quickly.

b0uncer 01-04-2007 07:59 AM

Generally it's stupid to convert a compressed format to another. Consider this: if you have the originals, as you should have if they're not illegal (and I'm not sure if web-bought mp3s or other formats can legally be re-coded), and then you should use those originals or if they're wavs, then encode them. If you don't have the originals, consider if the files are legal, and anyway recoding them means recompressing which means losing quality as said already. The quality on most mp3 and ogg files is already compressed so low that it's just enough for a person who likes music, and recoding it over and over again makes it sound dull. I suggest you take the original discs where the sound is uncompressed, and recode from them.

EDIT:
Quote:

K3B will also convert files well & quickly.
but only with a plugin; not all distributions ship with that plugin.

flickerfly 01-04-2007 08:28 AM

b0uncer, consider my situation where this process helpful and not illegal.

I have a collection of CDs ripped to ogg in another location. It took me many hours to convert them to ogg. This Christmas I received an MP3 player that doesn't support ogg so I'd like to have them in MP3 format. The CD media, because they take up space and are used infrequently are stored away in an inconvenient place. I can't access them at will. Until I can get them, it is helpful to simply convert what I need.

Next time I'm going to convert them to FLAC, a lossless format to remove this sort of hassle. (I hope).

ab1jx 04-22-2021 06:57 PM

Much of linux is about learning. This Bash looping technique is very useful

Code:

#!/bin/bash
for i in *.ogg; do
#    avconv -i "$i" -acodec libmp3lame -map_metadata 0:s:0 "${i:0:(-3)}mp3"
  sox $i $i.wav
done

I couldn't find a copy of avconv quickly, and sox wouldn't make mp3 files, so I converted the oggs to wav. I have another program that converts wav to mp3, it actually calls lame. The only problem with this is the naming, you end up with lots of file.ogg.wav. That stuff at the end of the avconv line is doing a substitution, I didn't notice it at first.

i loops through the filenames found by *.mp3, using $i gets the value of i.

TorC 04-22-2021 07:48 PM

+1 @flickerfly -- Next time I'm going to convert them to FLAC, a lossless format to remove this sort of hassle. (I hope).

There is also ffmpeg

WAV to FLAC https://superuser.com/questions/1145...flac-in-ffmpeg

ab1jx 04-22-2021 08:13 PM

MP3 is a compromise, I'm not sure if anything's smaller, AAC maybe. But MP3 mostly sounds good and saves space, I can rarely tell the difference. It's very easy to find things that play it. I have about 18,000 mp3 files in 133 GB. I convert stuff to mp3, I find a lot of flac files on bitterents and make them into mp3 with stuff I've put here: https://sourceforge.net/projects/mp3progs/files/. I don't deal with the actual sound data, it's all about maniuplating files. flac makes a wav file from a flac, lame makes an mp3 from a wav, I write stuff that does directories full at once. And them use this on my mp3 collection to play them with a web browser https://sourceforge.net/projects/cgi-jukebox/ My new hobby, working on a better version.


All times are GMT -5. The time now is 11:28 PM.