Page 1 of 1

Audacity 1.3 Beta (Unicode) altering sample format randomly?

Posted: Wed Oct 05, 2011 1:57 am
by Catloaf
Hello, I seem to be having a problem with Audacity 1.3 Beta (Unicode). I use Audacity to convert and edit music and sound files for use with Half-Life DJ. The program usually works perfectly. However, I have noticed a strange problem. The program will often and seemingly randomly change the sample format from 16-bit to 32-bit with no warning after I export the file as a WAV. I'm not sure what causes this, but it seems to happen much more frequently when I edit a file before exporting it (extending a song, for example). It also happens occasionally when an unedited file is saved in proper HLDJ format (16-bit sample format, 12000hz project rate, only one track which is set to mono). The files end up failing to play correctly after I load them in HLDJ, and will not stay in 16-bit even if I edit them again and re-save them. I can't seem to figure out the root of the problem or to find any help online. If anyone could tell me how to work around or fix this, I'd really appreciate it.

System specifications for anyone who can use them to help:

Computer Model (Desktop): Inspiron 537

OS: 64x, running Windows Vista Home Premium 64-bit

RAM: 4GB (4060MB)

CPU: Single core running at 2.2GHz

GPU: Intel G41 Express Integrated Chipset

Re: Audacity 1.3 Beta (Unicode) altering sample format rando

Posted: Wed Oct 05, 2011 3:03 am
by Gale Andrews
Thanks for the report. Please check at Help > About Audacity that you are using the latest 1.3.13 Beta.

What application says the files are not 16-bit? If they were 32-bit they would be twice the file size of a 16-bit file of the same length.

Are you exporting from Audacity using "WAV (Microsoft) signed 16 bit PCM"?



Gale
Catloaf wrote:Hello, I seem to be having a problem with Audacity 1.3 Beta (Unicode). I use Audacity to convert and edit music and sound files for use with Half-Life DJ. The program usually works perfectly. However, I have noticed a strange problem. The program will often and seemingly randomly change the sample format from 16-bit to 32-bit with no warning after I export the file as a WAV. I'm not sure what causes this, but it seems to happen much more frequently when I edit a file before exporting it (extending a song, for example). It also happens occasionally when an unedited file is saved in proper HLDJ format (16-bit sample format, 12000hz project rate, only one track which is set to mono). The files end up failing to play correctly after I load them in HLDJ, and will not stay in 16-bit even if I edit them again and re-save them. I can't seem to figure out the root of the problem or to find any help online. If anyone could tell me how to work around or fix this, I'd really appreciate it.

System specifications for anyone who can use them to help:

Computer Model (Desktop): Inspiron 537

OS: 64x, running Windows Vista Home Premium 64-bit

RAM: 4GB (4060MB)

CPU: Single core running at 2.2GHz

GPU: Intel G41 Express Integrated Chipset

Re: Audacity 1.3 Beta (Unicode) altering sample format rando

Posted: Wed Oct 05, 2011 4:32 am
by Catloaf
Gale Andrews wrote:Thanks for the report. Please check at Help > About Audacity that you are using the latest 1.3.13 Beta.

What application says the files are not 16-bit? If they were 32-bit they would be twice the file size of a 16-bit file of the same length.

Are you exporting from Audacity using "WAV (Microsoft) signed 16 bit PCM"?



Gale
My version's apparently 1.3.12 (got it a while back, can't remember exactly when). Audacity itself says that the file is 32-bit when I reopen the file, even though it was exported as 16-bit (I'm opening the exported file, not the original.). And yes, I'm exporting it as "WAV (Microsoft) signed 16 bit PCM". Not sure why it'd be having problems, although it might help if I upgrade to 1.3.13. :roll:

Thanks for the help, I'll see if the same problem occurs with the latest Beta version (The 1.2 branch doesn't, or at least didn't previously work on my computer. I'll have to test that too.). I'll also keep an eye on this thread in case anything new pops up.

