Audacity doesn't complete conversion to MP3

Hi there,
I have been using the previous verson of Audacity happily for years on my Windows XP PC, when suddenly it stopped converting to MP3 properly. It would start saving and the program would suddenly stop and I’d get the white space appear on the Audacity screen. When I tried to close the program the message would be that it had encountered a problem and would close. So…I updated Audacity to the latest verson.

I installed Lame and FFmpeg and configured my preferences carefully following all the instructions. I mainly record drama from the BBC iPlayer, then convert it to MP3 for listening to later, or on my MP3 player. Well, I get the recording OK, but when it came to saving it as an MP3, it gets all the way to the end and the message comes up telling me how long everything took and giving me an option to stop or cancel, but then when I stop it - nothing! The recording hasn’t saved. All I have is the name of the recording I have made, only with an ‘0’ at the end of it. When I exit the program and re-start it, I get a message saying the previous recording didn’t complete properly and should it recover it. Even when it recovers it, the same thing happens. What am I doing wrong please?

Moderator note: no need to SHOUT Pauline, it’s considered bad netiquette on most every forum I know - I removed the shouting for you :slight_smile:

How much free disk space do you have?

Yeah. Disk space isn’t infinite. “It worked for years and suddenly stopped” is a flag on both the video and audio forums.

Koz

Sorry about the ‘Shouting’; I didn’t intend that at all. You emphasised that folks should state which OS they are using, so I was merely making it clear, that’s all.
Anyway, I’ve got plenty of disk space left. More than half. I store a lot of stuff on an external hard drive is why.
I am finding that if I retrieve a file after the Audacity program has crashed, it will save as an MP3 (sometimes) as long as there are no characters other than letters and numbers in the title and also if I change the ‘Host’ to an alternative, like Windows Direct Sound if I had recorded on MME and vice versa. It’s strange, but if I record something with one ‘Host’, I find I can’t record anything else afterwards on the same ‘Host’ - especially when I have closed Audacity and re-started it later. I just get a flickering at the left side of the window instead of the recording ‘Blue Lines’. I then have to stop the recording and alter the ‘Host’ so that it is different to the one used before. Only then it will start recording properly. It’s all so time-consuming; having to repeat operations over and over again, whereas the old version was so simple. I am beginning to wonder if it is any use uninstalling this version and trying to re-install the old one, just in case it had got corrupted before. I still have it archived. It seems a pity, but this version does seem to take up a lot more resources too. (When it is saving to MP3 I am scared to do anything else until it has finished!)

I’ve seen a similar report to this elsewhere on the forum. It was apparently solved by resetting preferences. The easiest way to do that is run the installer again and watch out for the “Additional Tasks” screen, where there is an option to “Reset Preferences”. After the installation is complete, start Audacity and when asked, confirm that you want to reset Preferences. “Host” should then default to MME, which is usually the most reliable option.

Thanks I’ll try that tomorrow and let you know. It is OK to just run the installer over the top of the existing installation then? I mean, I don’t have to uninstall anything first do I?

As long as you are using the default installation location (which I assume you did the first time), then just install it over the top, but ensure that you select the “Reset Preferences” option.

Perhaps if that forced the host back to MME, but I think this is more likely:

On some machines, launching Audacity then recording from the current Device Toolbar input would not record until the input was reselected.

which (we believe) is fixed in the upcoming 2.0.5 release.


Gale

Did you install the currently recommended LAME from Audacity Manual ?

Some old versions of LAME caused MP3 export to crash just at the point of completion which sounds like you are describing.

If that isn’t the problem then reset of Preferences using the 2.0.4 installer is certainly worth trying for the export problem.

I cannot see why that would be random behaviour. If the characters are Windows-invalid

  /  :  *  ?  "  <  >  |

then they should be rejected every time.


Gale

Thank you all for your kind suggestions and this is the latest:

