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: Adobe Audition Stretching (Read 26715 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Adobe Audition Stretching

Is it possible to stretch audio by a very precise amount in Adobe Audition?

Currently, i am talking about 500ms over the entire duration.
so for example.

1:55:50:000
will become: 1:55:50:500.


Adobe Audition Stretching

Reply #1
If not by tempo shift, then you could still edit the sampling rate manually by the time ratio 0.99992806, so 44100 Hz becomes 44096.8276 (or round to the precision allowed) and the duration changes to 115 min, 50.5 sec, for example then resample that non standard rate to 44100 Hz in any tool you choose. Any tuning variation would be negligible and would presumably be preferable to tempo-stretching artifacts. (This based on my recollection of the options in CoolEdit, its predecessor)
Dynamic – the artist formerly known as DickD

Adobe Audition Stretching

Reply #2
If not by tempo shift, then you could still edit the sampling rate manually by the time ratio 0.99992806, so 44100 Hz becomes 44096.8276 (or round to the precision allowed) and the duration changes to 115 min, 50.5 sec, for example then resample that non standard rate to 44100 Hz in any tool you choose. Any tuning variation would be negligible and would presumably be preferable to tempo-stretching artifacts. (This based on my recollection of the options in CoolEdit, its predecessor)


I am trying to use as high precision as possible, so assuming a samplerate is sadly out of the question, as it's to limited.

Adobe Audition Stretching

Reply #3
This should absolutely be possible, but my experience is with an older version(s) of Audition. Also, I barely used the CS versions, so things might be different with newer versions.

Assuming you already found the "Time and Pitch" effect, I think the following settings will suit your needs (with some instructions varying depending on program version):
1) use Constant Stretch;
2) select "Adjust Tempo (preserve pitch)";
3) set Ratio 99.997 -- adjust this number until the desired duration shows in the "Length" box;
4) select High Precision Quality;
5) Time and Pitch settings -- select Use Appropriate defaults (you may want to manually adjust Splicing Frequency and Overlapping values, which is trial and error. Read the included docs).

Good luck!
"Something bothering you, Mister Spock?"

Adobe Audition Stretching

Reply #4
This should absolutely be possible, but my experience is with an older version(s) of Audition. Also, I barely used the CS versions, so things might be different with newer versions.

Assuming you already found the "Time and Pitch" effect, I think the following settings will suit your needs (with some instructions varying depending on program version):
1) use Constant Stretch;
2) select "Adjust Tempo (preserve pitch)";
3) set Ratio 99.997 -- adjust this number until the desired duration shows in the "Length" box;
4) select High Precision Quality;
5) Time and Pitch settings -- select Use Appropriate defaults (you may want to manually adjust Splicing Frequency and Overlapping values, which is trial and error. Read the included docs).

Good luck!


I have tried using these methods, but sadly, it's limited (the % only allows xx.xxx).
And no matter what i do, it sounds a tiny bit, "robotic".

I only want to stretch and resample with high precision, i want no pitch change or anything else.

Adobe Audition Stretching

Reply #5
Yes, I agree the CEP/Audition stretching effect is far from perfect. (That and the Noise Reduction has consumed much of my time from experimentation/trial and error.)

I think some clarification might be needed.

For instance, I still do not know which version of Audition you run. Also I lack specifics on the sound file. Is the material CD/mixdown or single instrument? This is a major factor when using stretch functions. I find stretching parts of individual instrument tracks for short intervals (i.e. <5 seconds) much easier to bury stretch artifacts than taking on the whole piece. I might as well mention my experience with Audition's gliding-stretch was thoroughly unsatisfactory.