Re: Audacity 1.3 Beta (Unicode) altering sample format rando

Posted: Wed Oct 05, 2011 9:35 am
by steve
Catloaf wrote:Audacity itself says that the file is 32-bit when I reopen the file, even though it was exported as 16-bit
I understand the confusion, but it's not quite what it seems.

32-bit float format is an excellent format for editing and processing audio. It allows processing to be done with extreme precision, thus high quality. It is the format that Audacity uses internally and it also has performance (processing speed) benefits. For these reasons, the default format for Audacity Projects is 32-bit float.

The down side of 32-bit float are that, few other audio programs support it, and there is twice as much data as there is with 16-bit (hence larger file sizes).

To get the best of both worlds, the usual work-flow is use 32-bit float format in the Audacity Project, and when Saving a Project, keep everything in 32-bit format, but when the project is complete, Export as a 16-bit file (which should then be compatible with other programs). In most cases this will provide the best results.
For clarity, we like to use the word "Save" when talking about Saving Audacity Projects, and "Export" when talking about sending the audio out of Audacity to make an ordinary audio file.

Assuming that the default sample format is set to 32-bit float, when Importing an audio file, Audacity will try to import the file in 32-bit float. The default format is set in Preferences (Edit menu > Preferences > Quality). Due to limitations in some of the file importers, Audacity is not always able to do this, so what you will find is that some file types (including WAV and MP3) will be imported as 32-bit float, but other file types will be imported in lower bit formats (for example OGG files will import in 16-bit).

The bit format of a track in Audacity can be changed at any time by clicking on the name of the track, then clicking on "Sample Format" near the bottom of the drop down menu. Normally you would leave this as 32-bit float. The fact that most files are converted to 32-bit float format when imported is normal and beneficial.

So now we're left with the question of why some exported files don't work in HLDJ when you appear to have done everything right.
It's extremely unlikely that if you export in a 16 bit format that the file produced will be in anything other than a 16 bit format. There may well be a format mismatch between the exported files and what HLDJ requires, but if you are exporting as 16 bit, then I think the format problem is far more likely to be something other than the bit format.

Unfortunately Windows is not very good at showing what the format of a file is (by default it even hides the file extension), but fortunately there is an excellent little (free) tool called MediaInfo that (in most cases) can tell you exactly what the format is. If you go here: http://mediainfo.sourceforge.net/en then go to the download page then download from the Windows section: "GUI | v0.7.50".
After installing it, open MediaInfo and follow the set-up instructions.
When you open a file (you can just drag a file onto MediaInfo), it will show basic information about the file.
Go to the View menu and select "HTML" for a detailed description of the format.

Re: Audacity 1.3 Beta (Unicode) altering sample format rando

Posted: Thu Oct 06, 2011 4:07 am
by Catloaf
I'll have to give MediaInfo a shot. By the way, I am not actually saving the edited versions of the original files as projects. Rather, what I do is export them in the 16-bit format and then not save the edited file over or next to the original. What I'm opening with Audacity is the exported, supposedly 16-bit file. I always change it to 16-bit as per the instructions on how to convert files to work with HLDJ. I'm going to attempt conversion in 1.3.13 after I send this reply.

Re: Audacity 1.3 Beta (Unicode) altering sample format rando

Posted: Thu Oct 06, 2011 5:17 am
by Catloaf
Alright, I just tested audio conversion in 1.3.13, as well as using MediaInfo to double-check the files. All conversion went perfectly, but the files still refused to play in-game. Other files that were converted previously using the same method work fine, as well as those converted using the built-in converter in HLDJ. I might just have to use HLDJ's converter from now on.

Re: Audacity 1.3 Beta (Unicode) altering sample format rando

Posted: Thu Oct 06, 2011 9:40 am
by steve
Have you checked that the sample rate and number of channels is correct?
Could you post a short sample of a file that does work?