I re-installed the program again but I’m afraid it didn’t fix the problem. When I started up Audacity, it did have MME as the Host, but when I started recording something, it would not record (just the flickering at the left side of the recording windows) Therefore, I changed it to Windows Direct Sound and it started recording immediately. (I would just say, that I did change the preferences slightly so that when I exported to MP3, I did not get the editing window, as I do not need it, and also I changed the interface so that it is rectangular, instead of ‘Hanning’ as I don’t like the four recording windows.

I have no other copies of LAME (lame_enc.dll) on my machine, as I deleted them all. (I have a copy archived on my external hard disk in case I should ever need it, but that’s all) However, I re-installed the correct Lame again just to be on the safe side.

I wasn’t using any of the characters Gale described in the names of my recordings; I use - ( ) - # and that’s about it. However, Audacity doesn’t seem to like them.

Anyway…I’ve been playing with it on and off all day and have now found that if I record with Windows Direct Sound and then before converting the recording to MP3, change it to MME again, it will save, although sometimes, although the window has counted down to 0, it will just sit there and the program has crashed. The message is ‘This program is not responding, end now or cancel, etc.’ I then find that the recording has saved, but Audacity has not cleared the duplicate recording with the ‘0’ it puts at the end of its title (I found with the old version of Audacity that it sometimes could not clean up its temporary files and I had to end the program)

So…through trial and error, I have managed to record quite a few bits and pieces today. I’ve even figured out how to trim a bit off the ends of my recordings! Hopefully then, this little ‘Bug’ that requires the constant changing of the ‘Host’ to record and convert, will be fixed in the next incarnation!

Once again, thank you all for your help.

My next suggestion is to try the new 2.0.5rc1 version. It is available here: https://forum.audacityteam.org/t/audacity-2-0-5-release-candidate-2-available-for-testing/31388/1
Install it in the same way and reset preferences during the installation. Again you can just install it over the top of your current version.

Thank you Steve. I have downloaded it, but I don’t feel brave enough yet to chance messing things up trying to put something right that I seem to have found a workaround for. It’s funny, but just now, I converted two recordings to MP3 and on both occasions, the countdown got down to the last second - just 1 sec remaining, when the program just hung again and wouldn’t go any further. However, when I tested the MP3s, they had converted perfectly-right to their ends! I was of course, left with Audacity’s duplicates, ending with ‘0’! This version must use a lot more resources than previous ones, because I don’t seem to be able to do anything at the same time the recording is converting. I have to stop everything and let it do its thing! Before I could just carry on doing anything. :unamused:

I think you will find the device selection and recording corrected in 2.0.5.

I don’t think that correction will help the MP3 hangs or crashes.

What are the Audacity “duplicates, ending with 0”? Do you mean these are files that Windows says are zero bytes in size? Are you overwriting previous MP3 files that had the same name?

And what else are you trying to do while exporting the MP3? Because Audacity may not be very safe when doing other things when exporting, we’ve tried to make it difficult to do that.

How long are the recordings you are converting?


Gale

Well I stream drama from the BBC iPlayer and record it with Audacity for listening to later or on my MP3 player.

After recording and perhaps doing a bit of editing, I export it to MP3 format. Audacity has always created another file with the same name as the one I have chosen for the recording, only ending it with an ‘0’ whilst it is converting. (I am sometimes, overwriting another file, but not always.)

When the conversion is complete, this temporary version is usually deleted. However, there seems to be a bug in this version of Audacity that more often than not, finishes the conversion (or almost finishes it, according to the progress window) which causes the program to crash and not clear up the temporary file it has created. I don’t mind that; I can always delete that myself (after I have tested my recording) The only thing is, the next time I start Audacity, it thinks it hasn’t finished the previous conversion and asks if it should recover the project. It does this, even if I have deleted its temporary files from Windows Temp Folder. I just tell it not to recover. Then I have to be careful to alter the Device Selection so that it is different from the one used before. I have got into a routine now of recording on Windows Direct Sound and exporting to MP3 on MME. And so on…

(NB My previous version of Audacity sometimes failed to clear up its temporary files and I had to force that to close too. Not very often though)

Oh, and my recordings vary between about fifteen minutes and one hour to very occasionally, ninety minutes, varying between the lengths of a short story or an radio play.

Also, when I say that I can’t do anything else whilst my recording is converting, I mean, surf the net or download or send e-mails. I daren’t even open another folder or open an office document. All of which was no problem with the previous version. I make sure that, before letting it convert, I have closed all websites and any open folders and just let it do its thing. Even then, more often than not, the program crashes at the end of the conversion!

Hope the above answers your questions?

I think all you are seeing is 0 for the file size and not refreshing the window (or the program does not support file in progress refresh).

There is no such bug known to us, so unfortunately we cannot fix it. I just successfully exported a 7 hours long MP3 from Audacity 2.0.5.

That’s good.

That is because you did not delete the “autosave” temporary project file. But it is dangerous to interfere with files and folders that Audacity uses.

As previously stated, I don’t think you will have the device selection issue if you use 2.0.5.

The device chosen is completely irrelevant to MP3 export.

That is a perfectly reasonable length, if you actually have sufficient disk space and the folder you are writing to does not have a space quota restriction set on it.

Which “previous version” of Audacity did you have? 1.2.6?

2.0.x is somewhat heavier than 1.2.6 but not so much that you should have to close all programs when editing or exporting. If you have a slower computer with only enough memory to run the operating system then you may find you have to close all programs in order to record without skips or duplications. Also, file writing will slow inadequate computers down.

What version of Windows are you using? Does your computer meet Audacity system requirements:
Audacity ® | Download for Windows ?

What bit rate do you export the MP3 at? Have you changed from the default 128 kbps? Click the “Options…” button when you export to check the bit rate.

What project rate (bottom left of the Audacity window) are you exporting at? Try sticking to 44100 Hz for recordings and exports.

You could reduce the Audacity priority. See point 20 here Missing features - Audacity Support (except reduce rather than increase the Audacity priority). This will make the Audacity export slower, but you can do other tasks more easily while exporting.


Gale

I have answered all your points in red at the ends of the various points. Quite honestly, all I want to do is to record whatever comes out of my speakers and then export it to MP3. I don’t need to do anything more complicated than that.

I would like to thank you for all your help and suggestions Gale. I am most grateful.

Yes, that is normal. The audio is first written as a temporary file with a “0” added to the name, and then renamed to the name that you set (the “0” is removed). This is necessary behaviour in order to handle overwriting files that may be in use in the current project. If the file was currently being used, Audacity will also make a back-up copy of the original file before overwriting it.

As Gale wrote, I’ve not come across such a bug either. I suspect that we are missing something that accounts for the behaviour.

When do you do that?
You should not ever need to delete Audacity’s temp files, and if you do so at the wrong time then it can cause all sorts of weird problems.

It’s your choice, but personally I’d be fixing those things that can be fixed so as to simplify trouble shooting the problem.

From what I can gather from this rather long and complicated forum topic, the main problem seems to be that Audacity exports the “__0.mp3” file, but then for some reason is unable to rename it and overwrite the original .mp3 file. What we need to find out is why the original file cannot be overwritten.
Is that file being used by any other program?
What is the exact file name and folder location of that file?
Are you logged in as an Administrator or a limited account?

I haven’t looked at the code but looking at it live in a file manager, it looks like when you overwrite an MP3, it renames the original file immediately by appending “0” to the file name, then commences writing the MP3 with the original name, then deletes the original MP3 that had “0” appended.

However I did not go into all that because Pauline said she only sometimes overwrites an existing MP3. I don’t see an explanation of the “0” for the normal case where Pauline is writing an MP3 that never existed before (unless that process is more complex than I believe).

Also since this is an MP3 I don’t see how Audacity could be using the file. As I understand it, Pauline is recording before exporting rather than importing files, but even if you imported an MP3 into Audacity and exported over it, Audacity isn’t using that MP3 file. It doesn’t need that file because it has copied its data into the project as uncompressed PCM, so you could equally delete the original MP3 before exporting then export to the original name.

Audacity should only be using the file if you import a WAV or AIFF and choose to “read it directly” from the original file instead of copying it in.

If it was a permissions problem I don’t see why Audacity would be allowed to start writing the MP3 file.

The only explanation I have at the moment is that we know from bug 137 that Audacity can behave very strangely if a file manager like Explorer has windows open at files that Audacity is reading or writing. Are you using Windows Explorer to monitor your files, Pauline, or some other program? I would try shutting down that program before recording and open it again after you have exported.


Gale

Yes, from a quick look at the code it appears to be that way round.

To be honest, I got a bit lost on the “steps to reproduce the issue”. I got the impression that sometimes Pauline is able to export successfully, but I’m not clear about when it works correctly and when it doesn’t. I can’t see how this could be related to the “host” setting, so I’m assuming that it is something else.

It looks like Audacity always does this “temporary export file” business, not only if it is a dependency. There’s a code comment that suggests that Audacity does this “just to be safe…” I can see why that makes sense - if for example, you started to export a long recording over another file and then cancelled the export, the original file will survive. On Windows XP, when exporting to the desktop the “+0” file appears on the Desktop and then disappears when the export is complete.

Neither do I - that’s the mystery. It appears that something is preventing the operation from completing, but we don’t know what.

I feel rather overwhelmed at all the suggestions and possible explanations about this. My head is spinning!

This morning, I successfully recorded and exported my first file of the day. Audacity even ‘beeped’ when it had completed. However, I then noticed that the Audacity window itself had ‘Frozen’ and the program had crashed. It had converted OK, and the counter had counted down to zero, but the temporary file with ‘0’ at the end was still there. I tested the comnverted file and it was fine, so I copied it to my Drama Folder just as I always do. Then I deleted the temporary file. I then closed down Audacity (a forced close) Then when I opened it again, as usual, it asked if it should recover the project. In this case I did not want that and it deleted its temporary files in the Temp folder normally.

Later, I made several more recordings and in every case, the conversion stopped halfway through and the program crashed. In these instances, I closed the program, then re-opened it and let it recover the projects, which it then converted properly in every case, but…the program still crashed at the end and didn’t clear up the temporary file it had created. I can’t understand the inconsistency; why it sometimes does and sometimes doesn’t!

I was wondering if over-writing files could be the cause. When recording a serial, of course, it is easier to record the first episode, copy it to another folder and then rename the original file with the next episode number. Maybe if I didn’t do this and named the recording at the time of conversion, do you think it would make a difference?

By the way, about using explorer and having the receiving file folder open; well I have done this, but I haven’t today, when the program was crashing all the time. I had thought about that.