From d892e9278c3cadddb8c3c743ecbefccc7009d7f7 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; { }; } + 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' + }; + } + return null; }; diff --git a/package.json b/package.json index f2a78f41..7bc1637b 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,9 @@ "wma", "ics", "glb", - "pcap" + "pcap", + "voc", + "ac3" ], "devDependencies": { "@types/node": "^11.12.2", diff --git a/readme.md b/readme.md index ef989cb5..b784a79f 100644 --- a/readme.md +++ b/readme.md @@ -216,6 +216,8 @@ Type: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream - [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar - [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format - [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format +- [`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 7efe5588..12ee550f 100644 --- a/test.js +++ b/test.js @@ -104,7 +104,8 @@ const types = [ 'dcm', 'ics', 'glb', - 'pcap' + 'pcap', + 'voc' ]; // Define an entry here only if the fixture has a different