In your first post you mentioned stretching the duration from 1:55:50 to 1:55:50.5s, and if this is true I would rather do several small stretches in non-intrusive places (i.e. five 100ms->200ms stretches at quiet passages) but this idea would not be preferred if the file was a track in project (I still don't know if this is or not).

If all else fails there may be another program than Audition. I have heard Soundtouch many times but I have not used it myself. Perhaps someone else at HA knows more on this.
"Something bothering you, Mister Spock?"

Adobe Audition Stretching

Reply #6
I have tried using these methods, but sadly, it's limited (the % only allows xx.xxx).
And no matter what i do, it sounds a tiny bit, "robotic".

I only want to stretch and resample with high precision, i want no pitch change or anything else.
Then in the Time/Pitch>Stretch dialogue, select "Resample (preservers neither)" as the option. The number you enter is the duration in seconds, with an accuracy in 1/1000ths of a second. Should do it.

Actually, forget that - it doesn't seem to work in my version. Such a small change isn't implemented (though it saves the undo buffer, before doing nothing). I could be wrong.

Cheers,
David.

Adobe Audition Stretching

Reply #7
If all else fails there may be another program than Audition. I have heard Soundtouch many times but I have not used it myself. Perhaps someone else at HA knows more on this.


Soundtouch DSP for pitch shifting, tempo and rate adjust is available in foobar2000 foo_dsp_soundtouch and in Audacity. I think SoX also implements the same, but not having a GUI, it might be possible to specify arbitrary precision numbers.

There's also a bunch of additional Audacity plugins including "Higher Quality Pitch Scaler", but in all these cases, the number of significant figures you desire is not available.

Seriously, trying to time-stretch without the slightest pitch variation is mathematically difficult and requires overlapping windows, which will always be prone to artifacts.

Your pitch variation by simply changing the sampling rate is less than 0.125 cents (1/800th of a semitone), so it essentially remains perfectly in tune.

I'm using SoX from a cmd.exe Command Prompt window as follows (which works regardless of sampling rate) and seems to accurately adjust duration to the ratio you require (although I'm applying it to a slightly longer file so can verify the accuracy better):

Code: [Select]
"C:\Program Files\bin\sox.exe" input.wav output.wav speed 0.99992806272930005035608948996473


I think it took me about 5 minutes to change a 48000 Hz 24-bit WAV from
2,968,952,876 bytes, 2:51:48.864 (494 825 472 samples) as reported by foobar2000
to
2,969,166,506 bytes, 2:51:49.606 (494 861 071 samples)

Actual duration ratio = 0.99992806263800855735528244855615

That's accurate to the same number of significant figures as the number of samples, which is what I'd expect.

The audio sounded very clean.

If you really want to risk the artifacts of pitchless tempo adjustment, there's the tempo feature, which can be used in -l (linear) mode when the factor is close to 1, so might be less prone to artifacts. Doubtless similarly high precision can be specified.

I calculated the required ratio in Calculator:
55 + 60 = 115 minutes
115 * 60 = 6950 seconds
6950 / 6950.5 = 0.99992806272930005035608948996473
Hit Copy (Ctrl-C) then be ready to right-click Paste into the Command Prompt window after the word speed.

You can get an idea of progress while you're waiting by opening a separate cmd.exe window by repeatedly running dir *.wav to see the output.wav growing to a little bigger than input.wav
Dynamic – the artist formerly known as DickD

Adobe Audition Stretching

Reply #8

Code: [Select]
"C:\Program Files\bin\sox.exe" input.wav output.wav speed 0.99992806272930005035608948996473




Will try it out,
But just asking some more stuff to this.


How good is the resampling done there (is it transparent and high accurate etc)?
How big number can they work with (Float, 32bit, etc?)

Also, is it possible to input .Avi and make it just demux the Wave, or am i forced to demux it before?

Adobe Audition Stretching

Reply #9
SoX Resampler is extremely good - one of the best out there. It has been tested extensively for aliasing etc and comes out extremely well. It's also been made available as a Foobar2000 DSP plugin because it's good yet light on resources and can be set to resample specific rates only.

SoX uses floats internally.

From a search (Sox Video file), I believe it's necessary to demux using ffmpeg or similar (or throw the AVI into Audacity to extract the audio track(s) then Export from there to WAV.

You can probably pipe the output of ffmpeg into SoX too.
Dynamic – the artist formerly known as DickD

Adobe Audition Stretching

