steve wrote:waxcylinder wrote:I seem to recall that lengthening the repair selection exponentially increases the processing time
Yes - for selections greater than 128 samples the repair time rises very rapidly. However, there was a suggestion that larger sections could be repaired as a sequence of 128 sample length blocks. Initial tests indicated that this might work, but as yet it has not progressed much more than that.
srceffectsRepair.cpp, at or near line 34, add these two lines:
Code: Select all
#define MAXIMUMSAMPLECOUNT 256
#define MAXIMUMSAMPLECOUNTFLOAT 256.
both of these must have the same value (this just makes it easy to play around with various values).
At or near line 81, make this change:
Code: Select all
//if (spacing < 128. / rate)
// spacing = 128. / rate;
if (spacing < MAXIMUMSAMPLECOUNTFLOAT / rate)
spacing = MAXIMUMSAMPLECOUNTFLOAT / rate;
At or near line 105, change this code:
Code: Select all
if (repairLen > 128) {
::wxMessageBox(_("The Repair effect is intended to be used on very short sections of damaged audio (up to 128 samples).nnZoom in and select a tiny fraction of a second to repair."));
bGoodResult = false;
break;
}
so that it looks something more like this:
Code: Select all
if (repairLen > MAXIMUMSAMPLECOUNT) {
wxString message;
wxString math;
math.Printf(_("The Repair effect is intended to be used on very short sections of damaged audio (up to %d samples).nn"), MAXIMUMSAMPLECOUNT);
message.append(math);
message.append(_("You have chosen "));
wxString repairLength;
repairLength.Printf(wxT("%d"), repairLen);
message.append(repairLength.c_str());
message.append(_(" samples.nn"));
message.append(_("Zoom in and select a tiny fraction of a second to repair."));
::wxMessageBox(message);
bGoodResult = false;
break;
}
all this does is pick up our modified maximum sample count and makes the error message a little bit more informative by telling the user how many samples are currently chosen.
I find that invariably I need someplace between 150 and 200 samples when I go to repair. I know my hardware is probably faster than average (Intel Core 2 Duo E6850 3.0 GHz FSB1333 LGA775, 2X OCZ DDR3 PC3-12800 4GB Kit = 8GB ram) but I find that with a maximum set out either 128 or 256 Repair runs virtually instantaneously. I've never bothered to check any longer maximums because I'm concerned that the smoothing code would be confused. However, using 256 is a maximum works just fine.