music-metadata
Advanced tools
Comparing version 7.12.5 to 7.12.6
@@ -13,2 +13,13 @@ "use strict"; | ||
const debug = (0, debug_1.default)('music-metadata:parser:aiff'); | ||
const compressionTypes = { | ||
NONE: 'not compressed PCM Apple Computer', | ||
sowt: 'PCM (byte swapped)', | ||
fl32: '32-bit floating point IEEE 32-bit float', | ||
fl64: '64-bit floating point IEEE 64-bit float Apple Computer', | ||
alaw: 'ALaw 2:1 8-bit ITU-T G.711 A-law', | ||
ulaw: 'µLaw 2:1 8-bit ITU-T G.711 µ-law Apple Computer', | ||
ULAW: 'CCITT G.711 u-law 8-bit ITU-T G.711 µ-law', | ||
ALAW: 'CCITT G.711 A-law 8-bit ITU-T G.711 A-law', | ||
FL32: 'Float 32 IEEE 32-bit float ' | ||
}; | ||
/** | ||
@@ -60,2 +71,3 @@ * AIFF - Audio Interchange File Format | ||
async readData(header) { | ||
var _a; | ||
switch (header.chunkID) { | ||
@@ -69,3 +81,3 @@ case 'COMM': // The Common Chunk | ||
this.metadata.setFormat('duration', common.numSampleFrames / common.sampleRate); | ||
this.metadata.setFormat('codec', common.compressionName); | ||
this.metadata.setFormat('codec', (_a = common.compressionName) !== null && _a !== void 0 ? _a : compressionTypes[common.compressionType]); | ||
return header.chunkSize; | ||
@@ -72,0 +84,0 @@ case 'ID3 ': // ID3-meta-data |
@@ -28,8 +28,13 @@ "use strict"; | ||
const strLen = buf.readInt8(off + 22); | ||
const padding = (strLen + 1) % 2; | ||
if (23 + strLen + padding === this.len) { | ||
res.compressionName = new Token.StringType(strLen, 'binary').get(buf, off + 23); | ||
if (strLen > 0) { | ||
const padding = (strLen + 1) % 2; | ||
if (23 + strLen + padding === this.len) { | ||
res.compressionName = new Token.StringType(strLen, 'binary').get(buf, off + 23); | ||
} | ||
else { | ||
throw new Error('Illegal pstring length'); | ||
} | ||
} | ||
else { | ||
throw new Error('Illegal pstring length'); | ||
res.compressionName = undefined; | ||
} | ||
@@ -36,0 +41,0 @@ } |
{ | ||
"name": "music-metadata", | ||
"description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.", | ||
"version": "7.12.5", | ||
"version": "7.12.6", | ||
"author": { | ||
@@ -82,3 +82,2 @@ "name": "Borewit", | ||
"test-coverage": "nyc npm run test", | ||
"send-coveralls": "nyc report --reporter=text-lcov | coveralls", | ||
"send-codacy": "nyc report --reporter=text-lcov | codacy-coverage", | ||
@@ -102,14 +101,13 @@ "doc-gen": "node doc-gen/gen.js" | ||
"@types/mocha": "^9.1.0", | ||
"@types/node": "^18.0.6", | ||
"@typescript-eslint/eslint-plugin": "^5.30.7", | ||
"@typescript-eslint/parser": "^5.30.7", | ||
"@types/node": "^18.6.3", | ||
"@typescript-eslint/eslint-plugin": "^5.32.0", | ||
"@typescript-eslint/parser": "^5.32.0", | ||
"chai": "^4.3.6", | ||
"chai-as-promised": "^7.1.1", | ||
"coveralls": "^3.1.1", | ||
"del-cli": "5.0.0", | ||
"eslint": "^8.20.0", | ||
"eslint": "^8.21.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-import-resolver-typescript": "^3.3.0", | ||
"eslint-import-resolver-typescript": "^3.4.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jsdoc": "^39.3.3", | ||
"eslint-plugin-jsdoc": "^39.3.4", | ||
"eslint-plugin-node": "^11.1.0", | ||
@@ -116,0 +114,0 @@ "eslint-plugin-unicorn": "^43.0.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
472228
27
11552