Reply #10
It's essential to know if your stretched audio has to be sync with another audio and/or video track (Destroid already asked). If yes, then the stretch should be smeared out over the whole duration with resampling or time stretching. If not, then it's probably best to find a few suitable spots to add your extra ms. Good places are quiet parts between songs/movements or even better in the applause (if any). Apart from sync issues this is the best sounding option since you don't modify the audio (lossless so to speak).
How good is the resampling done there (is it transparent and high accurate etc)? How big number can they work with (Float, 32bit, etc?)
In my experience resampling produces less artifacts than time stretching and might be audibly transparent if well done. So if the pitch change is within acceptable limits (like in your case) resampling seems the better option.

Adobe Audition Stretching

Reply #11
SoX Resampler is extremely good - one of the best out there. It has been tested extensively for aliasing etc and comes out extremely well. It's also been made available as a Foobar2000 DSP plugin because it's good yet light on resources and can be set to resample specific rates only.

SoX uses floats internally.

From a search (Sox Video file), I believe it's necessary to demux using ffmpeg or similar (or throw the AVI into Audacity to extract the audio track(s) then Export from there to WAV.

You can probably pipe the output of ffmpeg into SoX too.


That's extremely good to hear:)

Well i have problems, i can't input a Wave file (atleast not the one i want, tried extracting it 2 times even).

It says:  WAVE: RIFF header not found

Searched on it, tried adding bit samplerate etc, but it doesn't seem to work.

It seems to work with smaller files, but the clip i am trying to use (9 hours) doesn't work.


EDIT:

Seems to work if i tell it´s "RAW" and set all information manually.

Adobe Audition Stretching

Reply #12
Okay well, it "worked" with RAW, but i get a high Click in the beginning.
But it seems to atleast speed up/down correctly.

Adobe Audition Stretching

Reply #13
Did you try "resample (preserves neither)" in stretching mode? I've used Audition to tune samples used in Gigastudio. A plain old resample will sound like turning the pitch control on a turntable with no processing artifacts. A 1/2 second total run time runtime change in 2 hours will be undetectable pitch wise UNLESS you're attempting to mix it with another audio source that WAS synchronous initially. At that, the beat rate will be lower than any musician can tune an instrument. If I did my arithmetic correctly, your A 440 would be 439.968. Having tuned musical instruments, I can tell you it's difficult to achieve that precision reliably.

Are you trying to match the audio to video? Otherwise it's hard to imagine why a half second is that important across 2 hours. If there is no lip sync to maintain, you could add or delete a few milliseconds during silences and no one would be the wiser and since it is processed not at all, there will be NO artifacts. None.


Adobe Audition Stretching

Reply #14
Off topic to this a bit, but i have tried using Sox for changing PAL to NTSC, slowing down and keeping pitch.
And, i don´t know if i do something wrong, but i can detect artifacts pretty easy.

I tried using Stretch and Tempo.
Tempo did alot better.

But i also tried with Adobe Audition, and that was was flawless to my ears.

EDIT:

Okay Audition was not flawless, it didn't produce the artefact, but instead, it doesn't even sound the same, the pitch is wrong;S

Adobe Audition Stretching

Reply #15
Okay well, it "worked" with RAW, but i get a high Click in the beginning.
But it seems to atleast speed up/down correctly.


I've noticed that video files don't always have a precise match between audio and visual streams (a fraction of a second difference - though usually I assume this is down to frame-boundaries in non-PCM audio like AAC or AMR and frame boundaries in visual stream).

I might try dragging the video file onto Audacity instead of Audition to see if there's a difference in audio stream extraction.

If there's a click at the start, usually there's something like a sudden jump in sample value (not starting at 0). The usual method to tame that is to apply a very short fade in (and poss fade-out). For example select from time zero to about 0:00:00.05 and fade in. Around 50 milliseconds is usually enough and won't be noticeable

It is usually good practice to fade at start and end of samples you might want to run together (alternatively, cut samples at zero-crossing points using the function to adjust selection to zero crossings or cross-fade and overlap when mix-editing to replace a short section of audio).
Dynamic – the artist formerly known as DickD

Adobe Audition Stretching

Reply #16
Okay well, it "worked" with RAW, but i get a high Click in the beginning.
But it seems to atleast speed up/down correctly.


I've noticed that video files don't always have a precise match between audio and visual streams (a fraction of a second difference - though usually I assume this is down to frame-boundaries in non-PCM audio like AAC or AMR and frame boundaries in visual stream).

