Sample format to import DAT over TOSlink

Help for Audacity on macOS.
Forum rules
ImageThis forum is for Audacity on macOS 10.4 and later.
Please state which version of macOS you are using,
and the exact three-section version number of Audacity from "Audacity menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
fireball
Posts: 10
Joined: Thu May 16, 2013 1:16 am
Operating System: Please select

Sample format to import DAT over TOSlink

Post by fireball » Thu May 16, 2013 1:37 am

I am importing audio from DAT tapes into Audacity 2.0.3 over a TOSlink digital fiber connector. Which setting of the sample format parameter will give me an exact digital copy? I want to create a .wav file with the identical sample values as on my DAT tape.

Since the DAT tapes are in 16-bit PCM format, should I set the sample format to 16-bit integer? Or should I accept the 32-bit floating point default? In either case, does Audacity convert the signal to 32-bit float internally and then reconvert it to integer to export as a .wav?

Which setting would give me an exact digital copy? Does the choice of sample format make any difference at all?

I am running on a Mac Mini late 2012 model with Mac OS 10.8.3. My TOSlink source program is coming from a Tascam DA-20 MK II DAT deck. My DAT tapes have a sampling rate of 48,000 sample/second.

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Sample format to import DAT over TOSlink

Post by steve » Thu May 16, 2013 1:58 am

fireball wrote:My DAT tapes have a sampling rate of 48,000 sample/second.
So you will probably need to set the "Project Rate" to 48000 - you can do that directly in the lower left corner of the main Audacity window, or if you are going to do a lot of this then you can set the default to 48000 in "Edit > Preferences > Quality"
fireball wrote:should I set the sample format to 16-bit integer? Or should I accept the 32-bit floating point default?
You can leave that at 32 bit float.
Assuming that you are not going to be processing the audio in any way, temporarily turn off "dither" in
"Edit > Preferences > Quality: High Quality Conversion: dither = None"
This will ensure that when you export the conversion from 32 bit float to 16 bit is bit perfect.

Note that if you are processing the audio in any way, it is generally better to have dither enabled ("shaped" is usually the best option) as dither prevents harmonic distortion due to quantize errors when converting from a high bit format to a lower bit format. There is not actually much audible difference, but dithered conversion is a bit more "pure" than undithered conversion.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

fireball
Posts: 10
Joined: Thu May 16, 2013 1:16 am
Operating System: Please select

Re: Sample format to import DAT over TOSlink

Post by fireball » Thu May 16, 2013 2:57 am

Thank you very much for your suggestions and guidance. I had already turned off dithering and had set the default project rate to 48,000. I am curious what happens when I use the 16-bit integer sample format? I ran a test and the results look quite similar if not identical. Does Audacity convert everything to 32-bit float internally anyway even if no processing is being performed?

Actually, I am not certain there is no processing: I set the input channel to "MONO". However I am providing a TOSlink input signal that has both a left and right channel that are nominally the same, although not digitally identical. Does Audacity add or average the left and right input channels to produce the mono result?

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Sample format to import DAT over TOSlink

Post by steve » Thu May 16, 2013 3:24 am

fireball wrote:Does Audacity add or average the left and right input channels to produce the mono result?
I don't think that Audacity doe either.
Audacity requests audio data from the sound system according to the default settings in Edit > Preferences > Quality. The sound system then communicates with the audio device drivers which in turn grab audio data from the hardware, pass it to the sound system and deliver it to Audacity. Audacity then attempts to make sense of what comes back (and usually succeeds) but has little control over what data it actually gets. If Audacity requests data in a format that is not supported by the hardware, then somewhere along the line it will be converted or you will get an error message saying "Error while opening sound device. Please check the input device settings and the project sample rate."

Conversion from 16 or 24 bit to 32 bit float is lossless (perfect). Converting back again in the way described previously is also perfect as long as the data has not been changed at all (the audio samples still have exact integer representations). All processing in Audacity is done in 32 bit float format for maximum precision,
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

fireball
Posts: 10
Joined: Thu May 16, 2013 1:16 am
Operating System: Please select

Re: Sample format to import DAT over TOSlink

Post by fireball » Thu May 16, 2013 4:23 am

I agree that conversions to 32-bit float and back should all be lossless.

I am providing "stereo" input to TOSlink and use Audacity to record in mono. How does Audacity choose whether to record the left or the right channel?

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Sample format to import DAT over TOSlink

Post by steve » Thu May 16, 2013 4:32 am

fireball wrote:How does Audacity choose whether to record the left or the right channel?
That's what I was saying, I don't think that Audacity does decide - the decision is made before it gets to Audacity. Typically with better quality sound cards, when recording from analogue inputs, the left input channel is used. With typical "on-board" sound cards it could be anything. A user reported recently that on his Mac, the right channel is used (very unusual).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

fireball
Posts: 10
Joined: Thu May 16, 2013 1:16 am
Operating System: Please select

Re: Sample format to import DAT over TOSlink

Post by fireball » Thu May 16, 2013 4:46 am

I see. So it arbitrarily chooses to record either the left or right channel.

Thank you very much! You have helped me understand.

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Sample format to import DAT over TOSlink

Post by Gale Andrews » Thu May 16, 2013 6:12 am

fireball wrote:I see. So it arbitrarily chooses to record either the left or right channel.
I think Audacity consistently receives what the sound device chooses to give it when the sound device has a stereo stream but is asked for mono.

If you want to control what Audacity does, record in stereo then Tracks > Stereo Track to Mono. I believe that is just "sum and divide by 2".


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Sample format to import DAT over TOSlink

Post by steve » Thu May 16, 2013 12:10 pm

As Gale wrote, if you want to record a mono track with control over which channel(s) are used, record in stereo and then either "Tracks > Stereo Track to Mono" if you want an average of left and right channels, or "Track drop down menu > Split Stereo To Mono" if you want just the left or just the right channel (and delete the unwanted track by clicking on the [X])
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

fireball
Posts: 10
Joined: Thu May 16, 2013 1:16 am
Operating System: Please select

Re: Sample format to import DAT over TOSlink

Post by fireball » Sat May 18, 2013 2:45 am

Suppose I use 16-bit integer rather than the default 32-bit float to conserve memory while recording. The exported .wav files in both cases should be identical, right?

Post Reply