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

ERR_OUT_OF_RANGE error during raw uncompressed fingerprint generation #10

Open
pralivera opened this issue May 22, 2021 · 1 comment
Open

Comments

@pralivera
Copy link

I used following code segment to generate raw uncompressed fingerprint for given sound clip. But fpcalc return following error.

internal/buffer.js:35
throw new ERR_OUT_OF_RANGE('value', >= ${min} and <= ${max}, value);
^

RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= -2147483648 and <= 2147483647. Received 4134789158
at checkInt (internal/buffer.js:35:11)
at writeU_Int32BE (internal/buffer.js:619:3)
at Buffer.writeInt32BE (internal/buffer.js:707:10)
at Stream. (/home/prasad/Work/Personal/project/sample/fingurePrint/node_modules/fpcalc/index.js:49:26)
at Stream.emit (events.js:198:13)
at Stream.reemit (/home/prasad/Work/Personal/project/sample/fingurePrint/node_modules/duplexer/index.js:70:25)
at Stream.emit (events.js:198:13)
at Stream. (/home/prasad/Work/Personal/project/sample/fingurePrint/node_modules/stream-reduce/index.js:11:8)
at _end (/home/prasad/Work/Personal/project/sample/fingurePrint/node_modules/through/index.js:65:9)
at Stream.stream.end (/home/prasad/Work/Personal/project/sample/fingurePrint/node_modules/through/index.js:74:5)

I have node version 10.
could you please help me to resolve this ? thank you.

@josewweee
Copy link

Replace the test.js with this and it'll work

/* jshint node:true */
'use strict';

var path = require('path'),
  fs = require('fs'),
  test = require('tape'),
  fpcalc = require('../');

var TEST_FILE = path.join(__dirname, 'test.mp3');

fpcalc(TEST_FILE, function (err, result) {
  if (err) throw err;
  console.log(result.file, result.duration, result.fingerprint);
});

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

2 participants