Recovering crashes manually

From Audacity Wiki
Revision as of 22:06, 31 March 2006 by Davie (talk | contribs)
Jump to: navigation, search

How to recover unsaved data

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.

Note: This can be very difficult for long recordings. The Audacity developers are planning to add auto-recovery features to future versions of Audacity.

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

Audacity breaks tracks into "block files", each with about one megabyte of data. This allows Audacity to perform many editing tasks very quickly and efficiently. Without a saved project file, Audacity does not know how to assemble the blockfiles into tracks. You will need to assemble them manually.

Instructions

Check the "Directories" section of the Audacity preferences to find out where temporary files are stored.

(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.)

Use the "Import Audio" command in the Project to open all of the .au files in 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.

Audacity Recovery Utility

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:


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

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

% 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()

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

# 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 & right channels, so files
#should be written to our two recovery files alternately starting with the 3rd file in our list

#count serves as a quick hack to let us alternate recovery files
count = 1
#this is just to give a quick count so you can see if the two recovery files got the same number of files added to them
track_one_files = 1
track_two_files = 1
# for every other file, write from the data offset on
for i in files[2:]:
   	if count == 1:
		#write to first recovery file
   		dd = open(i, 'rb').read()[12380:]
   		fp.write(dd)
   		count = 0
		track_one_files = track_one_files + 1
   	else:
		#write to second recovery file
		dd = open(i, 'rb').read()[12380:]
   		fpp.write(dd)
		count = 1
		track_two_files = track_two_files + 1

print "Files recovered for track 1:"
print track_one_files
print "Files recovered for track 2:"
print track_two_files
# close recovered sound files
fp.close()
fpp.close()

I was unable to get sox to work as the above tip instructed. Sox always complained about a missing operation or misinterpreted the filename of one of the Audacity temp files as a filter to perform on the other files.

So, I used sox in a different way. I was trying to rescue an hour-long mono recording on a Unix-like system (a Fedora Core 3 GNU/Linux system). First, I made a copy of the temp directory and its files:

$ cp -r /tmp/audacity1.2-jbn ~/rescue

