Skip to content

toyobayashi/node-hca-decoder

 
 

Repository files navigation

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

About

HCA Decoder in Node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 87.0%
  • JavaScript 8.0%
  • C 3.6%
  • Python 1.1%
  • Other 0.3%