LICENSE: CC0 1.0 Universal
[spdif-tools.git] / README.md
1 S/PDIF tools
2 ===========
3
4 These simple programs convert raw AC3 (Dolby Digital, A/52) and DTS streams
5 into WAV files containing the S/PDIF fake PCM encoding thereof. This means
6 that if such a .wav file is replayed correctly bit-by-bit via the S/PDIF
7 output of a device and supplied to a standards compliant decoder, it
8 will be recognized as a standards compliant AC3/DTS stream,
9 indistinguishable from a stream generated e.g. by a DVD player.
10
11 This is useful to e.g. author CDs containing compressed multichannel
12 data (such as DTS encoded CDs that commercially available).
13 Take care: Playing back the files produced via speakers at high volume
14 may damage these or your hearing.
15
16
17 A note about coding style
18 -------------------------
19
20 These sources are very old (from around 2006/2007) and show my coding
21 abilities back then when I started with C. I hope to clean this up
22 and modernize it at some point in the future.
23
24
25 ac32spdif
26 ---------
27
28 This tool takes a raw .ac3 file and converts it into a .wav file of the
29 same sample rate containing one AC3 frame plus padding zeros for the
30 remaining time of that frame's time slot.
31
32
33 dts2spdif
34 ---------
35
36 In a similar fashion, this tool translates a .dts file to a .wav file.
37 Currently it only supports 16 bit encapsulation, i.e. the data stream
38 is included in the .wav file 1:1.
39 The DTS specification also defines a 14 bit format for use with CDs
40 where there is a possibility that the data will be played back via
41 speakers in order to reduce the possibility of speaker/hearing damage
42 when the medium is played back without a DTS decoder. In this case,
43 only the lower 14 bits of a word would be used, with the high 2 bits
44 set to zero. This encoding may be added to dts2spdif later on.
45
46
47 License
48 -------
49
50 As usual, this code comes with no warranty whatsoever. I am especially
51 not responsible if you blow up your speakers or ears using these tools.
52
53 Do whatever you like with this code, but if you use it for your own
54 application I would appreciate an attribution note in the documentation.
55 Thanks!
56
57  -- norly