Well, I'm not sure how many users would follow all this without step-by-step documentation, or whether developers would be rushing to make some script available that worked on the _data folders and the AUP. Also bear in mind this only tests out correctly so far for a recording that was never edited.kozikowski wrote:Excellent. Now over five chapters we have all the definitions, conditions and steps to code a terrific rescue tool. Everybody wins!
I also note that someone on the Wiki ( http://wiki.audacityteam.org/wiki/File_ ... ty_project ) wrote rough steps to split a large failed project into sections using Audacity 1.3.7. However his project appeared to be under the 2^31 limit so it looked as if his problem was something else, and his steps would not recover audio beyond the limit in Audacity 2.x.
Anyway I will post the Windows PowerShell script that rewrites the waveblock start values for all projects after the first. I am told it should work with any version of PowerShell:
Code: Select all
$DebugPreference = "Continue"
[int64]$offset = 0
$indata = Get-Content .wrp2.aup
$outdata = $null
$first = $true
$testitem = [regex]'waveblock start="(?<startingpoint>d*)"'
$rcdCount = 0
foreach ($item in $indata)
{
if ($item -match $testitem)
{
if ($first)
{
$first = $false
$offset = $matches['startingpoint']
}
[string]$startstr = -$offset + $matches['startingpoint']
$item = $item -replace $matches['startingpoint'], $startstr
$rcdCount++
Write-Debug -Message "Record $rcdCount"
}
$outdata += "$item`n"
}
Set-Content -Path .wrp2mod.aup -Value $outdata -Encoding Ascii -Force
"$rcdCount records processed."
If you don't want progress messaging, change $DebugPreference to "SilentlyContinue".
If anyone here wants to write a Perl or Python version, that would be great (needed for the other platforms). Otherwise I might look into a Perl version based on a suggestion someone made.
Gale