From cf89f77db9293239710a904f2f0589101fb8d6cb Mon Sep 17 00:00:00 2001 From: Yanis Benson Date: Fri, 12 Apr 2019 12:23:16 +0300 Subject: [PATCH] added ac3 and voc, solves #89 --- fixture/fixture.ac3 | Bin 0 -> 138 bytes fixture/fixture.voc | Bin 0 -> 26 bytes index.d.ts | 4 +++- index.js | 14 ++++++++++++++ package.json | 4 +++- readme.md | 2 ++ test.js | 3 ++- 7 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 fixture/fixture.ac3 create mode 100644 fixture/fixture.voc diff --git a/fixture/fixture.ac3 b/fixture/fixture.ac3 new file mode 100644 index 0000000000000000000000000000000000000000..e5b56c8bb4e6025f286b4f54bc074aa26403a28f GIT binary patch literal 138 zcmV;50CoQhcgzGpKre(U1O8If`Sa)0Y&eBr%lkh&XrFPSoUxDtQpul8ez_*) z6b&7=unCqR06Y6>9Ta&*H5h7Z<3yi)K$GA?nkGXN#9hD!Ob_|3`eYWs0pI`wv%W|+ staOIyDv`2`NYyfKNDukd^XJc>K79G}-~f0A!~h3?Y(M~b2EYItskxdxmjD0& literal 0 HcmV?d00001 diff --git a/fixture/fixture.voc b/fixture/fixture.voc new file mode 100644 index 0000000000000000000000000000000000000000..ae564ba1d679545430c6c88ae937a05b469d182f GIT binary patch literal 26 hcmZ=RN=+=uEK5}g%g; { mime: 'audio/x-dsf' // Non-standard }; } + + if (checkString('Creative Voice File')) { + return { + ext: 'voc', + mime: 'audio/x-voc' + }; + } + + if (check([0x77, 0x0B])) { + return { + ext: 'ac3', + mime: 'audio/vnd.dolby.dd-raw' + }; + } }; module.exports = fileType; diff --git a/package.json b/package.json index bf39170b..c11a1b50 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,9 @@ "ics", "glb", "pcap", - "dsf" + "dsf", + "voc", + "ac3" ], "devDependencies": { "@types/node": "^11.12.2", diff --git a/readme.md b/readme.md index a4eda412..ad0b3a08 100644 --- a/readme.md +++ b/readme.md @@ -217,6 +217,8 @@ Type: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream - [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format - [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format - [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF) +- [`voc`](https://wiki.multimedia.cx/index.php/Creative_Voice) - Creative Voice File +- [`ac3`](https://www.atsc.org/standard/a522012-digital-audio-compression-ac-3-e-ac-3-standard-12172012/) - ATSC A/52 Audio File *SVG isn't included as it requires the whole file to be read, but you can get it [here](https://github.com/sindresorhus/is-svg).* diff --git a/test.js b/test.js index e4c79097..7f073eda 100644 --- a/test.js +++ b/test.js @@ -104,7 +104,8 @@ const types = [ 'ics', 'glb', 'pcap', - 'dsf' + 'dsf', + 'voc' ]; // Define an entry here only if the fixture has a different