How to recover audio files from a crashed session in Audacity

Today I experienced a crash using Audacity while I was recording a long radio session. I was on an old macbook which runs on MacOS 10.5.8 and Audacity 1.2.5. When I had the crash a 'Yes' or 'No' dialog opened in which I click 'No' in order not to delete the temporary files.

In MacOS the temporary files where in /tmp/audacity<audacity version>-<my username>. In this folder there were *.au files enumerated, and I copied them in a folder in my home directory. In Audacity's wiki I downloaded the Audacity Recovery Utility for my Intel Mac. Then I run the application of this utility and I selected the folder with the recovered files. The utility did the recovery, though I noticed that the recovered WAV file was a bit stretched.

My recording was a stereo recording and in the first place I was disappointed because in Audacity's wiki (see 'Manual Recovery') it says: "Stereo or edited audio is unlikely to be recovered in the correct sequence". To be honest I haven't listened the recovered recording because it's about 15 minutes, though more or less it seems to be OK.

Each au file is a 1MB audio file and about 6 seconds of recording. So if you have a short recording you can do the recovery manually if you import the audio files to audacity. In Audacity 2.1.2 to import the audio files you go to File>Import>Audio, in Audacity 1.2.5 on MacOS that was on Project>Import Audio.

If you have many files the Recovery Utility is the way to go. In order to make the recovery properly the *.au files must have consecutive enumeration. I did not experience this case, but if you don't have consecutive enumeration in your list of files the following script reads the ordered, but not properly enumerated list of files, and enumerates them properly.

I made a list of files with no consecutive enumeration in the folder tmp-audacity/ and I stored the bash script as well. I also made a folder to store the properly enumerated files under the name ordered/.

cd tmp-audacity && ls
# Audacity enumerates the temp files in the following format:
# The Recovery Utility has to take as input the files enumerated with _consecutive numbers_
# The script below enumerates the tmp *.au files up to 99
FILES=./tmp-audacity/*.au # Read all Audacity's temp files
COUNTER=1 # Initialize a counter
# Loop
for f in $FILES
    if [ $COUNTER -lt 10 ] # less than 10 (up to 9)
        cp $f ./tmp-audacity/ordered/$FN$
        COUNTER=$(($COUNTER + 1))
    if [ $COUNTER -gt 9 ] # greater than 10 (up to 99)
        cp $f ./tmp-audacity/ordered/$FN$
        COUNTER=$(($COUNTER + 1))
cd ./tmp-audacity/ordered && ls # show the properly enumerated files

Latest posts