Syncing Variable Speed Audio

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
Corpsecreate
Posts: 8
Joined: Tue Jul 15, 2014 4:41 am
Operating System: Please select

Syncing Variable Speed Audio

Post by Corpsecreate » Tue Jul 15, 2014 4:53 am

Hi guys,

So basically I have hundreds of FLAC audio files. Half of these are already in perfect sync to my video but have crappy audio quality, the second half of my files are much higher quality, but are not at all synced to my video. At this point, you might think that all I have to do is find a sharp audio spike and then manually sync the waves of the good audio to the bad audio (but in sync) audio. Unfortunately, this is where the problem gets difficult.

The huge problem I have is that the good audio is constantly changing its playback rate. If I sync up a certain segment with the bad audio, the waves are aligned initially but they will differ as time progresses. Let me stress that the playback rate is NOT different by some constant (in other words its not like a NTSC -> PAL speed-up). The good audio will pull ahead of the bad audio sometimes, and then later it will fall behind. The rate is constantly changing.

So the best way I've come up with so far to sync them together is to sync them at the start of the file, and then stretch (by way of "Change Speed") the good audio to match the waves of the bad audio in 1 minute segments. This kind of works, but if there's ever any significant deviation of sync within that minute, then they will stay out of sync. Ideally, you would want to do this same thing in infinitesimal small chunks to ensure they are always in sync.

Is there any way with Audacity, or some other program, that I could sync these files together automatically? Or is there some other way to do it manually that might be better that I'm not thinking of?

Thanks!

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Syncing Variable Speed Audio

Post by Gale Andrews » Wed Jul 16, 2014 11:11 am

The absence of replies suggests "no". Can you find other copies of the music track that don't change tempo?

If the music has heavy beats you may be able to use Quantization in some audio editing applications. Audacity doesn't have that feature.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Corpsecreate
Posts: 8
Joined: Tue Jul 15, 2014 4:41 am
Operating System: Please select

Re: Syncing Variable Speed Audio

Post by Corpsecreate » Wed Jul 16, 2014 5:35 pm

Gale Andrews wrote:The absence of replies suggests "no". Can you find other copies of the music track that don't change tempo?

If the music has heavy beats you may be able to use Quantization in some audio editing applications. Audacity doesn't have that feature.


Gale
Thanks for the reply! Unfortunately, there is no chance of finding another copy of these tracks. These audio files are EXTREMELY rare and I have to work with them. I'll have a look at the link u sent to see if that might help.

I think syncing this automatically is possible but I doubt a tool exists for it since its such a rare and unusual issue. I imagine it would be very possible to split the the files into X number of chunks and then analyze the waves of both tracks to figure out how much the broken track needs to be stretched to match the relative waves of the other. I'd code this myself if I had some idea of how to interract with audio files on a programming level :(

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Syncing Variable Speed Audio

Post by steve » Wed Jul 16, 2014 6:45 pm

Corpsecreate wrote:Is there any way with Audacity, or some other program, that I could sync these files together automatically?
There's a program designed for this type of job. It's called "Capstan" (by Celemony). Unfortunately it costs over $4000. :shock:

Changing the speed in small chunks would be possible to script using "Nyquist" (a simple programming language that is built into Audacity). The really difficult part would be for the plug-in to know how much to change each chunk.

I presume that when you are fixing it manually, you look for "events" that can be identified in both the audio and video, then match them up. Neither Nyquist nor Audacity are able to see the video, so that approach won't work in Audacity.

I suspect that your best approach would be to look for video editing software that allows you to stretch audio tracks. Perhaps Pinnacle Studio (about $100) can do this?
I doubt there will be an easy or quick way to do this :(
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Corpsecreate
Posts: 8
Joined: Tue Jul 15, 2014 4:41 am
Operating System: Please select

Re: Syncing Variable Speed Audio

Post by Corpsecreate » Thu Jul 17, 2014 2:42 pm

Hey, thanks for the response.

It sucks that Capstan costs so much cos that sounds really handy!

When doing it manually, I would just observe the waves of the audio thats running at proper speed and look for any uniquely distinguishable visible part (like an audio spike for instance). Then I would speed up/slow down the broken audio so that the distinguishing feature is in line with the other audio file. I do this in 30s segments. It works...but its really time consuming. I spent about 45 minutes syncing a 21 minute clip. The result is pretty damn good, its just really painful to do for 100s of files.

I had a quick look at Nyquist and like you said, it seems the most difficult part would be to figure out how much it needs to stretch each chunk. It doesn't look like its something I'd personally be able to code using this language (I'm not at all familiar with LISP and its derivatives). Thanks for bringing this up anyhow. Maybe if someone is bored or likes a challenge then they could try to make a plugin for it... :)

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Syncing Variable Speed Audio

Post by steve » Thu Jul 17, 2014 6:50 pm

Corpsecreate wrote:When doing it manually, I would just observe the waves of the audio thats running at proper speed and look for any uniquely distinguishable visible part (like an audio spike for instance). Then I would speed up/slow down the broken audio so that the distinguishing feature is in line with the other audio file.
So you are comparing two audio files? One being low quality but correct speed, and the other being better quality but the speed is drifting?

Roughly, how much and how rapidly is the speed drifting?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Corpsecreate
Posts: 8
Joined: Tue Jul 15, 2014 4:41 am
Operating System: Please select

Re: Syncing Variable Speed Audio

Post by Corpsecreate » Fri Jul 18, 2014 3:46 am

Yep, thats how I'm doing it.

It goes ahead and behind the correct speed by up to about 800ms. When modifying the chunks, I usually have to change the speed by about 1%. It might not sound like a lot, but it makes a massive difference

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Syncing Variable Speed Audio

Post by steve » Fri Jul 18, 2014 9:06 am

I don't know if this will help, but you may find it a bit easier with this plug-in effect: http://forum.audacityteam.org/viewtopic ... 49#p172749
It is much like "Change Speed" but you can specify the desired duration rather than having to guess the percentage.
To install Nyquist plug-ins: http://wiki.audacityteam.org/wiki/Downl ... g_Plug-ins
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply