Recovering crashes manually

From Audacity Manual

Jump to: navigation, search
If Audacity crashes or the computer loses power, Audacity should normally recover the projects automatically when you restart. Only use these manual recovery steps if Automatic Recovery does not work correctly. The steps on this page will only recover unedited recordings (and may recover stereo recordings with some sections of left and right channel in the wrong channel).

If you successfully saved the project just before the crash, it may be simpler just to lose the unsaved changes and open the saved AUP file rather than attempt a manual recovery.

Warning icon If the Automatic Crash Recovery dialog has appeared but recovery is incorrect, do not close Audacity or save any changes until manual recovery using these instructions is complete.

If you need to shut down the computer before manually fixing an incorrect Automatic Crash Recovery, force quit Audacity in the system task manager. This will preserve the temporary data for next launch of Audacity.

Contents


If you have the AUP project file, open it to return the last saved state of the project. If the last saved state was a new, empty project, or if you don't have an AUP project file, you can recover the audio from the project's _data folder or Audacity's temporary folder by one of the manual or automatic methods below.

The _data folder will be in the same directory as the AUP file.

Location of Temporary Folder

This is only relevant if you never saved a project and have no usable AUP file or AUTOSAVE file.

On Mac computers, the temporary folder is usually hidden in the Finder. To access it, use the "Go To Folder" command in the Finder, or type open tmp/ and insert the name of the folder after the / . If that doesn't work, try to make the Finder show its hidden files and folders by entering the following commands in the terminal:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
then relaunch Finder to show the hidden files. Alternatively, try TinkerTool to do the same thing, or on OS X 10.6 or later you can type Shift-Command-Period(.) to show or hide hidden files and folders in an Open or Save dialog.

Manual recovery

If you only have a few AU files to recover, use the "Import Audio" command to open all the .au files from the Audacity temporary folder or project _data folder. Use shift-click or control-click to select multiple files. The files will be in approximately 6-second chunks and will be on separate tracks in the Audacity screen. Files from stereo tracks will alternate between left and right channels.

  1. Click in the Track Control Panel (by the Mute/Solo buttons) of the topmost track.
  2. Z or Edit > Find Zero Crossings.
  3. Edit > Remove Special > Trim.
  4. Click in the Track Control Panel of the first track you want to join to the topmost track.
  5. Z or Edit > Find Zero Crossings.
  6. Click Edit > Cut.
  7. Click after the end of the topmost track.
  8. Press END on the keyboard.
  9. Click Edit > Paste and the cut track will attach to the end of the topmost track.
  10. Repeat as necessary to join all the tracks onto the topmost track.

Play the result.

Cut and paste as needed if any files are found to be in the wrong order or the wrong channel.

Automatic recovery tools

Tools written for legacy Audacity 1.2 can automate data recovery.

Warning icon All these utilities require the .au files to be input in consecutive alphanumerical order. Audacity names files randomly so files will need to renamed.

Open Audacity's temporary or project _data folder in your system file manager. Sort the files by timestamp order (earliest first), then rename them using a consecutive alphanumerical sequence, lowest number first. An arrangement looking something like this should work:

b001.au 15:56:02
b002.au 15:56:02
b003.au 15:56:10
b004.au 15:56:10
Utilities for renaming files to consecutive alphanumerical order
  • On Windows, Explorer cannot rename to a sequence acceptable to the recovery tools. You can use instead the Mass Rename tool in the freeware xplorer2lite file manager.
    1. Open the required folder in xplorer2 and sort the .au files by time modified as above
    2. CTRL + A to select all the files
    3. File > Mass Rename
    4. In the "Mass Rename Wizard", click in "Target name template" and type the letter e with a $ after the letter. For example, e$0001.au will rename the files to e0001.au, e0002.au and so on. Use enough zeros in the filename so that all the .au files will have the same number of digits.
    5. Press "Preview", and if the preview looks correct, hit "Rename"
  • On Mac OS X, try Applications > Automator.
  • On Linux, try the file manager Thunar included in the xfce desktop See here for help running Thunar on the Ubuntu desktop.


Linux command-line alternatives for time stamp sorting
  1. Open a terminal then "cd" into the directory that contains the .AU files.
  2. Type the following command in a terminal to sort and rename the files into numerical time stamp order:
    mkdir "renamed" | find -type f -name "*.au" -printf "cp %h/%f renamed/%h/%TY%Tm%Td-%TH%TM%TS_%f\n"|sh
  3. The file names produced in the "renamed" folder are not in a consecutive sequence suitable for the Audacity recovery utilities. Instead, use the Nyquist plugin Append Import to import the files end-to-end into Audacity automatically in file name order.

Limitations of automatic recovery utilities

  • There is a 2 GB maximum size for any WAV file created from the reconstructed temporary files. This implies no more than 2000 .au files can be recovered. Sometimes (probably due to bugs in the utilities) there can be errors when recovering only 1000 or so files. In that case you would need to split the .au files in the temporary or_data folder into two or more folders, each containing consecutively numbered files, and recover a separate WAV file from each folder.
  • Recovery of unedited mono recordings should be correct in most cases.
  • Recovery of unedited stereo recordings may recover with transposed left/right channels in places. This is because the files for each channel may have time stamps that are too close together to be correctly distinguished by the operating system.
  • If any of the project data has been edited, it is unlikely to recover correctly.

1.2 Audacity Recovery Utility

The 1.2 Audacity Recovery Utility assumes the project rate was 44100 Hz. If your project was at other than 44100 Hz, the recovered WAV file will be the wrong length and play at the wrong speed. To correct this after importing the recovery WAV file, click in the name of the track (by the downward-pointing arrow) then use "Set Rate" to choose the correct rate.

Windows and Linux

Follow the instructions on the Audacity Recovery Utility page. On Linux, you may need to install additional libraries before you can use the utility, following the instructions provided.

Mac

Download the following utilities instead which are ready-compiled with the necessary libraries:

Then follow the instructions on the Audacity Recovery Utility page from "About the Audacity Recovery Utility" onwards.

Other Tools / scripts

There is no implication that these tools will necessarily do what you want, nor have they necessarily been tested by Audacity Team.

File merge tools

  • It has been reported that AU files may be converted to WAV (for example in Audacity) then joined using the disk output utility in Winamp.

Scripts for GNU/Linux and Mac OS X

audacity_rescue.sh

This shell script can reassemble a few thousand .au files. It may be simpler to apply (at a bash terminal) than some of the solutions mentioned on this page, particularly for mono recordings.

SoX

  1. Using SoX, make a copy of the temp directory and its files from a mono recording:
    $ cp -r /tmp/audacity1.2-jbn ~/rescue
  2. Convert the AU files into raw (headerless) files. The files must already be time-sorted and numbered with leading zeroes:
    $ for f in b*.au ; do sox ${f} -t raw ${f}.raw ; done
  3. Concatenate the raw files together to make one long raw file. Concatenating the AU files together (each with its own header) would produce noise at the joins between each AU file.
    $ cat *.raw > bigfile.raw
  4. Finally, import the raw file into Audacity specifying the appropriate encoding, endianness, channels and sample rate.
Views
Useful External Links