music-metadata 11.10.1 → 11.10.2
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/lib/mp4/MP4Parser.js +3 -1
- package/package.json +2 -2
package/lib/mp4/MP4Parser.js
CHANGED
|
@@ -93,6 +93,7 @@ function distinct(value, index, self) {
|
|
|
93
93
|
export class MP4Parser extends BasicParser {
|
|
94
94
|
constructor() {
|
|
95
95
|
super(...arguments);
|
|
96
|
+
this.audioLengthInBytes = 0;
|
|
96
97
|
this.tracks = new Map();
|
|
97
98
|
this.hasVideoTrack = false;
|
|
98
99
|
this.hasAudioTrack = true;
|
|
@@ -120,7 +121,7 @@ export class MP4Parser extends BasicParser {
|
|
|
120
121
|
* Will scan for chapters
|
|
121
122
|
*/
|
|
122
123
|
mdat: async (len) => {
|
|
123
|
-
this.audioLengthInBytes
|
|
124
|
+
this.audioLengthInBytes += len;
|
|
124
125
|
this.calculateBitRate();
|
|
125
126
|
if (this.options.includeChapters) {
|
|
126
127
|
const trackWithChapters = [...this.tracks.values()].filter(track => track.chapterList);
|
|
@@ -182,6 +183,7 @@ export class MP4Parser extends BasicParser {
|
|
|
182
183
|
async parse() {
|
|
183
184
|
this.hasVideoTrack = false;
|
|
184
185
|
this.hasAudioTrack = true;
|
|
186
|
+
this.audioLengthInBytes = 0;
|
|
185
187
|
this.tracks.clear();
|
|
186
188
|
let remainingFileSize = this.tokenizer.fileInfo.size || 0;
|
|
187
189
|
while (!this.tokenizer.fileInfo.size || remainingFileSize > 0) {
|
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": "11.10.
|
|
4
|
+
"version": "11.10.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Borewit",
|
|
7
7
|
"url": "https://github.com/Borewit"
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@tokenizer/token": "^0.3.0",
|
|
111
111
|
"content-type": "^1.0.5",
|
|
112
112
|
"debug": "^4.4.3",
|
|
113
|
-
"file-type": "^21.1.
|
|
113
|
+
"file-type": "^21.1.1",
|
|
114
114
|
"media-typer": "^1.1.0",
|
|
115
115
|
"strtok3": "^10.3.4",
|
|
116
116
|
"token-types": "^6.1.1",
|