Difference between revisions of "Recovering crashes manually"

From Audacity Wiki
Jump to: navigation, search
m
m (+deprecated)
 
(80 intermediate revisions by 16 users not shown)
Line 1: Line 1:
== How to recover unsaved data ==
+
{{deprecated}}
 +
{{intro|If Audacity crashes or the computer loses power, Audacity should normally [https://manual.audacityteam.org/man/recovery.html recover the projects automatically] when you restart. The steps on this page describe how to recover audio from the project's _data folder or Audacity's temporary folder if:
 +
* Automatic Crash Recovery does not work correctly
 +
* You saved a project without apparent crash, but Audacity was shut down before the AUP project file was written or you do not have a usable AUP file.
 +
'''The steps on this page will only recover unedited recordings''' (and stereo recordings may be recovered with sections of left and right channel in the wrong channel).
 +
{{advice|This only works for Audacity 2.4.2 and earlier,  It does '''not''' work on Audacity 3.0.0 and later which uses a single consolidated unitary project file. }} }}
 +
{{alert|'''If the Automatic Crash Recovery dialog has appeared but recovery is incorrect, do not close the project 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.
 +
* If you had successfully saved the project just before the crash, it may be simpler to discard the unsaved project in the Automatic Crash Recovery dialog then open the saved AUP file.}}
 +
__TOC__
  
If Audacity is not able to shut down properly (e.g. because the program crashes, or the computer loses power suddenly), then unsaved data may be left in Audacity's temporary files folder.  These instructions can help you recover that unsaved data.
+
== Location of the project _data folder ==
  
: Note:  This can be very difficult for long recordings.  The Audacity developers are planning to add auto-recovery features to future versions of Audacity.
+
If you saved an AUP project file, the _data folder you need to recover from will be in the directory to which you originally saved the AUP file.  
  
When you first launch Audacity after a crash, a dialog will appear warning you that there are still files in the temporary folder. It will ask if you want to delete the files. Say "no."  (If you were editing an existing project, then the files may be in the project_data folder instead of the temp folder.)
+
== Location of Temporary Folder ==
 +
If you never saved an AUP project file, you need to recover from Audacity's temporary folder. You can see the exact location in [[Directories Preferences]], otherwise you can see the location in the "TempDir" line in the [[Preferences#stored|audacity.cfg settings file]]. By default the Audacity temporary folder should be as follows.
 +
* '''Windows:''' {{path|C:\Users\<your username>\AppData\Local\Audacity\SessionData}}
 +
* '''Mac:''' {{path|/Users/<your username>/Library/Application Support/audacity/SessionData}}
 +
* '''GNU/Linux:''' {{path|/var/tmp/audacity-<your username>}}
 +
If you are upgrading from previous Audacity, that version's temporary directory may be changed to the relevant safe location above if the previous location was known to be prone to deletion by cleanup applications or system restart.
 +
{{tip|1=In order to see the default location of the Audacity temp folder on Windows or Mac you need to show hidden files and folders or type the folder location into your file manager's address bar.
 +
* '''Windows:''' In the tree on the left of Explorer, double-click "Users" then double-click your username, then on the right, open the AppData or Application Data folder, then the "Local" or "Locale Settings" folder and finally the "Temp" folder. <p>If you cannot see those folders, you can type '''%localappdata%''' into the Explorer address bar then look for the "Temp" folder. Otherwise, see how to [http://www.bleepingcomputer.com/tutorials/how-to-see-hidden-files-in-windows/ show hidden files and folders].</p>
 +
* '''Mac:''' Open Finder, use the "Go" menu, choose "Go to Folder" and type the required path.
 +
<ul>If that does not work, try to make the Finder show its hidden files and folders by entering the following commands in the terminal:
 +
{{Codelist|
 +
* defaults write com.apple.finder AppleShowAllFiles TRUE
 +
* killall Finder
 +
}}
 +
then relaunch Finder to show the hidden files. Alternatively, try [http://www.bresink.com/osx/TinkerTool.html TinkerTool] to do the same thing, or you can type Shift-Command-Period(.) to show or hide hidden files and folders in an Open or Save dialog.</ul>}}
  
Audacity breaks tracks into "block files", each with about one megabyte of dataThis allows Audacity to perform many editing tasks very quickly and efficientlyWithout a saved project file, Audacity does not know how to assemble the blockfiles into tracksYou will need to assemble them manually.
+
== 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 folderUse shift-click or control-click to select multiple filesThe files will be in approximately 6-second chunks and will be on separate tracks in the Audacity screenFiles from stereo tracks will alternate between left and right channels.
  
NOTE:  As of 20060409, none of the information here works for Audacity 1.3x. For one thing, the temporary files are not numbered decimal sequentially. If the files are sorted by the date they were created, and then renamed in that order as if they came from 1.2.x, then they should recover OK. The next release of audacity will automate this process.
+
#Click in the Track Control Panel (by the Mute/Solo buttons) of the topmost track.
 +
#Shortcut {{shortcut|Z}} or {{menu|Select > Region > Ends to Zero Crossings}}.
 +
# {{menu|Edit > Remove Special > Trim}}.
 +
#Click in the Track Control Panel of the first track you want to join to the topmost track.
 +
#Shortcut {{shortcut|Z}} or {{menu|Edit > Find Zero Crossings}}.
 +
#Shortcut {{shortcut|Z}} or {{menu|Select > Region > Ends to Zero Crossings}}.  
 +
#Click after the end of the topmost track.
 +
#Press {{shortcut|End}} on the keyboard.
 +
#Click {{menu|Edit > Paste}} and the cut track will attach to the end of the topmost track.
 +
#Repeat as necessary to join all the tracks onto the topmost track.
  
== Instructions ==
+
Play the result.
  
Check the "Directories" section of the Audacity preferences to find out where temporary files are stored.
+
Cut and paste as needed if any files are found to be in the wrong order or the wrong channel.
  
(Mac users:  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/INSERT_FOLDER_NAME_HERE" in the Terminal.)
+
==Automatic recovery tools==
 +
Tools written for legacy Audacity 1.2 can automate data recovery.
 +
{{advice|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:
  
Use the "Import Audio" command in the Project to open all of the .au files in
+
::b001.au 15:56:02
Audacity's temp folder. Use shift-click or control-click to select multiple files. The files will be in approximately 10-second chunks. Files from stereo tracks will alternate between left and right channels. You can use copy/paste to re-assemble the original tracks.
+
::b002.au 15:56:02
 +
::b003.au 15:56:10
 +
::b004.au 15:56:10
 +
{{Hint|1='''Utilities for renaming files to consecutive alphanumerical order'''
 +
<ul><li>On '''Windows,''' Explorer cannot rename to a sequence acceptable to the recovery tools. You can use instead the Mass Rename tool in the 21-day trial Professional or Ultimate versions of [http://zabkat.com/x2down.htm xplorer<sup>2</sup>]. These versions will let you recover an unedited stereo recording with exact allocation of left and right channels, if Windows is running the [https://en.wikipedia.org/wiki/NTFS NTFS] file system. The [http://zabkat.com/x2lite.htm free version of xplorer<sup>2</sup>] cannot guarantee correct channel allocation.  
 +
<ol>
 +
<li>''(only in the Professional and Ultimate versions)'' Click {{menu|View > Raw Contents}} to enable maximum date resolution. 
 +
<li> Open the required folder in xplorer<sup>2</sup> and sort the .au files by time modified as above.
 +
<li>{{shortcut|Ctrl + A}} to select all the files.  
 +
<li> File > Mass Rename.
 +
<li> 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 file name so that all the .au files will have the same number of digits.
 +
<li> Press "Preview", and if the preview looks correct, hit "Rename"</ol>
 +
<li>On '''Mac''', try Applications > [http://www.macosxautomation.com/automator/ Automator].
 +
<li>On '''Linux''', try the file manager [http://en.wikipedia.org/wiki/Thunar Thunar] included in the [http://xfce.org/ xfce desktop] See [http://www.ubuntugeek.com/switch-to-a-lightweight-filemanager.html here] for help running Thunar on the Ubuntu desktop.  
 +
</ul>}}
  
=== Audacity Recovery Utility ===
+
{{note|1='''Linux command-line alternatives for timestamp sorting'''
 +
<ol><li>Open a terminal then "cd" into the directory that contains the .AU files.
 +
<li> Type the following command in a terminal to sort and rename the files into numerical timestamp order:<br>
 +
'''<nowiki>mkdir "renamed" | find -type f -name "*.au" -printf "cp %h/%f renamed/%h/%TY%Tm%Td-%TH%TM%TS_%f\n"|sh</nowiki>'''
 +
<li>The file names produced in the "renamed" folder are '''not''' in a consecutive sequence suitable for the Audacity recovery utilities. Instead, use the [https://wiki.audacityteam.org/wiki/Nyquist_Plugins Nyquist] plug-in [https://forum.audacityteam.org/viewtopic.php?f=42&t=59528 Append Import] to import the files end-to-end into Audacity automatically in file name order. 
 +
</ol>
 +
}}
  
The following program was written by an Audacity developer to help with crash recovery.  It still needs more testing, so please write to [email protected] to let us know whether it works for you:
+
<div id="limitations"></div> 
 +
=== Limitations of automatic recovery utilities ===
  
* http://www.mesw.de/audacity/recovery/
+
*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. Channel allocation will only be correct if you are using the NTFS (Windows) or [https://en.wikipedia.org/wiki/Ext4 ext 4] (Linux) file system and if your file manager supports sufficiently fine date resolution (see the Windows example above). This is because the files for each channel may have timestamps that are too close together to be correctly distinguished by other file systems. 
 +
* If any of the project data has been edited, it is unlikely to recover correctly.
  
=== Aud_Recover command-line recovery utility ===
+
== Other Tools / scripts  ==
 +
{{note|There is no implication that these tools will necessarily do what you want, nor have they necessarily been tested by Audacity Team.}} 
  
<span style="color:red"> NOTE: At the time of writing all the links below to this utility are dead.</span>
+
=== Scripts for GNU/Linux and Mac ===
  
This is a portable command line program by Tyler Knott which does much the same as the Audacity Recovery Utility but is not written in python/ wxpython, so does not need those libraries in order to compile it.  
+
==== audacity_rescue.sh ====
 +
This [https://gist.github.com/mef/2c90295920dc66f669a6 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.
  
I recently was editing a file I recorded with Audacity and it crashed before I had saved it. Since I didn't want to re-record the file I wrote a reasonably-portable* C program to recover the file. This program worked extremely well so I polished it up (I added tons of file I/O error checking and rewrote some parts of it) as well as a companion utility (auinfo) to get the file info (required for the Import Raw Data dialog)This program is different from others in that it gets the header length from the .au file, instead of guessing it or ignoring that there is a header, and that it requires no other external programs/interpreters to run (once it's compiled).  This program will also work with files that have the wrong type of endianness for the platform it's run on.
+
==== SoX ====
 +
<ol>
 +
<li>Using [http://sox.sourceforge.net/ SoX], make a copy of the temp directory and its files from a mono recording:
 +
{{code|$ cp -r /tmp/audacity1.2-jbn ~/rescue}}
 +
<li>Convert the AU files into raw (headerless) files. The files must already be time-sorted and numbered with leading zeroes:
 +
{{code|$ for f in *.au ; do sox ${f} -t raw ${f}.raw ; done}}
 +
<li>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.   
 +
{{code|$ cat *.raw > bigfile.raw}}
 +
<li>Finally, import the raw file into Audacity specifying the appropriate encoding, endianness, channels and sample rate.
 +
</ol>
  
The programs are too long to post here (over 300 lines total), so I'm hosting them on my webspace at http://webpages.charter.net/tknott/audacity-recover.zip (26k)  They are both licensed under the GNU GLP.  The zip file includes the source code, Win32 executables, and a copy of the GNU GPL.  I might get a chance to compile these programs for Mac OS X next week.  If I do I'll post the binaries then.
+
{{CategoryTips}}
 
 
To recover files using this program:
 
#Figure out which file is the first file that is your recording by listening to the files in the temp directory
 
#Place the aud_recover program in your Audacity temp directory
 
#Run aud_recover and answer all the prompts
 
#You should get one or two files (depending on whether the file is stereo or mono), you need to import these into Audacity using the Import Raw Data option. This option will ask you a series of questions about the data you're importing. The tool auinfo can examine your temporary files to tell you this information. To use it, call auinfo from the command line and provide as an argument the file that you figured out in the first step. For example, C:\audacity_1_2_temp>auinfo.exe b00000.au
 
#For stereo files set the left channel to left, the right channel to right, then select "Make Stereo Track" from the track popdown menu
 
 
 
The resulting file should be exactly what was recorded before Audacity crashed/was unexpectedly terminated.
 
 
 
(*By reasonably portable I mean that it should compile on at least everything that Audacity compiles on, for Macs you'll need to modify the source file for auinfo slightly (see the file for instructions).)
 
------
 
I recently received an e-mail from Richard Ash (richardash1981 at yahoo dot co dot uk) who made some small improvements to the source so it works better in *nix environments, as well as including a makefile.  The changes do not affect Windows envirionments.  You can get the improved version (without Windows binaries) at http://webpages.charter.net/tknott/audacity-recover.tar.gz (17k)
 
------
 
I recently received a few bug reports (thanks Robert Piche and Martin Kirst!) and had a bit of free time so I've updated aud_recover and auinfo to version 1.1.0 (and I started versioning them :D).  Here are the changes:
 
*aud_recover and auinfo now take command line options.  See their -? or --usage for options for usage info.
 
*aud_recover now supports up to 16 channels.
 
**(For those interested in the source code: As a result I also simplified the main processing loop in main())
 
*Fixed bug in aud_recover involving channel selection.
 
*Includes previous contributions from Richard Ash
 
 
 
The new version (including the source code, *nix makefiles, and Windows binaries) can be found here: http://webpages.charter.net/tknott/audacity-recover1.1.0.zip (42k)
 
 
 
If you have any questions, comments, or bug reports please don't hesitate to e-mail me at tknott *at* gmail *dot* com
 
------
 
A new version of aud_recover (1.1.1) is available that fixes a serious programming error in the previous release.  Windows binares are available here: http://webpages.charter.net/tknott/aud_recover-1.1.1-win32.zip
 
and Linux binaries (compiled on Slackware 10.2 for x86) with sourcecode are available here:
 
http://webpages.charter.net/tknott/aud_recover-1.1.1-linux.tar.gz
 
 
 
All aud_recover users using version 1.1.0 are strongly encouraged to upgrade to 1.1.
 
 
 
----
 
 
 
=== Other Tools ===
 
 
 
This freeware tool can automatically join large numbers of files.  (Note: One Audacity user reported an audible noise at the places where the files were joined.)
 
 
 
* 123 Audio Video Merger: http://www.manitools.com/123avm/
 
 
 
* tail and cat (On Linux/UNIX systems)
 
    - I found that 123 AV Merger gave me exactly what I would get with cat.
 
    I  was able to get around this with the following procedure:
 
    1. I had to throw out all odd-numbered files (1,3,5...)
 
    2. Using tail's byte-count switch "-c" I copied each remaining .au to a new .au.tmp file
 
    3. Using cat I  ran all the .au.tmp files into on long .au
 
    4. Imported the final .au with "Import RAW Data"
 
    5. Exported the track as wav
 
 
 
    I played around with exactly how many bytes to tail until there was no longer any sharp noises at each joint. I don't have that number with me right now - I'll try to get it later.
 
This could be theoretically written into a script. I'll try to add more details later.
 
----
 
<a href="http://sox.sourceforge.net/">sox</a> can concatenate the files together.
 
 
 
Usage: sox file1 .. filen outfile
 
 
 
(Sox can handle up to 32 files at a time.)
 
 
 
e.g. for a mono recording:
 
  % sox b0000*.au b0001*.au b0002*.au junk0.au
 
 
 
After I'm done, I have just several au files to import (a lot fewer than before).
 
----
 
I found it easier to write the following Python script that I used under Mac OS X to recover 1.2GB of data.  It was easier than the above solutions.
 
<pre>
 
% cat recover.py
 
 
 
# python script to recover audacity recording after crash
 
 
 
import os
 
 
 
directory = raw_input('Enter directory where temp data files are: ')
 
 
 
rawfiles = os.listdir(directory)  # grab directory listing
 
 
 
files = []          # only interested in .au files and
 
for i in rawfiles:  # prepend each with the directory name
 
  if i[-3:] == '.au': files.append(directory '/' i)
 
 
 
files.sort()  # sort files so the result will be in proper sequence
 
 
 
# open the output file for the recovery
 
fp = open('recover.au','wb')
 
 
 
# write the whole first file because it has the header
 
dd = open(files[0],'rb').read()
 
fp.write(dd)
 
 
 
# for every other file, write from the data offset on
 
for i in files[1:]:
 
  dd = open(i, 'rb').read()[12380:]
 
  fp.write(dd)
 
 
 
# close recovered sound file
 
fp.close()
 
</pre>
 
 
 
I had problems using the above script.  I found that it didn't really write every other file, so if you try to recovery stereo recordings you get a nasty echo effect since every other file is the left or right channel.
 
 
 
<i>The problem with the script above is that you coded the slice wrong:
 
<pre>
 
>>> x=(1,2,3,4,5,6,7,8,9,10)  # sample data
 
>>> x[1:]                    # doesn't do what you wanted
 
(2, 3, 4, 5, 6, 7, 8, 9, 10)
 
>>> x[::2]                    # this gets the odd-numbered items
 
(1, 3, 5, 7, 9)
 
>>> x[1::2]                  # this gets the even-numbered ones
 
(2, 4, 6, 8, 10)
 
</pre>
 
So, you just need to change the line "for i in files[1:]:" to either "for i in files[::2]:" (for the first channel), or "for i in files[1::2]:" (for the other).</i>
 
 
 
I wrote this modified version of the script to try to put the two tracks into two recovery files.  Unfortunately, just importing the recovered files doesn't seem to give you perfect stereo again because of sync issues, possibly due to missing files in the recovery set.  Give it a shot, it might work for you.
 
 
 
<pre>
 
# python script to recover audacity recording after crash
 
 
 
import os
 
 
 
directory = raw_input('Enter directory where temp data files are: ')
 
 
 
rawfiles = os.listdir(directory)  # grab directory listing
 
 
 
files = []          # only interested in .au files and
 
for i in rawfiles:  # prepend each with the directory name
 
  if i[-3:] == '.au': files.append(directory '/' i)
 
 
 
files.sort()  # sort files so the result will be in proper sequence
 
 
 
# open the output file for the recovery
 
fp = open('recover.au','wb')
 
 
 
# write the whole first file because it has the header
 
dd = open(files[0],'rb').read()
 
fp.write(dd)
 
 
 
#this is intented for recoverying stereo and the second file should be the
 
# first part of the second track, so write the whole file.
 
 
 
fpp = open('recover2.au','wb')
 
# write the whole second file because it has the header for track 2
 
dd = open(files[1],'rb').read()
 
fpp.write(dd)
 
 
 
#it's stereo, so the .au files should alternate left</pre>
 

Latest revision as of 12:50, 19 August 2021

Warning icon This page has been deprecated.
The information on this page are likely out-of-date and will not be updated in the forseeable future. It may be removed at any time.
If Audacity crashes or the computer loses power, Audacity should normally recover the projects automatically when you restart. The steps on this page describe how to recover audio from the project's _data folder or Audacity's temporary folder if:
  • Automatic Crash Recovery does not work correctly
  • You saved a project without apparent crash, but Audacity was shut down before the AUP project file was written or you do not have a usable AUP file.

The steps on this page will only recover unedited recordings (and stereo recordings may be recovered with sections of left and right channel in the wrong channel).

Warning icon This only works for Audacity 2.4.2 and earlier, It does not work on Audacity 3.0.0 and later which uses a single consolidated unitary project file.
Warning icon If the Automatic Crash Recovery dialog has appeared but recovery is incorrect, do not close the project 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.
  • If you had successfully saved the project just before the crash, it may be simpler to discard the unsaved project in the Automatic Crash Recovery dialog then open the saved AUP file.

Location of the project _data folder

If you saved an AUP project file, the _data folder you need to recover from will be in the directory to which you originally saved the AUP file.

Location of Temporary Folder

If you never saved an AUP project file, you need to recover from Audacity's temporary folder. You can see the exact location in Directories Preferences, otherwise you can see the location in the "TempDir" line in the audacity.cfg settings file. By default the Audacity temporary folder should be as follows.

  • Windows: C:\Users\<your username>\AppData\Local\Audacity\SessionData
  • Mac: /Users/<your username>/Library/Application Support/audacity/SessionData
  • GNU/Linux: /var/tmp/audacity-<your username>

If you are upgrading from previous Audacity, that version's temporary directory may be changed to the relevant safe location above if the previous location was known to be prone to deletion by cleanup applications or system restart.

Bulb icon In order to see the default location of the Audacity temp folder on Windows or Mac you need to show hidden files and folders or type the folder location into your file manager's address bar.
  • Windows: In the tree on the left of Explorer, double-click "Users" then double-click your username, then on the right, open the AppData or Application Data folder, then the "Local" or "Locale Settings" folder and finally the "Temp" folder.

    If you cannot see those folders, you can type %localappdata% into the Explorer address bar then look for the "Temp" folder. Otherwise, see how to show hidden files and folders.

  • Mac: Open Finder, use the "Go" menu, choose "Go to Folder" and type the required path.
    If that does not 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 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. Shortcut Z or Select > Region > Ends to 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. Shortcut Z or Edit > Find Zero Crossings.
  6. Shortcut Z or Select > Region > Ends to Zero Crossings.
  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 21-day trial Professional or Ultimate versions of xplorer2. These versions will let you recover an unedited stereo recording with exact allocation of left and right channels, if Windows is running the NTFS file system. The free version of xplorer2 cannot guarantee correct channel allocation.
    1. (only in the Professional and Ultimate versions) Click View > Raw Contents to enable maximum date resolution.
    2. Open the required folder in xplorer2 and sort the .au files by time modified as above.
    3. Ctrl + A to select all the files.
    4. File > Mass Rename.
    5. 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 file name so that all the .au files will have the same number of digits.
    6. Press "Preview", and if the preview looks correct, hit "Rename"
  • On Mac, 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 timestamp 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 timestamp 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 plug-in 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. Channel allocation will only be correct if you are using the NTFS (Windows) or ext 4 (Linux) file system and if your file manager supports sufficiently fine date resolution (see the Windows example above). This is because the files for each channel may have timestamps that are too close together to be correctly distinguished by other file systems.
  • If any of the project data has been edited, it is unlikely to recover correctly.

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.

Scripts for GNU/Linux and Mac

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 *.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.