I use Audacity with an external USB box “Terratec Phase26”.
This box is set to external audio digital input 48 kHz, 24 bits.
I record a sequence using audacity in “Stereo 48 kHz 24 bit PCM” mode.
My goal is to get a file containing the exact sequence of 24-bit samples.
I export this recorded sequence selecting “other uncompressed format” option “Wav, Signed 24 bit PCM”.
In this sequence I am supposed to find the following samples in hexadecimal.
Instead of this, I find into my 24 bit wav file : 0x96f800, 0xA54E00
What gives me the 24-bit truncated to 16 bits.
Where are these eight bits missing?
What is the method to record an accurate and complete sequence of digital samples without any processing, any sample rate conversion… ?
Audacity uses Portaudio to communicate with the computers audio in/out system.
On Windows, the version of Portaudio that Audacity is currently using only reliably supports MME, DirectSound and ASIO. WaveRT is not yet supported and Audacity cannot be distributed with ASIO support due to licensing restrictions.
On Windows 7 and Vista, MME and DirectSound are “emulated” - they can only access the audio hardware indirectly through WASAPI. Unfortunately 24-bit audio data is not fully supported by MME or DirectSound on Vista or Win 7 - the audio data is limited to 16 bit and padded to 24 bit.
I’ve had a look on the Portaudio web site and it looks like full support for WASAPI is coming along nicely. I think that it is unlikely that the Audacity developers will upgrade to a newer version of Portaudio before Audacity 2.0 is released as the development team are working hard to get Audacity 2 out and I doubt they will want to risk building in instability by introducing a new core library. However, looking ahead, when the version of Portaudio that Audacity uses is updated there will hopefully be full support for WASAPI and it will become possible to record full 24-bit data.
On Windows, regardless of the hardware, on Windows, Audacity always records 16 bit data.
If you are using 24 bit audio hardware, then you will only get a theoretical best of 96 dB SNR rather than a 144 dB SNR. This isn’t as bad as it might sound. Even the best 24-bit converters fall short of full 24 bit performance so you are loosing a lot less than the theory suggests. Also, unless you are using very high end equipment it likely that the noise level of the sound source will swamp the dynamic range limitations of 16 bit.
As long as you are reasonably careful with your recording levels it is unlikely to be a problem. The main advantage of 24 bit is that you can allow a lot more headroom.
With the default settings, Audacity will convert that 16 bit data to 32 bit (float) for higher quality processing. It is generally advisable to keep this set at 32 bit float.
When you export you can choose from a wide range of formats, including uncompressed PCM WAV at 16, 24, 32, 32 bit float or 64 bit float. 32 bit float will give you the very best quality, though few other programs support this format. If you intend to make an audio CD you would export as 16 bit, 44100 Hz as this is the correct format for audio CDs.
I see what you’re doing and this is interesting because I’ve never tried this myself (I don’t have a 24 bit sound card or Windows 7).
When you export in an integer format, by default Audacity will dither the output.
For your test, try disabling dither and see what happens.
Edit menu > Preferences > Quality"
Set dither to “none” in the high quality conversion settings.
(Remember to turn it back on after testing - After any sort of processing there will be “in between” values that cannot be represented exactly as integers and dither smooths the quantise errors).
The “real time conversion” settings affect playback. Dither should normally be set to “None” for best playback performance.
The “high quality conversion” settings affect mixing and export. Dither should normally be set to “Triangle” or “Shaped” for best quality.
For testing the sample values of the exported 24 bit file you will need to temporarily set this to “None”.
The WAV files are too big to upload. I’ve attached the start of the hex dumps.
The files record the same track but don’t start precisely at the same point.
There does appear to be a repeating pattern of 0’s every third byte when dithering is shut off (KJSNDhead.txt).
So … in this situation, would it be truer to the source to take the 16-bit samples or the dithered 24-bit samples?
The question only affects the archived source recordings. There is much downstream processing in 32-bit float before exporting the individual tracks.
If you are not applying any processing at all then it will be “truer” to the source to turn of dither whether you export as 16, 24 or 32 bit uncompressed audio.
“Processing” includes Amplify, Normalize, Fade, Noise Removal, and anything else that alters the sample values. It does not include simple cut/trim/paste edits.
If you apply any processing, then dither will produce “truer” results by preventing harmonic noise being created by quantise errors and increasing the dynamic range of the output. This is at the cost of introducing a tiny amount of randomised noise. In the case of 24-bit export with “Triangle” dither, the randomised noise is at the extremely low level of around -148 dBFS RMS (A-weighted).
In my processing pipeline, I save an Audacity project for the source and a separate project for the processed result. The idea is, to record the LP once in as good a representation that can be created and store it away (“one and done”); then export a WAV file to start the processing pipeline, proecssing as often as needed, given new tools and techniques becoming available.
So my takeaway is:
Export the source archival WAV with dithering turned off.
Export the final product (after DeClick, additional post processing, amplify, etc.) with dithering set to Triangle.
Or as FLAC (with dither turned off) if you want to some disk space. The quality of FLAC is the same as WAV, just smaller files.
You may want to test both Triangle and Shaped dither to see which you prefer - the difference is very subtle when played at normal volume, in fact with 24-bit you’ll probably be hard pressed to hear any difference at all.
The ASIO SDK is free, but closed source - you have to register (free) with Steinberg to download it.
All of the rest is free open source.
I build Audacity regularly on Linux, but to date I’ve failed miserably on Windows. It certainly does not help that the free versions of Visual Studio Express and Microsoft SDK are riddled with bugs. You can read about my adventures in this forum topic: forum.audacityteam.org/viewtopic.php?f=19&t=62312