npm.io
1.6.0 • Published 2 years ago

hca-decoder

Licence
MIT
Version
1.6.0
Deps
1
Size
108 kB
Vulns
0
Weekly
0
Stars
1
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

node-hca-decoder

Build status

HCA decoder based on Nyagamon/HCADecoder

Usage

const { HCADecoder } = require('hca-decoder')
const hca = new HCADecoder(/* ciphKey1, ciphKey2 */)
const hcaInput = 'path/to/somefile.hca'
// or 
// const hcaInput = fs.readFileSync('path/to/somefile.hca')

hca.decodeToWaveFile(hcaInput/* , filenameWAV, volume, mode, loop, (err, wavFilePath) => {} */)
// => undefined (Async)

hca.decodeToWaveFileSync(hcaInput/* , filenameWAV, volume, mode, loop */)
// => boolean

hca.decodeToMemory(hcaInput/* , volume, mode, loop, (err, buffer) => {} */)
// => undefined (Async)

hca.decodeToMemorySync(hcaInput/* , volume, mode, loop */)
// => Buffer

hca.printInfo(hcaInput)
// => undefined

HCADecoder.getInfo(hcaInput)
// => HCAInfo

Test

# install node-gyp (5+)
$ npm install -g node-gyp

# tell npm use global node-gyp
$ npm config set node_gyp "`npm prefix -g`/lib/node_modules/node-gyp/bin/node-gyp.js"

# for Windows
# > for /f "delims=" %P in ('npm prefix -g') do npm config set node_gyp "%P\node_modules\node-gyp\bin\node-gyp.js"

# install node C++ header
$ node-gyp install # --target=<node version>

$ npm install # --no-package-lock

$ npm test

License

  • MIT

Keywords