dieumercimvemba's picture
download
raw
1.2 kB
import initDebug from 'debug';
import * as Token from 'token-types';
import { AbstractID3Parser } from '../id3v2/AbstractID3Parser.js';
import { MpcSv8Parser } from './sv8/MpcSv8Parser.js';
import { MpcSv7Parser } from './sv7/MpcSv7Parser.js';
import { MusepackContentError } from './MusepackConentError.js';
const debug = initDebug('music-metadata:parser:musepack');
export class MusepackParser extends AbstractID3Parser {
async postId3v2Parse() {
const signature = await this.tokenizer.peekToken(new Token.StringType(3, 'latin1'));
let mpcParser;
switch (signature) {
case 'MP+': {
debug('Stream-version 7');
mpcParser = new MpcSv7Parser(this.metadata, this.tokenizer, this.options);
break;
}
case 'MPC': {
debug('Stream-version 8');
mpcParser = new MpcSv8Parser(this.metadata, this.tokenizer, this.options);
break;
}
default: {
throw new MusepackContentError('Invalid signature prefix');
}
}
this.metadata.setAudioOnly();
return mpcParser.parse();
}
}

Xet Storage Details

Size:
1.2 kB
·
Xet hash:
f96a788144307f59b246ccb9d3302ee701ebb41dafc33fe4717ef49a60d8a25a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.