Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#73135 - 19/02/2002 12:02 Hacking mp3 files
Decca
new poster

Registered: 10/02/2002
Posts: 14
Loc: UK
When I ripped and encoded my CDs last year, I selected 96kbps so that I could fit as many as possible on a portable mp3 player.

I used lame and unfortunately set the sampling rate to 32khz rather than 44khz, because in my naivete, I assumed that I would get an equivalent encoding quality (albeit limited to a 16khz top end) to doing them at 128kbps and 44khz sampling. Of course, I now realise that lame defaults to a 15khz highpass filter anyway!

My problem is that 32khz sampling is none-standard and some players won't handle it. Fortunately the Empeg does, but Windows Media Player on a Pocket PC ignores such files.

After some experiments, it seems that there may be no difference whatsoever between files encoded at 96kbps\32khz sampling, and files encoded at 96kbps\44khz sampling. The file size is exactly the same to the byte.

I am wondering if there is any software that will process each frame in an mp3 file and convert the flag that specifies the sampling rate from 32 to 44, so that I wouldn't need to re-rip and re-encode all my cds. I am reasonably happy with the quality at 96kbs, as my ears are getting quite old now :-)
_________________________
Derek

Top
#73136 - 19/02/2002 12:16 Re: Hacking mp3 files [Re: Decca]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
This is an interesting question. I don't know if, within the MP3 itself, it matters what the sampling rate is. You could be right in that it might just be a tweak to a header byte.

I've found that if all you're doing is reading the headers of an MP3 file, and you don't care about the wave data stored in each frame, the coding to do modifications to those headers is rather trivial. My GapKiller program does it in slow-as-tar VB3 and has no trouble ripping through 100-meg MP3 files.

So if you're interested in coding something like this up, have a peek at the MP3 header specification here and see if you can see anything that might help.
_________________________
Tony Fabris

Top
#73137 - 19/02/2002 12:20 Re: Hacking mp3 files [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
Okay, I just re-read the specification, and the sampling rate is definitely a factor. It's not just twiddling a byte. At least it looks that way to me from my quick glance.

I think you're now into the realm of talking about SAMPLE RATE CONVERSION, which is a whole big can of worms unto itself. There are companies (high-end audio editing software) that actually have patented algorithms for sample rate conversion. It's not a simple thing to do correctly. You will lose some quality in the conversion, and you might want to avoid trying it, in favor of just going back to the original source material.
_________________________
Tony Fabris

Top
#73138 - 19/02/2002 12:32 Re: Hacking mp3 files [Re: tfabris]
Decca
new poster

Registered: 10/02/2002
Posts: 14
Loc: UK
Thanks Tony - looks like I'm up for a bunch of re-ripping then. Gives me a chance to go up to 128kbps, I suppose!

Incidentally, I can't post to this forum unless I disable my firewall - Norton Internet Security. I get the following message:
---------------------------------------------------
We cannot proceed.
We encountered a problem. The reason reported was:
The host you are trying to send the input from is not a valid host.
-----------------------------------------------------

Wierd

_________________________
Derek

Top
#73139 - 19/02/2002 12:35 Re: Hacking mp3 files [Re: Decca]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
I would recommend you go to 160kbps or above, and switch to an encoder that doesn't truncate your high frequencies.

The empeg car is a very high-end piece of audio gear, and you shouldn't feed it low-quality MP3 files.

More details in the FAQ here.
_________________________
Tony Fabris

Top
#73140 - 19/02/2002 13:44 Re: Hacking mp3 files [Re: tfabris]
rockstar
enthusiast

Registered: 24/11/2000
Posts: 316
so wait a sec, you are saying tha tlame truncates teh higher frequencies?

Top
#73141 - 19/02/2002 13:51 Re: Hacking mp3 files [Re: rockstar]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
By default, yes. You can turn it off, though.

I had missed in his original post that he'd used LAME anyway. So he doesn't have to switch to a different encoder, he just needs to make sure to get the latest version and then bump up the settings so that it makes better files.
_________________________
Tony Fabris

Top
#73142 - 20/02/2002 04:22 Re: Hacking mp3 files [Re: Decca]
tms13
old hand

Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
In reply to:

After some experiments, it seems that there may be no difference whatsoever between files encoded at 96kbps\32khz sampling, and files encoded at 96kbps\44khz sampling. The file size is exactly the same to the byte.


Yes, that's what constant bit-rate (CBR) encoding does - at a given bitrate (96kb/s in your case), you'll always get the same amount of output for a given playback time. The MP3 data will be vastly different, though (as it will between different quality/speed settings in lame).

If you re-encoded at 192kb/s, you'd find that your files would be twice the current size, whichever sample rate you have.
_________________________
Toby Speight
030103016 (80GB Mk2a, blue)
030102806 (0GB Mk2a, blue)

Top
#73143 - 20/02/2002 13:36 Re: Hacking mp3 files [Re: tfabris]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
    think you're now into the realm of talking about SAMPLE RATE CONVERSION ... You will lose some quality in the conversion
Don't forget that, in this case, the sample rate conversion has already happened once. CDs are encoded at 44.1kHz and having lame encode them at 32kHz means that lame performed it already. And I don't imagine that it has a very advanced algorithm for this. Changing back will put artifacts on top of artifacts.
_________________________
Bitt Faulk

Top