Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Sony DSF (DSD Stream File) format #203

Merged
merged 1 commit into from Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added fixture/fixture.dsf
Binary file not shown.
3 changes: 2 additions & 1 deletion index.d.ts
Expand Up @@ -94,7 +94,8 @@ declare namespace fileType {
| 'mpc'
| 'ics'
| 'glb'
| 'pcap';
| 'pcap'
| 'dsf';

interface FileTypeResult {
/**
Expand Down
8 changes: 8 additions & 0 deletions index.js
Expand Up @@ -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;
};

Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -118,7 +118,8 @@
"wma",
"ics",
"glb",
"pcap"
"pcap",
"dsf"
],
"devDependencies": {
"@types/node": "^11.12.2",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Expand Up @@ -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).*

Expand Down
3 changes: 2 additions & 1 deletion test.js
Expand Up @@ -104,7 +104,8 @@ const types = [
'dcm',
'ics',
'glb',
'pcap'
'pcap',
'dsf'
];

// Define an entry here only if the fixture has a different
Expand Down