music-metadata 7.13.1 → 7.13.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.
@@ -99,7 +99,12 @@ class WaveParser extends BasicParser_1.BasicParser {
99
99
  this.metadata.setFormat('numberOfSamples', numberOfSamples);
100
100
  this.metadata.setFormat('duration', numberOfSamples / this.metadata.format.sampleRate);
101
101
  }
102
- this.metadata.setFormat('bitrate', this.metadata.format.numberOfChannels * this.blockAlign * this.metadata.format.sampleRate); // ToDo: check me
102
+ if (this.metadata.format.codec === 'ADPCM') { // ADPCM is 4 bits lossy encoding resulting in 352kbps
103
+ this.metadata.setFormat('bitrate', 352000);
104
+ }
105
+ else {
106
+ this.metadata.setFormat('bitrate', this.blockAlign * this.metadata.format.sampleRate * 8);
107
+ }
103
108
  await this.tokenizer.ignore(header.chunkSize);
104
109
  break;
105
110
  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": "7.13.1",
4
+ "version": "7.13.2",
5
5
  "author": {
6
6
  "name": "Borewit",
7
7
  "url": "https://github.com/Borewit"