diff --git a/fixture/fixture.dsf b/fixture/fixture.dsf new file mode 100644 index 00000000..80024278 Binary files /dev/null and b/fixture/fixture.dsf differ diff --git a/index.d.ts b/index.d.ts index c7b6c2ba..45dc3862 100644 --- a/index.d.ts +++ b/index.d.ts @@ -94,7 +94,8 @@ declare namespace fileType { | 'mpc' | 'ics' | 'glb' - | 'pcap'; + | 'pcap' + | 'dsf'; interface FileTypeResult { /** diff --git a/index.js b/index.js index cf744b3a..ba366c00 100644 --- a/index.js +++ b/index.js @@ -920,6 +920,14 @@ const fileType = input => { }; } + // Sony DSD Stream File (DSF) + if (check([0x44, 0x53, 0x44, 0x20])) { + return { + ext: 'dsf', + mime: 'audio/x-dsf' // Non-standard + }; + } + return null; }; diff --git a/package.json b/package.json index f2a78f41..95541413 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,8 @@ "wma", "ics", "glb", - "pcap" + "pcap", + "dsf" ], "devDependencies": { "@types/node": "^11.12.2", diff --git a/readme.md b/readme.md index ef989cb5..bab055ba 100644 --- a/readme.md +++ b/readme.md @@ -216,6 +216,7 @@ 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 +- [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF) *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..0a65416a 100644 --- a/test.js +++ b/test.js @@ -104,7 +104,8 @@ const types = [ 'dcm', 'ics', 'glb', - 'pcap' + 'pcap', + 'dsf' ]; // Define an entry here only if the fixture has a different