music-metadata 7.11.8 → 7.11.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/ParserFactory.js +1 -0
- package/lib/wav/BwfChunk.d.ts +17 -0
- package/lib/wav/BwfChunk.js +28 -0
- package/lib/wav/WaveParser.js +12 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ Supports any common audio and tagging format.
|
|
|
26
26
|
| AAC | ADTS / Advanced Audio Coding | [:link:](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) | <img src="https://svgshare.com/i/UT8.svg" width="40" alt="AAC logo"> |
|
|
27
27
|
| APE | Monkey's Audio | [:link:](https://wikipedia.org/wiki/Monkey's_Audio) | <img src="https://foreverhits.files.wordpress.com/2015/05/ape_audio.jpg" width="40" alt="Monkey's Audio logo"> |
|
|
28
28
|
| ASF | Advanced Systems Format | [:link:](https://wikipedia.org/wiki/Advanced_Systems_Format) | |
|
|
29
|
+
| BWF | Broadcast Wave Format | [:link:](https://en.wikipedia.org/wiki/Broadcast_Wave_Format) | |
|
|
29
30
|
| DSDIFF | Philips DSDIFF | [:link:](https://wikipedia.org/wiki/Direct_Stream_Digital) | <img src="https://upload.wikimedia.org/wikipedia/commons/b/bc/DSDlogo.svg" width="80" alt="DSD logo"> |
|
|
30
31
|
| DSF | Sony's DSD Stream File | [:link:](https://wikipedia.org/wiki/Direct_Stream_Digital) | <img src="https://upload.wikimedia.org/wikipedia/commons/b/bc/DSDlogo.svg" width="80" alt="DSD logo"> |
|
|
31
32
|
| FLAC | Free Lossless Audio Codec | [:link:](https://wikipedia.org/wiki/FLAC) | <img src="https://upload.wikimedia.org/wikipedia/commons/a/a2/FLAC_logo_vector.svg" width="80" alt="FLAC logo"> |
|
package/lib/ParserFactory.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IGetToken } from 'strtok3/lib/core';
|
|
2
|
+
export interface IBroadcastAudioExtensionChunk {
|
|
3
|
+
description: string;
|
|
4
|
+
originator: string;
|
|
5
|
+
originatorReference: string;
|
|
6
|
+
originationDate: string;
|
|
7
|
+
originationTime: string;
|
|
8
|
+
timeReferenceLow: number;
|
|
9
|
+
timeReferenceHigh: number;
|
|
10
|
+
version: number;
|
|
11
|
+
umid: Uint8Array;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Broadcast Audio Extension Chunk
|
|
15
|
+
* Ref: https://tech.ebu.ch/docs/tech/tech3285.pdf
|
|
16
|
+
*/
|
|
17
|
+
export declare const BroadcastAudioExtensionChunk: IGetToken<IBroadcastAudioExtensionChunk>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BroadcastAudioExtensionChunk = void 0;
|
|
4
|
+
const Token = require("token-types");
|
|
5
|
+
/**
|
|
6
|
+
* Broadcast Audio Extension Chunk
|
|
7
|
+
* Ref: https://tech.ebu.ch/docs/tech/tech3285.pdf
|
|
8
|
+
*/
|
|
9
|
+
exports.BroadcastAudioExtensionChunk = {
|
|
10
|
+
len: 420,
|
|
11
|
+
get: (uint8array, off) => {
|
|
12
|
+
return {
|
|
13
|
+
description: new Token.StringType(256, 'ascii').get(uint8array, off).trim(),
|
|
14
|
+
originator: new Token.StringType(32, 'ascii').get(uint8array, off + 256).trim(),
|
|
15
|
+
originatorReference: new Token.StringType(32, 'ascii').get(uint8array, off + 288).trim(),
|
|
16
|
+
originationDate: new Token.StringType(10, 'ascii').get(uint8array, off + 320).trim(),
|
|
17
|
+
originationTime: new Token.StringType(8, 'ascii').get(uint8array, off + 330).trim(),
|
|
18
|
+
timeReferenceLow: Token.UINT32_LE.get(uint8array, off + 338),
|
|
19
|
+
timeReferenceHigh: Token.UINT32_LE.get(uint8array, off + 342),
|
|
20
|
+
version: Token.UINT16_LE.get(uint8array, off + 346),
|
|
21
|
+
umid: new Token.Uint8ArrayType(64).get(uint8array, off + 348),
|
|
22
|
+
loudnessValue: Token.UINT16_LE.get(uint8array, off + 412),
|
|
23
|
+
maxTruePeakLevel: Token.UINT16_LE.get(uint8array, off + 414),
|
|
24
|
+
maxMomentaryLoudness: Token.UINT16_LE.get(uint8array, off + 416),
|
|
25
|
+
maxShortTermLoudness: Token.UINT16_LE.get(uint8array, off + 418)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
package/lib/wav/WaveParser.js
CHANGED
|
@@ -10,6 +10,7 @@ const ID3v2Parser_1 = require("../id3v2/ID3v2Parser");
|
|
|
10
10
|
const util = require("../common/Util");
|
|
11
11
|
const FourCC_1 = require("../common/FourCC");
|
|
12
12
|
const BasicParser_1 = require("../common/BasicParser");
|
|
13
|
+
const BwfChunk_1 = require("../wav/BwfChunk");
|
|
13
14
|
const debug = initDebug('music-metadata:parser:RIFF');
|
|
14
15
|
/**
|
|
15
16
|
* Resource Interchange File Format (RIFF) Parser
|
|
@@ -101,6 +102,17 @@ class WaveParser extends BasicParser_1.BasicParser {
|
|
|
101
102
|
this.metadata.setFormat('bitrate', this.metadata.format.numberOfChannels * this.blockAlign * this.metadata.format.sampleRate); // ToDo: check me
|
|
102
103
|
await this.tokenizer.ignore(header.chunkSize);
|
|
103
104
|
break;
|
|
105
|
+
case 'bext': // Broadcast Audio Extension chunk https://tech.ebu.ch/docs/tech/tech3285.pdf
|
|
106
|
+
const bext = await this.tokenizer.readToken(BwfChunk_1.BroadcastAudioExtensionChunk);
|
|
107
|
+
Object.keys(bext).forEach(key => {
|
|
108
|
+
this.metadata.addTag('exif', 'bext.' + key, bext[key]);
|
|
109
|
+
});
|
|
110
|
+
break;
|
|
111
|
+
case '\x00\x00\x00\x00': // padding ??
|
|
112
|
+
debug(`Ignore padding chunk: RIFF/${header.chunkID} of ${header.chunkSize} bytes`);
|
|
113
|
+
this.metadata.addWarning('Ignore chunk: RIFF/' + header.chunkID);
|
|
114
|
+
await this.tokenizer.ignore(header.chunkSize);
|
|
115
|
+
break;
|
|
104
116
|
default:
|
|
105
117
|
debug(`Ignore chunk: RIFF/${header.chunkID} of ${header.chunkSize} bytes`);
|
|
106
118
|
this.metadata.addWarning('Ignore chunk: RIFF/' + header.chunkID);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "music-metadata",
|
|
3
3
|
"description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.",
|
|
4
|
-
"version": "7.11.
|
|
4
|
+
"version": "7.11.9",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Borewit",
|
|
7
7
|
"url": "https://github.com/Borewit"
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
"chapter",
|
|
58
58
|
"info",
|
|
59
59
|
"parse",
|
|
60
|
-
"parser"
|
|
60
|
+
"parser",
|
|
61
|
+
"bwf"
|
|
61
62
|
],
|
|
62
63
|
"main": "lib/index.js",
|
|
63
64
|
"types": "lib/index.d.ts",
|
|
@@ -96,9 +97,9 @@
|
|
|
96
97
|
"@types/debug": "^4.1.7",
|
|
97
98
|
"@types/file-type": "^10.9.1",
|
|
98
99
|
"@types/mocha": "^9.1.0",
|
|
99
|
-
"@types/node": "^17.0.
|
|
100
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
101
|
-
"@typescript-eslint/parser": "^5.
|
|
100
|
+
"@types/node": "^17.0.17",
|
|
101
|
+
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
|
102
|
+
"@typescript-eslint/parser": "^5.11.0",
|
|
102
103
|
"chai": "^4.3.6",
|
|
103
104
|
"coveralls": "^3.1.1",
|
|
104
105
|
"del-cli": "4.0.1",
|
|
@@ -106,18 +107,17 @@
|
|
|
106
107
|
"eslint-config-prettier": "^8.3.0",
|
|
107
108
|
"eslint-import-resolver-typescript": "^2.5.0",
|
|
108
109
|
"eslint-plugin-import": "^2.25.4",
|
|
109
|
-
"eslint-plugin-jsdoc": "^37.
|
|
110
|
+
"eslint-plugin-jsdoc": "^37.8.2",
|
|
110
111
|
"eslint-plugin-node": "^11.1.0",
|
|
111
112
|
"eslint-plugin-unicorn": "^40.1.0",
|
|
112
113
|
"mime": "^3.0.0",
|
|
113
114
|
"mocha": "^9.2.0",
|
|
114
115
|
"npm-run-all": "^4.1.5",
|
|
115
116
|
"nyc": "^15.1.0",
|
|
116
|
-
"prettier": "^2.5.1",
|
|
117
117
|
"remark-cli": "^10.0.1",
|
|
118
118
|
"remark-preset-lint-recommended": "^6.1.2",
|
|
119
119
|
"source-map-support": "^0.5.21",
|
|
120
|
-
"ts-node": "^10.
|
|
120
|
+
"ts-node": "^10.5.0",
|
|
121
121
|
"typescript": "^4.5.5"
|
|
122
122
|
},
|
|
123
123
|
"engines": {
|