Then I used sox to convert the AU temp files into raw files (headerless files). Since Audacity had already numbered the files with leading zeroes (and perhaps because I didn't have that many of them to work on), I could use an ordinary shell wildcard to do the work:

$ for f in b*.au ; do sox ${f} -t raw ${f}.raw ; done

I concatenated the raw files together to make one hour-long mono raw file. I had to use raw files to do this, concatenating the AU files together (each with its own header) would have produced a periodic noise (because Audacity was trying to interpret the AU header data as sound data).

$ cat *.raw > bigfile.raw

And then I imported the raw file into Audacity specifying the appropriate number and signedness of the samples (16-bit signed PCM, in my case), endianness (Big-endian, in my case), channels (1 channel for mono), and sample rate (44,100 samples per second, in my case). I wanted to import the whole file (100%) starting from the beginning (0 byte offset).

I was left with a file I could export to WAV, play, and edit normally.


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.

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.

To recover files using this program:

  1. Figure out which file is the first file that is your recording by listening to the files in the temp directory
  2. Place the aud_recover program in your Audacity temp directory
  3. Run aud_recover and answer all the prompts
  4. 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 (if you don't know what options to choose, use the auinfo program on the file you figured out in the first step)
  5. 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.1


I recently have to kill audacity and as a result I lost the aup project file for my recording of 3000+ au files. What exactly should I do to restore the aup project file from the thousands au files?














































































































































































































































































































































































































BEST CASINO BEST CRAPS BEST POKER BEST ROULETTE CASINO FREE CASINOS BACCARAT INTERNET CRAPS INTERNET SLOTS ONLINE CASINO ONLINE CASINOS ONLINE SLOTS PLAY CASINO PLAY CASINOS PLAY CRAPS internet casino poker online poker gambling internet casino online casinos blackjack roulette craps slots bingo baccarat keno video poker PLAY ROULETTE ROULETTE SLOTS ONLINE VIDEO POKER BEST BLACKJACK BEST CASINO BEST CRAPS BEST POKER BEST ROULETTE BEST SLOTS BLACKJACK GAME BLACKJACK ONLINE BLACKJACK CASINO CASINOS ONLINE CRAPS GAME CRAPS FREE CASINO FREE CASINOS BEST-ONLINE-CASINO INTERNET BLACKJACK INTERNET CASINO INTERNET CASINOS INTERNET CRAPS INTERNET POKER ONLINE CASINOS ONLINE CRAPS ONLINE POKER ONLINE ROULETTE PLAY BLACKJACK PLAY CASINO PLAY CASINOS PLAY CRAPS PLAY POKER PLAY ROULETTE PLAY SLOTS POKER GAME POKER ROULETTE GAME ROULETTE ONLINE ROULETTE SLOTS GAME SLOTS ONLINE SLOTS BEST CASINO BEST CASINOS BEST CRAPS BEST POKER BLACKJACK CASINO GAMES CASINO ONLINE CASINO CASINOS ONLINE CASINOS CRAPS GAME CRAPS ONLINE CRAPS FREE CASINOS BINGO INTERNET BLACKJACK INTERNET CASINO INTERNET ROULETTE ONLINE BLACKJACK ONLINE CASINOS ONLINE CRAPS ONLINE POKER ONLINE ROULETTE ONLINE SLOTS PLAY CASINO PLAY CRAPS POKER GAME POKER ROOM POKER ROULETTE ONLINE ROULETTE SLOTS GAME SLOTS ONLINE SLOTS BEST BLACKJACK BEST CASINO BEST CRAPS BEST ROULETTE BEST SLOTS BLACKJACK ONLINE BLACKJACK CASINO GAMES CASINO ONLINE CASINO CASINOS CRAPS GAME CRAPS ONLINE FREE CASINOS BLACKJACK INTERNET CASINO INTERNET CRAPS INTERNET SLOTS ONLINE BLACKJACK ONLINE CASINO ONLINE CASINOS ONLINE ROULETTE ONLINE SLOTS PLAY CASINO PLAY CASINOS PLAY POKER PLAY SLOTS POKER GAME POKER ONLINE POKER ROOM POKER ROULETTE ONLINE ROULETTE SLOTS ONLINE SLOTS BEST BLACKJACK BEST SLOTS BLACKJACK GAME BLACKJACK ONLINE BLACKJACK CASINO GAMES CASINOS ONLINE CASINOS CRAPS ONLINE CASINO-BONUS ONLINE BLACKJACK ONLINE CASINOS ONLINE ROULETTE ONLINE SLOTS PLAY POKER POKER GAME POKER ROULETTE GAME ROULETTE ONLINE ROULETTE BEST BLACKJACK BEST CRAPS BEST SLOTS BLACKJACK GAME CASINO ONLINE FREE CASINOS CASINO-GAME-ONLINE INTERNET [1] INTERNET POKER INTERNET SLOTS ONLINE CASINO ONLINE CRAPS ONLINE POKER ONLINE SLOTS PLAY CRAPS PLAY POKER BEST BLACKJACK BEST CRAPS BLACKJACK ONLINE CASINO GAMES CASINO CASINO-JACKPOT INTERNET BLACKJACK INTERNET CASINO INTERNET CRAPS INTERNET ROULETTE ONLINE CASINO PLAY CASINO PLAY CRAPS PLAY SLOTS POKER ROOM ROULETTE ONLINE VIDEO POKER BEST ROULETTE BEST SLOTS BLACKJACK GAME CRAPS CASINO-RATINGS ONLINE BLACKJACK ONLINE POKER PLAY CASINO PLAY POKER PLAY SLOTS POKER ROULETTE ONLINE BEST BLACKJACK BEST CASINOS BEST CRAPS BEST ROULETTE CASINO GAMES CASINO ONLINE CASINOS ONLINE CASINOS CRAPS GAME FREE CASINO CASINO INTERNET CASINO INTERNET CASINOS INTERNET ROULETTE ONLINE CASINO ONLINE CASINOS ONLINE CRAPS ONLINE POKER ONLINE ROULETTE PLAY BLACKJACK PLAY CASINOS PLAY CRAPS PLAY POKER PLAY ROULETTE POKER GAME POKER ONLINE POKER ROULETTE GAME SLOTS GAME BEST BLACKJACK BEST CASINOS BEST ROULETTE BEST SLOTS BLACKJACK GAME BLACKJACK ONLINE BLACKJACK CASINO GAMES CASINO ONLINE CRAPS ONLINE CRAPS CRAPS INTERNET CASINO INTERNET CASINOS INTERNET CRAPS INTERNET POKER INTERNET SLOTS ONLINE CASINO ONLINE POKER ONLINE ROULETTE PLAY BLACKJACK PLAY CASINO PLAY CRAPS PLAY ROULETTE PLAY SLOTS POKER ONLINE POKER ROULETTE GAME ROULETTE ONLINE ROULETTE VIDEO POKER BEST CASINOS BEST SLOTS CASINO CRAPS GAME HOLD-EM-POKER INTERNET BLACKJACK INTERNET POKER ONLINE BLACKJACK ONLINE CASINOS POKER GAME POKER ROOM POKER ROULETTE SLOTS ONLINE BEST BLACKJACK BEST CASINOS BEST ROULETTE BEST SLOTS BLACKJACK GAME BLACKJACK CASINO GAMES CASINO ONLINE CASINO CASINOS CRAPS GAME CRAPS FREE CASINO INTERNET-CASINO INTERNET CASINO INTERNET CASINOS INTERNET ROULETTE ONLINE BLACKJACK ONLINE POKER ONLINE ROULETTE ONLINE SLOTS PLAY BLACKJACK PLAY CASINOS PLAY POKER POKER GAME POKER ROOM ROULETTE ONLINE ROULETTE VIDEO POKER BEST CASINO BEST CASINOS BEST CRAPS BLACKJACK CASINO GAMES CRAPS GAME CRAPS ONLINE CRAPS FREE CASINO NET-CASINO INTERNET CRAPS INTERNET POKER INTERNET SLOTS ONLINE POKER ONLINE SLOTS PLAY BLACKJACK PLAY CASINO PLAY CRAPS PLAY ROULETTE POKER GAME ROULETTE GAME VIDEO POKER BEST BLACKJACK BEST CASINOS BEST CRAPS BEST POKER BEST ROULETTE BEST SLOTS BLACKJACK GAME BLACKJACK ONLINE CASINO GAMES CASINO CASINOS CRAPS GAME CRAPS FREE CASINOS ON-LINE-POKER INTERNET BLACKJACK INTERNET CRAPS INTERNET POKER INTERNET ROULETTE ONLINE BLACKJACK ONLINE CASINO ONLINE CASINOS ONLINE CRAPS ONLINE POKER ONLINE ROULETTE ONLINE SLOTS PLAY CASINO PLAY POKER PLAY ROULETTE POKER GAME POKER ONLINE POKER ROOM POKER ROULETTE ONLINE ROULETTE SLOTS GAME SLOTS ONLINE VIDEO POKER BEST BLACKJACK BEST SLOTS BLACKJACK ONLINE BLACKJACK CASINOS ONLINE CASINOS ONLINE-CASINO-GAMBLING ONLINE CRAPS ONLINE POKER PLAY SLOTS SLOTS ONLINE VIDEO POKER BEST BLACKJACK BEST CASINO BEST CASINOS BEST CRAPS BEST POKER BEST ROULETTE BEST SLOTS BLACKJACK GAME BLACKJACK ONLINE BLACKJACK CASINO ONLINE CASINOS ONLINE CRAPS GAME CRAPS ONLINE CRAPS FREE CASINO ONLINE-CASINO-GAMES INTERNET BLACKJACK INTERNET CASINO INTERNET CASINOS INTERNET CRAPS INTERNET POKER INTERNET SLOTS ONLINE BLACKJACK ONLINE CASINO ONLINE CASINOS ONLINE CRAPS ONLINE POKER ONLINE ROULETTE PLAY BLACKJACK PLAY CASINO PLAY CRAPS PLAY POKER PLAY ROULETTE PLAY SLOTS POKER ONLINE POKER ROOM POKER ROULETTE GAME SLOTS GAME SLOTS BEST CASINO BEST CASINOS BEST CRAPS BEST POKER BEST SLOTS BLACKJACK GAME BLACKJACK ONLINE CASINO GAMES CASINO CASINOS CRAPS GAME CRAPS ONLINE CRAPS FREE CASINO FREE CASINOS ONLINE-CASINO-NEWS INTERNET BLACKJACK INTERNET CASINO INTERNET CASINOS INTERNET POKER INTERNET SLOTS ONLINE BLACKJACK ONLINE CASINO ONLINE CRAPS ONLINE SLOTS PLAY BLACKJACK PLAY CASINO PLAY CASINOS PLAY CRAPS PLAY POKER PLAY SLOTS POKER SLOTS ONLINE VIDEO POKER BEST CASINO BEST POKER BLACKJACK GAME CASINOS CRAPS ONLINE CRAPS ONLINE-CASINO ONLINE BLACKJACK ONLINE CASINOS ONLINE CRAPS ONLINE SLOTS PLAY CASINOS POKER ONLINE POKER ROOM SLOTS GAME SLOTS ONLINE BEST BLACKJACK BEST CASINO BEST CASINOS BEST CRAPS BEST POKER BEST ROULETTE BEST SLOTS BLACKJACK GAME BLACKJACK ONLINE BLACKJACK CASINO ONLINE CASINO CASINOS ONLINE CASINOS CRAPS GAME CRAPS ONLINE CRAPS FREE CASINO ONLINE-CASINOS INTERNET BLACKJACK INTERNET CASINO INTERNET CASINOS INTERNET CRAPS INTERNET POKER INTERNET ROULETTE ONLINE BLACKJACK ONLINE CASINOS ONLINE CRAPS ONLINE SLOTS PLAY BLACKJACK PLAY CASINO PLAY POKER PLAY ROULETTE PLAY SLOTS POKER GAME POKER ROOM POKER ROULETTE GAME ROULETTE ONLINE SLOTS GAME VIDEO POKER BEST POKER BEST SLOTS BLACKJACK ONLINE CASINO ONLINE CASINO CASINOS ONLINE CASINOS CRAPS PARTY-POKER INTERNET BLACKJACK INTERNET CASINO INTERNET ROULETTE ONLINE BLACKJACK ONLINE CRAPS ONLINE POKER ONLINE ROULETTE ONLINE SLOTS PLAY BLACKJACK PLAY CASINO PLAY POKER POKER GAME POKER ONLINE POKER ROOM SLOTS GAME BEST CASINOS BEST CRAPS BEST POKER BLACKJACK ONLINE BLACKJACK CASINO GAMES CASINO ONLINE CASINO CASINOS ONLINE CASINOS CRAPS FREE CASINOS POKER-TABLES INTERNET CASINOS INTERNET CRAPS INTERNET POKER ONLINE BLACKJACK ONLINE CASINO ONLINE CRAPS ONLINE POKER ONLINE SLOTS PLAY BLACKJACK PLAY CASINOS PLAY CRAPS PLAY SLOTS POKER SLOTS GAME SLOTS VIDEO POKER BEST BLACKJACK BEST CASINO BEST CASINOS BEST CRAPS BEST POKER BEST ROULETTE BLACKJACK CASINOS ONLINE CASINOS CRAPS POKER INTERNET BLACKJACK INTERNET CASINO INTERNET CASINOS INTERNET POKER ONLINE BLACKJACK ONLINE ROULETTE ONLINE SLOTS PLAY BLACKJACK PLAY CASINO PLAY CASINOS PLAY CRAPS PLAY ROULETTE PLAY SLOTS POKER GAME POKER ROOM ROULETTE SLOTS GAME SLOTS BEST BLACKJACK BEST SLOTS BLACKJACK GAME ROULETTE ONLINE CASINOS ONLINE POKER PLAY BLACKJACK PLAY ROULETTE POKER GAME POKER ROOM ROULETTE GAME ROULETTE ONLINE ROULETTE BEST BLACKJACK BEST CASINO BEST CASINOS BEST CRAPS BEST SLOTS CASINO GAMES CASINO ONLINE CASINOS CRAPS GAME FREE CASINO RULES-POKER INTERNET BLACKJACK INTERNET CRAPS INTERNET POKER INTERNET ROULETTE INTERNET SLOTS ONLINE CASINO ONLINE CASINOS ONLINE POKER ONLINE ROULETTE ONLINE SLOTS PLAY CASINO PLAY CRAPS PLAY SLOTS POKER GAME POKER ROOM POKER ROULETTE SLOTS GAME BEST CASINO BEST CASINOS BEST ROULETTE BEST SLOTS BLACKJACK ONLINE CASINO CASINOS ONLINE FREE CASINO FREE CASINOS SPORTS-GAMBLING INTERNET CASINO INTERNET CASINOS INTERNET POKER INTERNET ROULETTE ONLINE BLACKJACK ONLINE CASINO ONLINE CRAPS ONLINE POKER ONLINE ROULETTE ONLINE SLOTS PLAY BLACKJACK PLAY CASINO PLAY CASINOS PLAY POKER PLAY SLOTS POKER GAME POKER ONLINE POKER ROOM POKER ROULETTE GAME ROULETTE ONLINE

SLOTS