question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

buf.readInt16BE is not a function

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Borewitcommented, Jul 20, 2021

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

0reactions
Borewitcommented, Jul 20, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js Buffer.readInt16BE() Method - GeeksforGeeks
The Buffer.readInt16BE() Method is an inbuilt application programming interface of class Buffer with in Buffer module which reads a 16-bit ...
Read more >
How to fix 'TypeError: Buffer.from is not a function'?
While trying to use ipfs-api in my application, I am getting below error: ERROR TypeError: Buffer.from is not a function at varintEncode (vendor ......
Read more >
TypeError readInt64BE is not a function · Issue #2 - GitHub
Reading an Int64 value fails with error TypeError: this.buffer.readInt64BE is not a function at Decoder.parse ...
Read more >
Buffer | Node.js v19.3.0 Documentation
When decoding a Buffer into a string that does not exclusively contain valid UTF-8 data, the Unicode replacement character U+FFFD will...
Read more >
What is readInt16BE() Buffer module in Node.js? - Educative.io
The readInt16BE method is used to read a signed, big-endian 16-bit integer at an offset provided in the function's arguments. The bytes read...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found