Log in

View Full Version : Changing tempo without affecting pitch (23.976 -> 25 fps conversion)


Eldacan
12th June 2004, 15:32
How can I change the tempo of a sound file with linux tools?

I have a 23.976 fps movie that I want to convert to PAL DVD-Video (25 fps). I first tried a simple re-encoding which duplicated about one frame per second, but I notice the resulting "pause" every second in playback.
So I want to use the other method: considering the original movie as 25 fps, so that the duration of the movie will be about 4% shorter, and adjusting the audio so that it remains synchronized with video.
I could just speed up the audio by 4% (which is technically similar to resampling) but the rise in pitch is really noticable.

I'm looking for a way to change the tempo without affecting the pitch



Here's what I've tried:

Sox:

sox input.wav output.wav stretch 0.95904

(0.95904 is 23.976/25)
The result is really awful.


Audacity:
I've tried to change the tempo in Audacity. The result is not as bad as with sox, but there is something weird: as if some sound went back and forth between the the left and right tracks, or maybe some "instability" in volume. And AFAIK it's gui-only (not suitable for batch processing).


Besweet:
The original audio is AC3 so the ideal would be a direct AC3->AC3 conversion with only speed adjustment. This is something Besweet can do, I think (for the previous tests I used a pcm dump of the AC3 stream). I tried running Besweet in Wine but it won't write any file to disk, I can't find why.


Do you know of some tools that would do the job? Maybe a combination of LADSPA plugins ?

stephanV
12th June 2004, 15:50
personally i wouldnt bother changing the tempo without changing the pitch as the difference is less than half a tone... (noticable, but disturbing? it is how it used to be done when converting movies to pal)

i remember this thread (http://forum.doom9.org/showthread.php?s=&threadid=76376&highlight=pitch) about it, but i don't know about the availability of those tools under linux.

good luck though!

jggimi
12th June 2004, 16:33
Moved to Audio forum. [Edit: If our Audio team can't help, DSPGuru or Kpex can move this back to the Linux forum.}

Eldacan
12th June 2004, 17:14
Thanks stephanV! In its debian package Soundtouch is described as "part of the ardour DAW" and I just can't understand how to use Ardour so I thought it was useless for me, but actually there is a "soundstretch" command-line program distributed with Soundtouch:

soundstretch input.wav output.wav -tempo=4.2709

The result is quite good, I don't notice any loss of quality (the input file is not very high-quality though).

Half a tone is not much, but when you know the original really well I think it is disturbing :)

I'm suprised Sountouch was rated 2.7/5 in the thread you mention... I'll try it with some high-quality soundfiles.