Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Changing an MP3's sample playback rate (Read 5780 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Changing an MP3's sample playback rate

I have obtained a MP3 file which specifies a 48000 sample rate. The correct sample rate, however, is obviously 44100. Is there any way I can change this without re-encoding the MP3? I've tried opening the file in a hex editor but can't make anything out besides the comment and mp3DirectCut doesn't appear to have that feature.
Project Leader of DDResampled

Changing an MP3's sample playback rate

Reply #1
I have obtained a MP3 file which specifies a 48000 sample rate. The correct sample rate, however, is obviously 44100. Is there any way I can change this without re-encoding the MP3? I've tried opening the file in a hex editor but can't make anything out besides the comment and mp3DirectCut doesn't appear to have that feature.
What do you mean "the correct sample rate, however, is obviously 44100"?  How do you know the source content wasn't 48 kHz or upsampled to 48 kHz before encoding to MP3?

Changing an MP3's sample playback rate

Reply #2
Because the Flash applet that plays the mp3 on the particular website where this mp3 was obtained does so at a playback rate of 44100. It's pretty easy to tell the difference between an audio file played back at a 48000 sample rate and it played back at a 44100 sample rate.

It's funny that you point that out, though. After some investigation, it seems that the track should indeed be played bak at 48 khz. But I like the 44.1 method better.

The question still stands.
Project Leader of DDResampled

Changing an MP3's sample playback rate

Reply #3
You have to change the 32-Bit sync-code of every frameheader. I don't know of any programm that can do this.
but it would be easy to code.

Changing an MP3's sample playback rate

Reply #4
I don't think so because frame lenghts (the bitrate index)  would be completely off... unless you can pad the frames without trouble that is.
"We cannot win against obsession. They care, we don't. They win."

Changing an MP3's sample playback rate

Reply #5
even if you repackage the data into 44 kHz frames properly it won't work because a decoder treats the data within frames at different sampling rates differently. (For you technical people: The partition of the spectral lines into scalefactor bands depends on the sampling rate)

However you could try to wrap the MP3 into a WAV file and change the WAV file's sampling rate. Depending on your player it might actually use the sampling rate of the Wav-Header -- It used to work with WinAMP, once (a couple of years ago).

Sebastian

Changing an MP3's sample playback rate

Reply #6
even if you repackage the data into 44 kHz frames properly it won't work because a decoder treats the data within frames at different sampling rates differently.

I kind of expected this.

However you could try to wrap the MP3 into a WAV file and change the WAV file's sampling rate.

I was hoping I wouldn't have to do something like this, but it would work. Thanks!
Project Leader of DDResampled

Changing an MP3's sample playback rate

Reply #7
Does it really matter what rate it is? If it needs downsampling won't the program do that automatically?

Changing an MP3's sample playback rate

Reply #8
If it needs downsampling won't the program do that automatically?


I'm not sure where you're going with this.

BTW, SebastianG's idea works, albeit seeking glitches occur, with foobar2000. Unfortunately, WAV files cannot be ReplayGained.
Project Leader of DDResampled