I might try dragging the video file onto Audacity instead of Audition to see if there's a difference in audio stream extraction.

If there's a click at the start, usually there's something like a sudden jump in sample value (not starting at 0). The usual method to tame that is to apply a very short fade in (and poss fade-out). For example select from time zero to about 0:00:00.05 and fade in. Around 50 milliseconds is usually enough and won't be noticeable

It is usually good practice to fade at start and end of samples you might want to run together (alternatively, cut samples at zero-crossing points using the function to adjust selection to zero crossings or cross-fade and overlap when mix-editing to replace a short section of audio).


The extracted .wav does not have the click.

And Sox says something like (Dither blabla 1 sample, decrease volume), don't remember exactly.

Adobe Audition Stretching

Reply #17
Did you try "resample (preserves neither)" in stretching mode? I've used Audition to tune samples used in Gigastudio. A plain old resample will sound like turning the pitch control on a turntable with no processing artifacts. A 1/2 second total run time runtime change in 2 hours will be undetectable pitch wise UNLESS you're attempting to mix it with another audio source that WAS synchronous initially. At that, the beat rate will be lower than any musician can tune an instrument. If I did my arithmetic correctly, your A 440 would be 439.968. Having tuned musical instruments, I can tell you it's difficult to achieve that precision reliably.

Are you trying to match the audio to video? Otherwise it's hard to imagine why a half second is that important across 2 hours. If there is no lip sync to maintain, you could add or delete a few milliseconds during silences and no one would be the wiser and since it is processed not at all, there will be NO artifacts. None.



The work i am trying to do, has to do with syncing video to audio.
And i am a perfectionist when it comes to this, it Must be correct, both the video part and audio part. It's the hard frustrating way, but it's the True way;P

Adobe Audition Stretching

Reply #18
Off topic to this a bit, but i have tried using Sox for changing PAL to NTSC, slowing down and keeping pitch.
And, i don´t know if i do something wrong, but i can detect artifacts pretty easy.

I tried using Stretch and Tempo.
Tempo did alot better.

But i also tried with Adobe Audition, and that was was flawless to my ears.

EDIT:

Okay Audition was not flawless, it didn't produce the artefact, but instead, it doesn't even sound the same, the pitch is wrong;S

Probably, Audition just changed the speed.

SoX attempts to do a useful job here, so probably okay for speech, and to hear what a song might sound like if played at a different tempo, but, given the the simplicity of the algorithm (WSOLA), it's not expected to be perfect.  Izotope has something more sophisticated in this area, called 'Radius' IIRC.

Adobe Audition Stretching

Reply #19
SoX attempts to do a useful job here, so probably okay for speech, and to hear what a song might sound like if played at a different tempo, but, given the the simplicity of the algorithm (WSOLA), it's not expected to be perfect.  Izotope has something more sophisticated in this area, called 'Radius' IIRC.


I see, so it's a "limitation" with SoX then?
And just to make sure, this issues, is only occur, when changing pitch?
changing speed itself is much more accurate?

Thanks

Adobe Audition Stretching

Reply #20
In movies, filmed at 24 fps, PAL (analogue) TV systems have often simply changed the playback rate to 25 fps (50 interlaced fields per second), which introduced a pitch shift to the audio making music shift by a little less that a semitone. I'm not sure if digital video broadcasting systems are frame-rate agnostic yet. I suspect not due to support for legacy CRT televisions with fixed scan speed via set-top boxes.

