Page 1 of 2

Copy and pasting MP3 files will result in pitch change

Posted: Thu Dec 02, 2010 2:40 am
by tablo
I make clean versions of songs by pasting instrumentals to songs. When I try to do it with files that was originally a MP3 file, the pasted portion's pitch will get messed up. I tried making a copy of the files in a M4A, FLAC, and WAV file with empty metadata, but it still gets messed up. What is the problem? I have Audacity 1.3.12.

Re: Copy and pasting MP3 files will result in pitch change

Posted: Thu Dec 02, 2010 8:08 am
by steve
Your description sounds just like a common problem that there was in Audacity 1.2 due to its inability to support multiple sample rates in the same track, but that does not apply to any version of Audacity 1.3.x and certainly not to 1.3.12 so I'm totally confused about what you mean.

Just in case you have a rogue version of Audacity installed, could you look in "Help menu > About Audacity" and give the exact "version name and number" from the first tab and include the "build information" from the bottom of the second tab.

I think it's most likely that I am just misunderstanding what you mean, so could you give a step-by-step method of how we may reproduce the problem.
By how much is the pitch being messed up, and in what way?

Re: Copy and pasting MP3 files will result in pitch change

Posted: Fri Dec 03, 2010 5:01 am
by tablo
Features
Nyquist
(Plug-in support)
Enabled
LADSPA
(Plug-in support)
Enabled
Vamp
(Plug-in support)
Enabled
Audio Units
(Plug-in support)
Disabled
PortMixer
(Sound card mixer support)
Enabled
SoundTouch
(Pitch and Tempo Change support)
Enabled
Audacity ® 1.3.12-beta (Unicode), the pitch is anywhere from 5 to 10%, up or down. To reproduce this problem, copy a portion from one file and paste that to another file open, if one file is MP3 the speed will get messed up.

Re: Copy and pasting MP3 files will result in pitch change

Posted: Fri Dec 03, 2010 1:09 pm
by steve
Here's my steps to try and reproduce the problem.

Audacity 1.3.12 Build: Sep 22 2010 Build type: Release build

Edit menu > Preferences > Quality >>
default sample = 44100
default sample format = 32 bit float.

File menu > Import > Audio -- Import a stereo MP3 file -- file imports to Track 1 as a stereo track, 44100 Hz 32 bit float.
Check that track plays correctly -- yes it does.

File menu > Import > Audio -- Import a stereo 16 bit WAV file -- file imports to Track 2 as a stereo track, 44100 Hz 32 bit float.
Check that both tracks play correctly -- yes they do.

Select part of track 1,
Edit menu > Copy

Click in track 2
Edit menu > Paste -- selection from track 1 is inserted into track 2
Check that it still plays correctly -- yes it does.

So what are you doing different, or what happens that is different?

Re: Copy and pasting MP3 files will result in pitch change

Posted: Sat Dec 04, 2010 12:44 am
by tablo
Okay, I noticed that it does that when the sample rate is different. It is okay when I export one file to the same sample rate as the other.

Re: Copy and pasting MP3 files will result in pitch change

Posted: Sat Dec 04, 2010 11:10 am
by steve
tablo wrote:I noticed that it does that when the sample rate is different.
That is the expected behaviour in Audacity 1.2 but it should not happen in Audacity 1.3

Could you look in "Edit > Preferences > Quality" and say what the settings are.

Re: Copy and pasting MP3 files will result in pitch change

Posted: Mon Dec 06, 2010 12:41 am
by tablo
44100 Hz, 32-bit float, Fast Sinc Interpolation, None, High-Quality Sinc Interpolation, Shaped

Re: Copy and pasting MP3 files will result in pitch change

Posted: Mon Dec 06, 2010 5:33 pm
by steve
Sorry, as far as I can tell your Audacity installation look fine. This problem should not be able to occur and I've no idea why or how it is happening.
I'll ask for a second opinion on this because I'm drawing a blank.

Re: Copy and pasting MP3 files will result in pitch change

Posted: Mon Dec 06, 2010 9:48 pm
by Gale Andrews
Tablo, thanks for the report.

Yes the issue is there in 1.3.13 Unicode on Win XP would you believe. Just import a 44100 Hz 16-bit WAV, then a 48000 Hz 16-bit WAV, and cut or copy and paste from the 44100 into the 48000 Hz.

I thought we might have broken this when we fixed all those problems in 1.3.9 with "Playing, rendering or exporting multiple tracks led to desynchronized playback or loss of audio data" (which were mainly about track sample rate differences). However I can reproduce this from 1.3.7 onwards. The only other 1.3 version I have to hand (1.3.3) does not have the problem. Also the problem does not occur in 1.3.13 if you paste at the start or end of the track. I'll raise a P2 when I can figure which version it broke in.

Tablo, to workaround it, look in the track you are cutting or copying from, above the Mute / Solo buttons - you will see a number and Hz, such as "44100 Hz". Make a note of that number. Now click in that same area above the Mute / Solo buttons in the track you are pasting into in order to select that track. Now click Tracks > Resample and choose the rate you noted in the track you were cutting/copying from. If you don't see that rate in the list, just type in the rate you want. Then click OK. Problem should be gone now.



Gale

Re: Copy and pasting MP3 files will result in pitch change

Posted: Mon Dec 06, 2010 10:22 pm
by billw58
Gale Andrews wrote:Just import a 44100 Hz 16-bit WAV, then a 48000 Hz 16-bit WAV, and cut or copy and paste from the 44100 into the 48000 Hz.
Confirmed on Mac Audacity 1.3.13-alpha-Dec 5 2010 (Unicode).

-- Bill