Back Forum Reply New

Sampling rate information in MP2

Anyone have an idea of where this is located?

This site will explain it: MPEG Audio Header

Thanks.

I've messed around a bit, but haven't successfully gotten a utility to do what I wanted... I was trying to make a simple patcher that will make a 44.1khz mpa look like a 48khz mpa to import into dvd authoring applications.. just to satisfy a curiosity of mine, anyone got such a thing already written?

you know that this will make your file unplayable right?

the samplerate is used in calculating the framelength of the current frame, which will give you the position of the next frame. if you change the samplerate the position of the next frame header won't be at that position and it's not possible to play the file... if you're going to do it there's no point in doing it for each frame, you might as well just do it on one of the frames (if you're loading into scenarist it probably won't load cause it scans through the files it adds)... and this can be done easily without making a program for it:

1. load your file in a hex editor
2. find the first byte with the value FF (usually byte no. 0) (this is the sync word) (use a file without any extra information in it, xing header, id3 v2.0 tag etc.)
3. step two bytes forward
4. take the value of that byte and convert it to binary. switch the bits so it becomes: xxxx01xx. just switch the two bits positioned two bits from the right with the value 01.
5. convert it back to hexadecimal and replace the value inside the file.this will make the first frame appear to be 48kHz. it now shouldn't be playable in any player because, first of all, the player can't correctly locate the frames, second, switching of samplerate is forbidden.

thinking of it; why don't you just convert it to 48kHz with LAME?

-Rune Svendsen

My idea was to change all of the frames to 48, import it into an authoring application, then before compiling the project, change all the frames back to 44.1... I didn't consider the fact that the framelength would be wrong...

Thanks for the input.

EDIT: I had transcribed the sample rates lol.

Actually.. couldn't you pad the data so that the frames realigned correctly? Then remove the padding when you changed it back to the 44.1?
¥
Back Forum Reply New