I won't address the Stretch or Tempo on PAL to NTSC conversion. For much music, 2 or 3 semitones of pitch adjustment or the equivalent stretching/tempo change sounds OK, but certain tracks begin to warble badly. Sometime it's acceptable to change the pitch a little less then speed-up or slow-down the track for an extra semitone or two despite an accompanying tempo change. (That's why I suggested a speed change and resampling to ensure ideal quality for your original question). Some of this will depend on the algorithm and characteristics of the music, and some of the proprietary algorithms may be superior to open algorithms. Audacity has a bunch of plugins that may be different to Sox's (which I think uses SoundTouch).

It may be that despite the inaccuracy of Audition's stretching you could get as close as possible then make the final precise adjustment using SoX's speed function, thus combining a good quality pitch-preserving tempo-changing algorithm with a precise speed change that will be used for less than 0.1%, thus causing negligible pitch variation.

Returning to the original question in this thread:

What you posted of the "error message" (more of an informational message) indicates that certain of the new sample values were calculated to be greater than full scale. It sounds like it might only be a single sample.

I hadn't come across this in my test audio (because I had about 6-8 dB of headroom to full scale). The error message suggests that your audio is near full-scale and that the re-positioning of sampling points has produced one or two samples that are beyond full scale (clipping). This is always a potential risk with any filtering or re-timing operation and is akin to the phenomenon of inter-sample overs and is also related to the Gibbs Effect.

You have a few choices, all of which are likely to be benign in this case
• allow the single sample to clip, which introduces clipping distortion. For this operation it's likely to be a minimal clipping distortion (a tiny change in amplitude), and for one or two consecutive samples, it's usually impossible to ABX as proven by the fact that it frequently occurs in lossy codecs' representations of music CD audio.
• apply the suggested attenuation command (i.e. negative gain) to prevent clipping. A change of less that 0.5 dB is probably negligibly different to the human ear.
• apply something like a lookahead limiter that will leave all audio unchanged except in the close vicinity of the clipped peak, where a soft limiting curve will be applied to produce minimal harmonic distortion and tame the peak. Foobar2000 has Advanced Limiter for this purpose. Audacity and Audition have their own under different names.
Dynamic – the artist formerly known as DickD

Adobe Audition Stretching

Reply #21
In movies, filmed at 24 fps, PAL (analogue) TV systems have often simply changed the playback rate to 25 fps (50 interlaced fields per second), which introduced a pitch shift to the audio making music shift by a little less that a semitone. I'm not sure if digital video broadcasting systems are frame-rate agnostic yet. I suspect not due to support for legacy CRT televisions with fixed scan speed via set-top boxes.

I won't address the Stretch or Tempo on PAL to NTSC conversion. For much music, 2 or 3 semitones of pitch adjustment or the equivalent stretching/tempo change sounds OK, but certain tracks begin to warble badly. Sometime it's acceptable to change the pitch a little less then speed-up or slow-down the track for an extra semitone or two despite an accompanying tempo change. (That's why I suggested a speed change and resampling to ensure ideal quality for your original question). Some of this will depend on the algorithm and characteristics of the music, and some of the proprietary algorithms may be superior to open algorithms. Audacity has a bunch of plugins that may be different to Sox's (which I think uses SoundTouch).

It may be that despite the inaccuracy of Audition's stretching you could get as close as possible then make the final precise adjustment using SoX's speed function, thus combining a good quality pitch-preserving tempo-changing algorithm with a precise speed change that will be used for less than 0.1%, thus causing negligible pitch variation.

Returning to the original question in this thread:

What you posted of the "error message" (more of an informational message) indicates that certain of the new sample values were calculated to be greater than full scale. It sound ds like it might only be a single sample.

I hadn't come across this in my test audio (because I had about 6-8 dB of headroom to full scale). The error message suggests that your audio is near full-scale and that the re-positioning of sampling points has produced one or two samples that are beyond full scale (clipping). This is always a potential risk with any filtering or re-timing operation and is akin to the phenomenon of inter-sample overs and is also related to the Gibbs Effect.

You have a few choices, all of which are likely to be benign in this case
• allow the single sample to clip, which introduces clipping distortion. For this operation it's likely to be a minimal clipping distortion (a tiny change in amplitude), and for one or two consecutive samples, it's usually impossible to ABX as proven by the fact that it frequently occurs in lossy codecs' representations of music CD audio.
• apply the suggested attenuation command (i.e. negative gain) to prevent clipping. A change of less that 0.5 dB is probably negligibly different to the human ear.
• apply something like a lookahead limiter that will leave all audio unchanged except in the close vicinity of the clipped peak, where a soft limiting curve will be applied to produce minimal harmonic distortion and tame the peak. Foobar2000 has Advanced Limiter for this purpose. Audacity and Audition have their own under different names.


Well on old stuff, i am pretty sure, we just increased the speed.
Now we increase the speed and fix the pitch, atleast most of the time.


And yes, as my original question stated, i am Not trying to change the pitch, it was just that once i heard Sox was great for resampling, i though to give the Pitch a try.

But very true, i can combine the Audition with Sox, great idea there:)

And with the error message, it doesn't occur from clipping form the actual audio. I think it occurs thanks to the forces use of .raw instead of .Wav.
But i only needed to use it on that clip which was 9 hour, so maybe it was a limitation in Sox or .Wave handler.

It would just fail to decode the first sample i think.


Adobe Audition Stretching

Reply #22
The work i am trying to do, has to do with syncing video to audio.
And i am a perfectionist when it comes to this, it Must be correct, both the video part and audio part. It's the hard frustrating way, but it's the True way;P


If you are a perfectionist how the the audio and video get out of sync? Answer: the audio and video weren't locked during record. The "True way' is RESAMPLE. What you're attempting is incorrect in theory and practice. Think of it this way. Obviously the audio and video WERE in sync when it was laid down so the audio has been 'shrunk' because the playback sample rate (now locked to the video) is faster than the original record sample rate - that's why it's wrong now. You want to restore the time so you have to recalculate what the sample rate WOULD HAVE BEEN if it were locked during record which is exactly what 'resample' does.

I work in a Hollywood post house and your problem - for the same reason - pops up now and again and it gets fixed -sometimes scene by scene - the way I'm telling you. It always traces back to somebody who thought they knew more than they actually do.

Someone mentioned the speed difference between PAL and NTSC. That peed difference is 25/23.976 - about 4.17% - more than 2/3 of a semitone. Your amount of change is 13900/13899 - less than 1/10 of the difference between NTSC B/W and NTSC color. Before pitch correction was practical the Europeans simply listened to American video 4% fast.


Adobe Audition Stretching

Reply #23
The work i am trying to do, has to do with syncing video to audio.
And i am a perfectionist when it comes to this, it Must be correct, both the video part and audio part. It's the hard frustrating way, but it's the True way;P


If you are a perfectionist how the the audio and video get out of sync? Answer: the audio and video weren't locked during record. The "True way' is RESAMPLE. What you're attempting is incorrect in theory and practice. Think of it this way. Obviously the audio and video WERE in sync when it was laid down so the audio has been 'shrunk' because the playback sample rate (now locked to the video) is faster than the original record sample rate - that's why it's wrong now. You want to restore the time so you have to recalculate what the sample rate WOULD HAVE BEEN if it were locked during record which is exactly what 'resample' does.

I work in a Hollywood post house and your problem - for the same reason - pops up now and again and it gets fixed -sometimes scene by scene - the way I'm telling you. It always traces back to somebody who thought they knew more than they actually do.

Someone mentioned the speed difference between PAL and NTSC. That peed difference is 25/23.976 - about 4.17% - more than 2/3 of a semitone. Your amount of change is 13900/13899 - less than 1/10 of the difference between NTSC B/W and NTSC color. Before pitch correction was practical the Europeans simply listened to American video 4% fast.




Indeed, that is the problem. If i could have them locked, i wouldn't have this problem.

If i am recording a video source from one device and the audio with another (both come from the same device, but are captured by different), i can´t lock them to one sync clock. (If i can, please say how. This is done within the PC, External devices for Clocking is not intended).

Probably you are correct, but the thing is, i don´t think i know alot, i actually think i know to little, which is why i have been researching this for a long time now with different solutions.


Adobe Audition Stretching

Reply #24
Then it does sound like the SoX speed function is exactly what you need.

In one command with the right length ratio it corrects the sampling rate to a few hertz lower then resamples cleanly to the nominal rate (presume 48000.000 Hz). If you happen to have audio from the video camera, then presumably the two will then match completely in terms of pitch and timing, albeit that the on-board audio is likely to have unwanted ambient reverberation and noise pickup etc. A pitch-preserving tempo shift or stretch will not match the pitch of the video (albeit by a fraction of a cent).

You won't know or care whether the video clock or the audio sampling clock was closest to its nominal rate, but they'll be in sync with one another and the tuning of instruments will be well within one cent (0.01 semitones).
Dynamic – the artist formerly known as DickD