music-metadata 8.1.1 → 8.1.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/README.md CHANGED
@@ -4,8 +4,7 @@
4
4
  [![npm downloads](http://img.shields.io/npm/dm/music-metadata.svg)](https://npmcharts.com/compare/music-metadata,jsmediatags,musicmetadata,node-id3,mp3-parser,id3-parser,wav-file-info?start=600)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/Borewit/music-metadata/badge.svg?branch=master)](https://coveralls.io/github/Borewit/music-metadata?branch=master)
6
6
  [![Codacy Badge](https://api.codacy.com/project/badge/Grade/57d731b05c9e41889a2a17cb4b0384d7)](https://app.codacy.com/app/Borewit/music-metadata?utm_source=github.com&utm_medium=referral&utm_content=Borewit/music-metadata&utm_campaign=Badge_Grade_Dashboard)
7
- [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/Borewit/music-metadata.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Borewit/music-metadata/context:javascript)
8
- [![Total alerts](https://img.shields.io/lgtm/alerts/g/Borewit/music-metadata.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Borewit/music-metadata/alerts/)
7
+ [![CodeQL](https://github.com/Borewit/music-metadata/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/Borewit/music-metadata/actions/workflows/codeql-analysis.yml)
9
8
  [![DeepScan grade](https://deepscan.io/api/teams/5165/projects/6938/branches/61821/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=5165&pid=6938&bid=61821)
10
9
  [![Known Vulnerabilities](https://snyk.io/test/github/Borewit/music-metadata/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Borewit/music-metadata?targetFile=package.json)
11
10
  [![Discord](https://img.shields.io/discord/460524735235883049.svg)](https://discord.gg/KyBr6sb)
@@ -96,7 +96,12 @@ export class WaveParser extends BasicParser {
96
96
  this.metadata.setFormat('numberOfSamples', numberOfSamples);
97
97
  this.metadata.setFormat('duration', numberOfSamples / this.metadata.format.sampleRate);
98
98
  }
99
- this.metadata.setFormat('bitrate', this.metadata.format.numberOfChannels * this.blockAlign * this.metadata.format.sampleRate); // ToDo: check me
99
+ if (this.metadata.format.codec === 'ADPCM') { // ADPCM is 4 bits lossy encoding resulting in 352kbps
100
+ this.metadata.setFormat('bitrate', 352000);
101
+ }
102
+ else {
103
+ this.metadata.setFormat('bitrate', this.blockAlign * this.metadata.format.sampleRate * 8);
104
+ }
100
105
  await this.tokenizer.ignore(header.chunkSize);
101
106
  break;
102
107
  case 'bext': // Broadcast Audio Extension chunk https://tech.ebu.ch/docs/tech/tech3285.pdf
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": "8.1.1",
4
+ "version": "8.1.2",
5
5
  "author": {
6
6
  "name": "Borewit",
7
7
  "url": "https://github.com/Borewit"
@@ -120,7 +120,7 @@
120
120
  "mime": "^3.0.0",
121
121
  "mocha": "^10.1.0",
122
122
  "npm-run-all": "^4.1.5",
123
- "prettier": "^2.8.1",
123
+ "prettier": "^2.8.2",
124
124
  "remark-cli": "^11.0.0",
125
125
  "remark-preset-lint-recommended": "^6.1.2",
126
126
  "ts-node": "^10.9.1",