Zazama / node-id3

Pure JavaScript ID3 Tag library
MIT License
285 stars 57 forks source link

Support large files #161

Open kentcdodds opened 1 year ago

kentcdodds commented 1 year ago

I have a very large mp3 file (over 4 GB) and I'm getting this error:

RangeError [ERR_FS_FILE_TOO_LARGE]: File size (4280247303) is greater than 2 GiB
    at new NodeError (node:internal/errors:393:5)
    at tryCreateBuffer (node:fs:434:13)
    at Object.readFileSync (node:fs:479:14)
    at t.readFileSync (node:electron/js2c/asar_bundle:2:9165)
    at writeSync (/Users/kentcdodds/.kenv/node_modules/node-id3/index.js:68:29)
    at Object.write (/Users/kentcdodds/.kenv/node_modules/node-id3/index.js:93:12)

Is it possible to support writing the headers without reading the entire file?

pbricout commented 1 year ago

As you found out large files are currently not supported. Out of interested what kind of data are you trying to process that it is that large? Usually ID3 is more oriented for music files and music files are not that large. We will try to add support for large files for read/write functions (probably not update), but that requires a bit of work if want to do it cleanly. We also are currently cleaning up the code, which will help supporting large files, but we need to finish some refactor before. So we can't really give any ETA for now.

kentcdodds commented 1 year ago

My use case is audiobooks (some are 38+ hours long). This one in particular has some music and other sound effects in the background so it's nice to have a higher bitrate.