Today I wanted to record two sessions of about 1 hour with Audacity 2.2.0 which I have just downloaded from the official site. The way I did it was like this:
- Started Audacity
- Clicked “Record”
- Clicked “Stop”
- Clicked on Save Project (in the Audacity’s format)
- Deleted the track (clicked on the little X)
- Clicked “Record”
- Clicked “Stop”
- Clicked on Save Project As, saved under a different name in the same directory
What I got was that the second project save went ok, but the FIRST one was mangled: when I later tried to open the first one, Audacity complained about orphaned files (a lot of them). When I ignored the orphaned files, it turned out that the first project and the second project contained identical audio. You’ve read it correct: two projects, saved under different names, now contained the same audio data.
So I had the second audio, exported it ASAP in FLAC so I don’t mess it up and tried to figure out how to recover the audio from the first one.
It looked like Audacity could open individual audio files (*.au) from the project _data, and googling around showed that I’d need to order the files by their timestamps (why on Earth would someone generate random filenames for this purpose instead of sequential is beyond comprehension), and then concatenate every second one to get a single track of a stereo pair. Since my data is mono, just recorded as stereo, I just sorted the files and discarded every second one. This seems to produce the correct results.
Now, I’ve tested this by importing a couple of tracks into Audacity, doing Select->All, then Tracks->Align->End to end, and it works.
However, when I added all the tracks to Audacity (the computer has enough RAM), it crashed on any operation (I tried Tracks->Mix, and File->Save Other->WAV). Always. Without exception. Once it was able to produce a crash report, but as it didn’t save it in My Documents or in my user’s home folder, or in its installation directory, I have no idea how to get to it.
By trial and error, I’ve found that this crash happens if the number of tracks is larger than about 255 or 256. As long as the number of tracks I’m importing is less than 256, it works ok. So I solved my problem by importing batches of 240-ish *.au files, doing Select->All and Align->End to end, then Tracks->Mix and saving them as FLAC, then after I was done I concatenated all the FLAC files in the same way, so I’ve managed to restore the audio data.
When I restored it, I found that the restored audio - and remember, this was from the FIRST project saved - contained ALL of the audio data, for both sessions. So it looks like the second session continued to be recorded in the FIRST project’s _data, and when I did a Save Project As, BOTH the first project’s .aup file and the second project’s .aup suddenly contained only the information about the SECOND session, while the first project’s _data contained data for BOTH sessions. The second project’s _data contained only data for the second sessions, as expected. Weird, right? Like something in the Save Project / Save Project As code path mixes the two up.
So, the good news is that no data was lost, and the bad news is that… well, I know this is an ancient project, but come on… firstly, recording data to files and saving them in proprietary format (this .au is not the “standard” .au, I’ve checked, it’s got Audacity-specific headers and VLC cannot read them), then naming the files pretty much randomly when sequential naming would be fine (with a different suffix per channel, perhaps?), then using an 8-bit counter somewhere for the tracks?
As I couldn’t find a way to do a proper bug report on the website and the wiki, I’ve thought that at least writing this up in a forum would help future users and perhaps someone will get a lightbulb moment and know how to fix some of this.