-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from Borewit/196-add-support-for-DSDIFF-format
Add support for Philips DSDIFF (.dff) DSD files
- Loading branch information
Showing
3 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {assert} from 'chai'; | ||
import * as mm from '../src'; | ||
import * as path from 'path'; | ||
|
||
describe('Parse Philips DSDIFF', () => { | ||
|
||
const dsdiffamplePath = path.join(__dirname, 'samples', 'dsdiff'); | ||
|
||
it('parse: DSD64.dff', async () => { | ||
|
||
const filePath = path.join(dsdiffamplePath, 'DSD64.dff'); | ||
|
||
const {format, common} = await mm.parseFile(filePath, {duration: false}); | ||
|
||
// format chunk information | ||
assert.strictEqual(format.dataformat, 'DSDIFF/DSD'); | ||
assert.deepEqual(format.lossless, true); | ||
assert.deepEqual(format.tagTypes, ['ID3v2.3']); | ||
assert.deepEqual(format.numberOfChannels, 2, 'format.numberOfChannels'); | ||
assert.deepEqual(format.bitsPerSample, 1, 'format.bitsPerSample'); | ||
assert.deepEqual(format.sampleRate, 2822400, 'format.sampleRate [Hz]'); | ||
assert.deepEqual(format.numberOfSamples, 300800, 'format.numberOfSamples'); | ||
assert.deepEqual(format.duration, 300800 / 2822400, 'format.duration'); | ||
assert.deepEqual(format.bitrate, 5644800, 'format.bitrate'); | ||
assert.deepEqual(format.tagTypes, ['ID3v2.3'], 'TAG headers'); | ||
|
||
// ID3v2 chunk information | ||
assert.strictEqual(common.artist, 'CANTUS (Tove Ramlo-Ystad) & Frode Fjellheim', 'common.artist'); | ||
assert.strictEqual(common.title, 'Kyrie', 'common.title'); | ||
assert.strictEqual(common.album, 'SPES', 'common.album'); | ||
assert.deepEqual(common.genre, ['Choral'], 'common.genre'); | ||
assert.deepEqual(common.track, {no: 4, of: 12}, 'common.track'); | ||
}); | ||
|
||
}); |