Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Use of non 8/16/24-bit audio, like 12-bit audio (Read 506 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Use of non 8/16/24-bit audio, like 12-bit audio

Hi all,

Currently I'm trying to build a nice set of test files for FLAC decoders. In a recent post on this board, I mentioned that there might be quite a few hardware decoders out there that do not support a FLAC file with a variable blocksize. Instead of just distributing a single file so people can check their devices, I thought making a comprehensive set of files with all kinds of FLAC features that are not often used would be even nicer.

Anyway, FLAC's format supports 8, 12, 16, 20 and 24 bit audio within it's subset. I have been looking around to find some tool to create 12 and 20 bit audio to feed to a FLAC encoder, but I can't really find anything.

Does anyone know of 12-bit and 20-bit audio being used anywhere? Or should I just ignore this part of the specification?
Music: sounds arranged such that they construct feelings.


Re: Use of non 8/16/24-bit audio, like 12-bit audio

Reply #2
20 bit can be found on some DVD-Audio discs.

Thanks! That's a very good reason to include a 20-bit test file.

I just hacked the FLAC encoder to accept 12-bit raw, so I'm no longer looking for tools to do this. The question remains, where else these bitdepths might be used.
Music: sounds arranged such that they construct feelings.

Re: Use of non 8/16/24-bit audio, like 12-bit audio

Reply #3
For example, Sonar claims to be able to export to some "12 bit DWVW AIFF (Apple/SGI) " - https://www.cakewalk.com/Documentation?product=SONAR&language=3&help=Dialogs2.146.html
sndfile-convert also has such option - https://helpmanual.io/help/sndfile-convert/
Audacity has such option too (amongst "Other uncompressed formats"), but it doesn't works for me for reasons unknown.

After looking at Wikiipedia i realized that DWVW is "Delta with variable word width", so don't know if it can be PCM at all - https://en.wikipedia.org/wiki/Audio_Interchange_File_Format#Common_compression_types



Re: Use of non 8/16/24-bit audio, like 12-bit audio

Reply #6
ffmpeg reports wood12.aiff as bitrate 705 pcm_16be (fb2k: 706, due to different round-off conventions).
Indicating 16 bits (mono)?
Whatever flac.exe's error message means ...
High Voltage socket-nose-avatar


Re: Use of non 8/16/24-bit audio, like 12-bit audio

Reply #8
The only program I know of that can write 20-bit flac is Awave Audio by FMJ-Software. But since only new players are compatible with it, saving as 24-bit with a tiny overhead is preferable.

Re: Use of non 8/16/24-bit audio, like 12-bit audio

Reply #9
You can create such files easily with qaac/refalac. Use -b option.
qaac/refalac actually allows arbitrary bits per sample in 2-31.

Re: Use of non 8/16/24-bit audio, like 12-bit audio

Reply #10
ffmpeg reports wood12.aiff as bitrate 705 pcm_16be (fb2k: 706, due to different round-off conventions).
Indicating 16 bits (mono)?
From the format spec:
Quote
Sample points are stored in an integral number of contiguous bytes.  One to 8 bit wide sample
points are stored in one byte, 9 to 16 bit wide sample points are stored in two bytes, ...
So effectively it is 12 bits in 16 bits container.
Whatever flac.exe's error message means ...
Mine says:
Quote
ERROR during read, sample data (channel#0 sample#0 = 2) has non-zero least-significant bits
  WAVE/AIFF header said the last 4 bits are not significant and should be zero.
My guess, again, from the format spec:
Quote
When the width of a sample point is less than a multiple of 8 bits, the sample point data is left
justified, with the remaining bits zeroed.
and that is not what happens in that file:
Code: [Select]
53 53  4e 44   00 00 0c b4   00 00 00 00   00 00 00 00   00 02 ...
"SSND"         chunk size    offset        block size    data

Re: Use of non 8/16/24-bit audio, like 12-bit audio

Reply #11
In the attachment there is a fixed wood12 sample and a flac created from it:
Code: [Select]
]$ metaflac --list --block-type=STREAMINFO wood12fix.flac
METADATA block #0
  type: 0 (STREAMINFO)
  is last: false
  length: 34
  minimum blocksize: 4096 samples
  maximum blocksize: 4096 samples
  minimum framesize: 1394 bytes
  maximum framesize: 1394 bytes
  sample_rate: 44100 Hz
  channels: 1
  bits-per-sample: 12
  total samples: 1622
  MD5 signature: fa5ac05726a6fb8d5f4e31613e6710ac

 

Re: Use of non 8/16/24-bit audio, like 12-bit audio

Reply #12
So, it seems after whole-byte bitdepths (8/16/24) there are few cases of using the whole-nibble bitdepths that are in-between (12/20). Wikipedia seems to mention 10 and 11 bit for the NICAM compression format. ยต-law can be losslessly converted to 14 bit LPCM and A-law to 13-bit LPCM if I understand correctly. Any others?
Music: sounds arranged such that they construct feelings.

 
SimplePortal 1.0.0 RC1 © 2008-2021