Distorted Wav file after repair

I have a recording of a concert performance, however the wav file is not saved properly.
After attempt to recover the wave file, it is slightly corrupted. For every 30 seconds, there will be a distorted “click” of 8192 samples length.
Is there any way to fix this, or at least reduce the annoyance?

My best approach is to copy and paste a 8192-sample length after this click and replace it, and repairing the joining points. However there is still a slight stuttering (due to two repeated wave fronts). Is there a good interpolating tool to smooth it out?

A sample of the click is attached. Thanks a lot for any help~

At 96 kHz that’s around 85 ms which is a bit too long for interpolation methods with rhythmic music.
I think that the solution will be to “patch” the gap with another piece of audio as you have attempted to do, but the “patch” needs to fit a bit better.

Could you post a slightly longer sample of the original un-corrected audio (with the gap). About 1 minute duration would be nice so that I can see a couple of gaps and have a good selection of audio to find a suitable patch.

Due to the upload size limit you will not be able to post 1 minute directly to the forum, but you could use one of the free file sharing sites such as sendspace.com and then post a link.

I have uploaded a sample with 3 clicks (at 0:09, 0:42, 1:15) and 3 slot of white noises.

The white noises are easy to deal with since I can safely remove them without affecting the recording, but the clicks are not.
The white noises and clicks are all 8192(2^13)-sample in length, while every click appears exactly 1048576(=2^20) samples before the white noises.
This mic is responsible for piano and percussion in the orchestra.

What’s the story here - those glitches are really strange - the ones that are not noise - they are the wrong audio :confused:
It should be possible to repair, but it’s not going to be a quick job.
It’s a shame that the recording is also clipped a bit.

I’ll get back to you later - possibly tomorrow if I get time.

Here’s the repaired version (Ogg format for an easier download) http://minus.com/mbrFmTXlcy/

The first glitch was the trickiest, there was no suitable material to make a patch, so I cut out the bad bit then use the “Sliding Time Scale / Pitch Shift” effect to stretch the sound that was immediately before the glitch. Initial tempo 0, Final tempo about 42% (don’t remember exactly, but enough to fill the gap). The reason for starting at the same tempo was to avoid damaging the attack on the piano note. The sustain is less critical so it stretches better.

For the other two I used material from the same beats of preceding bars, so for the second glitch that was around 41.3 seconds and for the third one around 1 min 9.3 seconds.

To get a good join I applied short cross-fades to the start and end of the “patches”.

Do you need any more detail to the description?

So do tell, how did the problem happen? (I’m curious).
And what is the music?

This sounds perfect! But it may be tricky for me as the total recording is about 1 hour long…
I tried the Sliding Time Scale/Pitch Shift effect before, but it seems very hard for me to adjust exactly the length I want.
For the other two, how long the portion did you use from previous beat to cover up the glitch? (Although I don’t think it is practical in the rest of the music, since not all of them are hip-hop songs with regular beats…)

I believe the mic didn’t save the file properly before it is turned off, so the wave file (as well as the SD card) is corrupted, and couldn’t be accessed at all.
I used FileRestore Pro to recover the file, and that’s the result…

That portion of the music is from a student arrangement of “All of the Lights” by Kanye West.

I’m not volunteering :wink: and I said “it’s not going to be a quick job”.

Ctrl+D will duplicate the selected audio to a new track. Apply the effect to the duplicate so as to get it close to the right length (slightly over is fine), you can then trim the duplicate (if necessary) to fit.

A good place to make an edit is immediately before a strong beat. If the beat is abrupt you can probably get away with doing a straight cut at the start of the beat. If not so abrupt (as in the sample) allow a little extra for a cross-fade. The “patches” started off as a couple of beats (helps with getting the timing alignment right) then trimmed down to one beat + a little extra for the cross-fades (about 0.42 seconds for the last one). There are no hard and fast rules - it’s a judgement call plus experience (gained from doing it).

Such a shame, but glad that you recovered so much of it. You probably did not need to record at 96 kHz, 48 or 44.1 will still give excellent results and it’s a lot less demanding on the hardware, particularly if using flash memory. I’ve not used FileRestore Pro but it obviously works - if you don’t personally own FileRestore Pro, then a good free data recovery program is “Recuva” from Piriform.com (though obviously I don’t know if it would have worked in this case).

I think your approach of Sliding Time Scale/Pitch Shift effect works quite well in general, and not difficult to do, I will stick with it. Thanks very much! :smiley:
However I am just a bit confused about why after applying the effect, the endpoint (of the 0% tempo change) doesn’t really match, even if I choose zero crossing?

“Time stretching” is always an approximation. In effect the process requires “synthesizing” the additional audio based on the original audio. It’s amazing that it works as well as it does. I suggested applying the effect to a duplicate so that the processed audio can then be tweaked to fit in neatly.

One final question, so using ctrl-D, I actually get a new track with that segment I want to time stretch. But I rather want that segment to lie on the same “extra” track, so I won’t end up with hundreds of tracks. Is there a quick way of doing it?
(Merging tracks every time seems troublesome, and I lost the “endpoints” as the software decide to join different segments with a long silence… otherwise I have to be really careful to pick the correct place to paste the segment, which is tiresome.)


I’d recommend working with 3 audio tracks - the original track (track 1), a new track with the “patches” (track 2) and a temporary track (track 3).

  1. Select the part that you want to duplicate (track 1). It is often convenient to select a bit more than you actually need and then trim down the copy to the right size later.
  2. Ctrl+D to make a duplicate (track 2)
  3. Do whatever you need to the duplicate …

    Next section:
    a) Select the part that you want to duplicate (track 1).
    b) Ctrl+D to make a duplicate (track 3 - temporary)
    c) Double click on the duplicate copy so that (only) it is selected.
    d) Ctrl+C (copy)
    e) ENTER (deselects track 3)
    f) Up cursor key (moves “focus” to track 2)
    g) ENTER (selects the same section of track 2).
    h) Ctrl+V (paste into track 2)
    g) Click on the [X] in the top left corner of track 3 to delete the (temporary) track.

Tip: It’s usually easiest to work left to right so as to avoid accidentally moving later audio clips.

Wow these shortkeys are really useful!!! Thanks a lot :smiley: