Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buf.readInt16BE is not a function #856

Closed
qboisson opened this issue Jul 19, 2021 · 6 comments
Closed

buf.readInt16BE is not a function #856

qboisson opened this issue Jul 19, 2021 · 6 comments

Comments

@qboisson
Copy link

qboisson commented Jul 19, 2021

When trying to use parseFile on mp3 files, thanks to a Node script, I have the following error on some files:

TypeError: buf.readInt16BE is not a function
    at Object.get (/Users/quentin/Desktop/audio-resource-manager/node_modules/token-types/lib/index.js:108:20)
    at FileTokenizer.readNumber (/Users/quentin/Desktop/audio-resource-manager/node_modules/strtok3/lib/AbstractTokenizer.js:52:22)
    at MpegParser.parseCrc (/Users/quentin/Desktop/audio-resource-manager/node_modules/music-metadata/lib/mpeg/MpegParser.js:432:20)
    at MpegParser.parseAudioFrameHeader (/Users/quentin/Desktop/audio-resource-manager/node_modules/music-metadata/lib/mpeg/MpegParser.js:396:13)
    at MpegParser._parse (/Users/quentin/Desktop/audio-resource-manager/node_modules/music-metadata/lib/mpeg/MpegParser.js:233:24)
    at MpegParser.parseID3v2 (/Users/quentin/Desktop/audio-resource-manager/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js:41:9)
    at MpegParser.parse (/Users/quentin/Desktop/audio-resource-manager/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js:24:13)
    at Function._parse (/Users/quentin/Desktop/audio-resource-manager/node_modules/music-metadata/lib/ParserFactory.js:161:9)
    at parseFile (/Users/quentin/Desktop/audio-resource-manager/node_modules/music-metadata/lib/index.js:46:16)

Node v16.5.0
MacOS BigSur

Bug mp3 file example: Example file.zip

Not sure if it can help but I did not have the issue with music-metadata@7.8.5 but with music-metadata@7.8.8.
And now, returning on music-metadata@7.8.5 is not working anymore.

@Borewit
Copy link
Owner

Borewit commented Jul 19, 2021

It is probably one of the (my) dependant modules. Maybe token-types strtok3.
Can you please check that version? Are running this code with node.js or the browser?

@Borewit
Copy link
Owner

Borewit commented Jul 20, 2021

Similar issue: sindresorhus/file-type#469

@Borewit
Copy link
Owner

Borewit commented Jul 20, 2021

Is your issue solved @qboisson by upgrading to music-metadata v7.9.0?

@qboisson
Copy link
Author

Thanks for the reply.
The code is running with node.js.
strtok3 version: 6.2.2 and token-types version: 2.1.1

@RomanBurunkov
Copy link

RomanBurunkov commented Jul 20, 2021

Hi @Borewit ,

Forget my last update.
Confirming that it is working now.

Thanks a lot.

@Borewit
Copy link
Owner

Borewit commented Jul 20, 2021

Ah, okay good, just did another release to freeze the version of the problematic dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants