{"_id":"wavefile","_rev":"153-25b0efa6965f021372dd5bfc50e0cb9a","name":"wavefile","description":"Create, read and write wav files according to the specs.","dist-tags":{"latest":"11.0.0","alpha":"9.0.0-alpha.0"},"versions":{"0.0.1":{"name":"wavefile","version":"0.0.1","description":"Wave file.","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","wave","file"],"scripts":{"lint":"jshint index.js","test":"nyc ./node_modules/mocha/bin/_mocha","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js --compilationLevel ADVANCED","doc":"jsdoc index.js -d docs","build":"npm run lint && npm test && npm run bundle && npm run compile && npm run doc"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"main":"index.js","_id":"wavefile@0.0.1","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-Rx4yJInPzjfHtRj8FU0t6ATEZtqtMRFVmS4t85ISq9CN3nOMz5JNUEfOmL2v2XLfSNYgiLJXYBBqFjtWBkRSxA==","shasum":"6a9525db63168f93d26a323a579028ee1110dd42","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLpCMkTmeH4y8xBuhY7SB7fH9J/IU/wG3CzRz+3cAELAIgH45LgZ5uP0yhj62pmOyKgKuy+KDZn7C640vgcd0+A4Y="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.0.1.tgz_1509511750485_0.550615974701941"},"directories":{}},"0.0.2":{"name":"wavefile","version":"0.0.2","description":"Wave file.","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","wave","file"],"scripts":{"lint":"jshint index.js","test":"nyc ./node_modules/mocha/bin/_mocha","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js --compilationLevel ADVANCED","doc":"jsdoc index.js -d docs","build":"npm run lint && npm test && npm run bundle && npm run compile && npm run doc"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"main":"index.js","dependencies":{"byte-data":"^0.1.2"},"gitHead":"129a67a5dd0f8ef67eb9c461bbf115c7b7300d73","_id":"wavefile@0.0.2","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-yfUGKHecShzEJJ66Sky447k4/8IRMCcDEZ787YSFcUU7aja2bmVIxtey75jx/C8uJjW5zKgkoh/XIQ1YNvrZvw==","shasum":"b301ed10f3082095716bd6b4283c6803efb50726","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqvE8hje605D+2TrsV3dpo3zZNpp4gOORqq/7DJXQfnAIgRpAZvI6Uam1ETUWe5R2YoNB4cDIfgK1QRUGFN1o2Mfo="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.0.2.tgz_1509518337832_0.5235591635573655"},"directories":{}},"0.0.3":{"name":"wavefile","version":"0.0.3","description":"Read wave files with 4, 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","wave","file","read","browser","4-bit","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE","IMA ADPCM"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js --useTypesForOptimization","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"0.1.3"},"main":"index.js","gitHead":"a8d1b17c90ed30a76326c9c9efb66d617b40ff29","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.0.3","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-rFMd9fVCmiN0a8vQ+MQP0Sas46S5u+un6pGlIvophIMnZkfM+GicqTzmGej9HFDaehslCgv4iHUHA6oWp5SkDw==","shasum":"a2d5d457a0a5c76aba8686f4b60bceb8f89bb5c9","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDr1+EzTm1EwqBQ9C/tAAJpI9XD4GoTuuZpPGfj6q1OPQIhALMe5682nrr/QWSIpGZ6Ci6jiG5rYku/8Wx86X9baEa+"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.0.3.tgz_1509530050309_0.8157875693868846"},"directories":{}},"0.0.5":{"name":"wavefile","version":"0.0.5","description":"Handle wave files with 4, 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","wave","file","read","browser","4-bit","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE","IMA ADPCM"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha --timeout=180000","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"0.3.2"},"main":"index.js","gitHead":"0687ad02ff04eebcdc41f2764451b8f427cc7732","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.0.5","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-G2vHN5Uz2PxMOv/H7Awdm2xQO1ZyviEDMexLqRwVy5s7r//ojrSmj4NgHEpWcuNruLqxrwYTQY5ZgV/Lu4KMiw==","shasum":"d5ce55162b63b0f8746f2a7519f36c8e63b06a14","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.0.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkK7YTLcQYgy5wrg6rzWQzQicfcLyQGacDc5zazPM0wAiAZ7yNyXOlmsTVdtEDbX1l4jKJqUwsWOQ4c/z1xKoMRWQ=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.0.5.tgz_1510625974776_0.528353244299069"},"directories":{}},"0.0.6":{"name":"wavefile","version":"0.0.6","description":"Handle wave files with 4, 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","wave","file","read","browser","4-bit","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE","IMA ADPCM"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha --timeout=780000","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"0.3.2"},"main":"index.js","gitHead":"ea9505881d59631a69b001a2cbc50e854fe80fa9","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.0.6","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-nvnNWRqmHRM6xqE3w65HZNT2SQ4O1Fx9MPiCPhvuH+w4eVE5msBaFv8tflP1cB6bvtqdhampXcLYTr2V5ZxF6A==","shasum":"bedef1e8825d29e22c816320ccfdb4738901c00c","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.0.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQsz5fooJNvyi5HOA0OZEFzNhuYTmBEM+iDDXAfL/fRAiBVqs7HSeWiHgkRsyj+73PH/KafWplnMkM/V26StG6lpQ=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.0.6.tgz_1510924118230_0.32967912103049457"},"directories":{}},"0.0.7":{"name":"wavefile","version":"0.0.7","description":"Handle wave files with 4, 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","wave","file","read","browser","4-bit","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE","IMA ADPCM"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test test/from-scratch --timeout=80000","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"0.3.2"},"main":"index.js","gitHead":"4064de2af7950bbd86c5e6c0dafcccb9b5de4c1d","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.0.7","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-W1j58+fxy6ihr6Lmaurj/oEAn94rdLvOhy7iNTFQAVPdjelU5Cr05pfpMFP4G/dUT/i4LxLuZ7HWuEBfi/PHGQ==","shasum":"5ea1fbb94aa5dc06d81133009f1c217357a349e9","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.0.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFtJKuNY5CpA9IglsRK2RRow8r8C5xua3iun0Rk80/jAIhAO1IOpBIRpiLARkdho1CbLadDQ+xN0vJ2qc4FwaNrLv6"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.0.7.tgz_1510947851211_0.9886048857588321"},"directories":{}},"0.0.8":{"name":"wavefile","version":"0.0.8","description":"Handle wave files with 4, 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","wave","file","read","browser","4-bit","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE","IMA ADPCM"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test test/from-scratch --timeout=80000","test_i":"nyc ./node_modules/mocha/bin/_mocha test/interleave.js","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"0.3.2"},"main":"index.js","gitHead":"2105e33eb7d945ed802d9f44510c8acecf37cdd3","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.0.8","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-60zTKF2L1LjG5pKRvM39H11abIKN+7OV1qcGjOOzzqFwDYIPmMjMY8CohywHPl7DZVC2U0dML3iNwD/btnZ7WA==","shasum":"31549bfd5caf541e5e9e52e685bfe2504a24ffd6","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.0.8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfLDj3D7JYrG/plYxX4szakx+3H++GBnOINwebalVjewIhAKNGdE0OxK6mod9/eHnoQBFa3NihYPoPO2TluQ6BQviY"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.0.8.tgz_1511299011928_0.42381200566887856"},"directories":{}},"0.1.0":{"name":"wavefile","version":"0.1.0","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","wave","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/adpcm","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"^0.4.1"},"main":"index.js","gitHead":"9c6b57fef37e74a2ce52bda3a241ea8ea5ae1e64","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.1.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-3MnlClsH9sTy3PK+XfL+Hy+CFZMVJkK1Q0wt5WBF1M/RkexFsUQnlNwmhM56nOSYxIwynFbbE6n4OOFgQvCpXA==","shasum":"63ccc734866aab8622be7313502d80145dac4130","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBGkGiDvOPFgJfqdqkbnxTuCuEF87T57k9ysofWcP4/xAiEA7yWdYwl1cQ6lY6M/hSTSmk/h1mnkuCi/3KHQ+3Ldups="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.1.0.tgz_1511492879419_0.06596982618793845"},"directories":{}},"0.2.0":{"name":"wavefile","version":"0.2.0","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","wave","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/adpcm","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"^0.4.1"},"main":"index.js","gitHead":"dc45b45c1746d5a94e4d6d274f2b423ace40b872","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.2.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-C/RTbGbEUEvxBIe9tJQJekcYHxYwMHjwHHdWxwPAybR3T/EmFJyEYF56dXBwAE55QTjGbl0yjQ4ilGCjZnjW4w==","shasum":"6eb789bba056cee463f8ca8ac41e261d6ef52d5a","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHUGd4O1+d78fcGGUAKvsz0KS9V2O+dCJh0wr6cfo7zgAiB9jqUz66JFkCRFZR0DH9ECA6hdYIQFb+j0nFe4JMvjmg=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.2.0.tgz_1511494146910_0.729265644447878"},"directories":{}},"0.3.0":{"name":"wavefile","version":"0.3.0","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/adpcm","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"^0.4.1"},"main":"index.js","gitHead":"c8c54a6d06a525e7d5f604f9852626c1a81a4f62","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.3.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-UoQMO+PZot/rvsVR8WEyfmRJ0fpvC8ixjEIa9xjPt85JsGEy4ZDo0nFYonMEouJ6U+oXlqtva9rCmB2bQ7voYA==","shasum":"1c5a1c302bc05adc3b4d07dfa7391f2312bc49d3","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE/+WlxOiF/wuLC7Qbz0Ep5IOSLxpao4h+/A58mqZCHvAiEApF5AjZUp9EOdDzKDoQghcjOqvscaMFx74bn2bj137Xw="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.3.0.tgz_1511510599960_0.8074793019331992"},"directories":{}},"0.4.0":{"name":"wavefile","version":"0.4.0","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/adpcm","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"^0.4.2"},"main":"index.js","gitHead":"b3668a4202aabf08250ea83631c3070d68152ce6","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.4.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-OB1p8TbxdL8N3RjHttE26KNv8+9iG3NMMtG2hvfMLwcbV6OITtOBC+zsTfsetj/LTO1+yUM9TGLJ3VB6Xl+qgQ==","shasum":"eb7dab8c7abab15fbe9cfc955bd30c5bdbc94422","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.4.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIH7mBvokkGqKKroClVWYtUXXeO/Q6D7/NiEaPVBQg7SpAh8FbkW+TEfWyUH6d7jf1CYJak4Ejb+lph3eQ4MGyRIg"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.4.0.tgz_1511673250365_0.1976972098927945"},"directories":{}},"0.4.1":{"name":"wavefile","version":"0.4.1","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/to-bit-depth","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"byte-data":"^0.4.2"},"main":"index.js","gitHead":"bde98ced81c4c597382afd241f960e91b9534e3c","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.4.1","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-FOqnSWRUKG4a2iTnsUjKCm6RDhepYrfrttvFm+MqUnZXDa6cpzd4I69ddG4Gh4FysOYOYiuj4xWyzGzVWTHnRw==","shasum":"dc15db2b7a6808d19db0bd3a57a33f677ce11043","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.4.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIClfbSkjeBb5/0lONLLB/4eQcIKFcuztKzldYuj30LuYAiEApXVqX/75ayIs+ObcvAVTHbt2RQ9AkOPNxR236bVbM2I="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.4.1.tgz_1511711890460_0.09183541848324239"},"directories":{}},"0.4.2":{"name":"wavefile","version":"0.4.2","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/to-bit-depth","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"^1.0.0","byte-data":"^0.4.2"},"main":"index.js","gitHead":"66fc5ec03ab7d8ceda5b3c49c213e0b5d785d4ac","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.4.2","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-Q8d9lijlWaflFC2S2XokBWXfNTLUiZwCk3qqHFwrEe8sLQYkQjkBwsy+O8CgPVXm3qhSmbBm77bGEdR/0W1Vkg==","shasum":"28ed4631d4890b8aaa4e10280013a7b025253e32","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.4.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDWqLQ5/cDvoHwAiJSjmmiohoHAeJ77SYBU46xtwROUZAiA07WqPOESRT8BmcJcmTZ1xGOJwnCKghAR420AO05wTDQ=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.4.2.tgz_1511721381378_0.6955450167879462"},"directories":{}},"0.4.3":{"name":"wavefile","version":"0.4.3","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/to-bit-depth","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"^1.0.1","byte-data":"^0.4.2"},"main":"index.js","gitHead":"e4164e5e7e581dfa7579a4f6e9084849411fbe36","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.4.3","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-7FhdMk2A53vsAPTLU2U8v1S/7YMLkUfbg+ulfywhyJBI7RxDcdZ8kCWgwp/O7mzsF1UoDNubZbyiyfoalkYgBA==","shasum":"e3d9e69af5023cfd47dec5b7bd3b15e8e5e5ab81","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.4.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAT68OR2ihGYFcC07c23arLPWAo7BPf1LnI4nd3hvv0oAiByFyy4tRK0cF5mznFG/q3nD45FsfVEnugrEL+WR+ErtA=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.4.3.tgz_1511727130253_0.3280749076511711"},"directories":{}},"0.4.4":{"name":"wavefile","version":"0.4.4","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","bext","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/read test/write","test_b":"nyc ./node_modules/mocha/bin/_mocha test/read/read-bext.js","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"1.0.1","byte-data":"0.4.3"},"main":"index.js","gitHead":"1a01427fd1ba0ffb8ab4935b9a5fe707a485e5df","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.4.4","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-g910muPs2Somt4lkGQMgf6+3v1vJiEEpEzcjkNa4Jjo0aI/X1ursfEFVFscq0Lirg/RMMob43rFSoiOGV84gFA==","shasum":"398ba6df7900c245a57babd9dcbd569c4ec0eb69","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.4.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHfyplzE72PH8KwCzCrK93O0WYXcrDH+E9me5k/wNCpoAiEAlureyN/ttv4GGUkuN8YZYwo6OrhdnFEcjRkW4KzjeAg="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.4.4.tgz_1511743732355_0.48973896191455424"},"directories":{}},"0.4.5":{"name":"wavefile","version":"0.4.5","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","bext","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"1.0.1","byte-data":"0.4.3"},"main":"index.js","gitHead":"d7fa59331e29441678921d3cee30d876e6357136","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.4.5","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-EXsl2Mj7s6yhqj3h5iUNKj88OLmW7LyqVwjw0d2x+idoUMMdeDycArJOpqDJb7O7riwOb8R5Fr7K8jq1PCNwMQ==","shasum":"63ef01f3607ae53d00b23865d437dde86019a029","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.4.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRGgqZL6iHcQZ2RNnu2ONSmqLOG5aFdBoYylfVrdTeMAiEAoW7INphErT28v1NWiYnvw2XcOoAVh4leRKtAlPfQEAw="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.4.5.tgz_1511775064711_0.4403845921624452"},"directories":{}},"0.4.6":{"name":"wavefile","version":"0.4.6","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","bext","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"1.0.1","byte-data":"0.4.3"},"main":"index.js","gitHead":"d13d038ae82a154608c968a2140d1ac1ed3ba270","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.4.6","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-W/MlWC3hPszQ104K7hW55RMk7IYj7AIjC6u7IZUntYpIHot3uO2/DU/zTCbnBmn6pnVK40lFgIbSZWL9KWu5ug==","shasum":"00af15204c5032a434f2468067b1efd70e26ccaf","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.4.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAZ4I9hwP3/kfVzmclr7KE022UhJEvLvHqf12lByRullAiAZVkvaYq7oJKQsj7OEjR0+WijSytzdoaW4BJYsR+mCWA=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.4.6.tgz_1511836091043_0.2967435431201011"},"directories":{}},"0.4.7":{"name":"wavefile","version":"0.4.7","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","bext","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"1.0.1","byte-data":"0.4.3"},"main":"index.js","gitHead":"0b358ac84451e60431a8fe6a617520e24bf39c31","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.4.7","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-mQ4TuZKauSyPabT7mUtEdlreDyCZBiZyhjECKLnBMRXrgTjAwkp/jLJDy8F+Op1tYEGD6ZjzgaKpienHshfrOw==","shasum":"e7540d00b0a670dc67ca79f8eb5dff63d9bb5040","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.4.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA44GGXpF/YGWkMvAgBZh/v+1mbEYP4g16RBXC5lgBx0AiAZNgb/oMciDozCqB7fr0DTTXMbbml/sJ9DDT/xoG558Q=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.4.7.tgz_1511888860000_0.9010285392869264"},"directories":{}},"0.4.8":{"name":"wavefile","version":"0.4.8","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"1.0.1","byte-data":"0.4.3","riff-chunks":"1.0.0"},"main":"index.js","gitHead":"14f21719d14ccf0705fb129d3d476a67e16dd0ab","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.4.8","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-wdI7Pd2dgHthbTpBrQkoM8fIVuJVBBJFhk4ZK0bGVh+U3S0ZGBYK11/DdfXnywP6uO127XmHxP7swHLwgkFotw==","shasum":"60ac5e8f7de7d658a269dc4540951968eef8d9c3","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.4.8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICoy+8VC1vfC/v3EBE05Pcsk8xQxG0d9isPyu/WC54oRAiB7EuxtnCR5fGeh0pg8KW3KuOVHOUNdYTaTmIAuqEB2HQ=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.4.8.tgz_1511905563934_0.5796922973822802"},"directories":{}},"0.5.0":{"name":"wavefile","version":"0.5.0","description":"Read & write wave files with 8, 16, 24, 32 PCM, 32 IEEE & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IEEE","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive --timeout=8000","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"1.0.1","byte-data":"0.4.3","riff-chunks":"1.0.0"},"main":"index.js","gitHead":"211f1f9f867f21b306097a2e43012f001e4fcea4","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.5.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-AZlaqjxQpKfgAdDf0EhsbXGztQrfqF+tKNmDVTwcRpPtPhUSyc0J2YSY5Wrzn1ibJwZl1oacNPzBKNA2jX+zOA==","shasum":"a584d3a0088bc625688d6eed0a7a5b2f31160390","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.5.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZi0HsQGgo8TVJe69Du7ynP++gIGbeP/2PxJEcM3IBrAiAF4MiZLByejg1k1UaIDZ8nENKjcuHdxPy70nZLMqLAcA=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.5.0.tgz_1511907625422_0.6154191335663199"},"directories":{}},"0.6.0":{"name":"wavefile","version":"0.6.0","description":"Read & write wave files with 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"1.0.2","byte-data":"0.5.0","riff-chunks":"1.0.0"},"main":"index.js","gitHead":"99a577ec2dbdbc45090e18c9bee914cfe5fb073a","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@0.6.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-FIxE+mBoQ5EbogL0nYwMeYkrVBtX/k7IDmzNhqCGqkACoGWgSVSZcqPkV6IN4ISLjE2vEOV88Moik9c4Jn/sSw==","shasum":"1028295402f8ece5e59e7738d518127f42b06cc8","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-0.6.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPEZqINk6H3/2ZgoNNigqzKVdbOP2vt3mXQcj5uNOMVAiAqo0lAJczBzspelb5UVCo0s3ZckGCf97Ty2pWR26qeww=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-0.6.0.tgz_1511925840711_0.06983874761499465"},"directories":{}},"1.0.0":{"name":"wavefile","version":"1.0.0","description":"Read & write wave files with 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"1.0.4","byte-data":"0.7.0","riff-chunks":"3.0.1"},"main":"index.js","gitHead":"ef9a0ba3880255f70ecff84bffcd78913b2d1a73","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@1.0.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-Jgim8NHYxlhzgWLcdDvGXe344fULKK7+6tNF2eQu6fb/KECTZ8e3CQQi3qNQ/n4PG2DoBwPOGumJRFCr/ahqow==","shasum":"dac6f38fb1e8b342492a730d1051b5e15a8f2c69","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBk6z6ugtC4P7ckVsPeZPIM6EFYatD1K7hZQ7uU2wC58AiAsuOQKAxWtsqX7AP+poUpjhL4jwqjC/4SvVjgiKVQa+Q=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-1.0.0.tgz_1512097124329_0.3258272735401988"},"directories":{}},"1.0.1":{"name":"wavefile","version":"1.0.1","description":"Read & write wave files with 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"1.0.4","byte-data":"0.7.0","riff-chunks":"3.0.1"},"main":"index.js","gitHead":"e9ba6f539a48a87c7f09d9bae4d12667b21b6652","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@1.0.1","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-JPk73CUmi2taV7FpK/AsdshJ8AloqAqlhPGIRhBVpD+XzuDcMZOxpbtrhGdsN8YYQ3HyNamvIIps3EqXsnGv+w==","shasum":"18ebabffa734b2de216eb6d87d01513b005998ac","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMCIqUym3dhacwo1JW/DVaifkxxytNvAnamM3Q0DMkygIgCy92msgXspjhUsekX1C0Rq5bSkl2z0EN9CWjSUZ/fp4="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-1.0.1.tgz_1512098866937_0.03266780567355454"},"directories":{}},"1.0.2":{"name":"wavefile","version":"1.0.2","description":"Read & write wave files with 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"^1.0.4","byte-data":"^2.0.1","riff-chunks":"^3.0.2"},"main":"index.js","gitHead":"783dbbbc3c85d183c9519f74f1b91fcc14ce4db9","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@1.0.2","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-XIAHlz2C0586NoIuy+bELKFLSx8bgesJ9k9M6RIcw6xe5mVs20lDJj6W1wgc2lRnqULbD9Shkbuhs3nugGr05g==","shasum":"9f67e38ce90f3c616fe377482ef45c2ad94825fc","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPis14QLR4z8uzbZGnaRoHoiimqcDEit5YP74qNyeTqAiAl2x3+Dn/XPqxPvP80TzJQNs+5BFFCkJX3a/YuDMPh5Q=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-1.0.2.tgz_1512277820179_0.7372903870418668"},"directories":{}},"1.0.3":{"name":"wavefile","version":"1.0.3","description":"Read & write wave files with 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"^1.0.4","byte-data":"^2.1.0","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"4de205fab36e022c10704c34ee2180e88840aed6","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@1.0.3","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-ZHkhjEfDRZqdag0AwCs6mD7jFFjISMZMfwSqdlZf4HoBzFbAAIZi300ptfIqeSHpQxBQex7/Lz3X2DS+phxgPQ==","shasum":"1b8112a12e52a3d3b8eaa738c1008ce7e0de8eca","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-1.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVJ11vEY8xEVh3JeYROiiXgCp8Px7FUHiSgQr0518XkQIgWcsc9aCDIiJCPtcJ0lP2cxKU7BeJze5PrOEbuFJM9kU="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-1.0.3.tgz_1512294917034_0.7449873376172036"},"directories":{}},"1.0.4":{"name":"wavefile","version":"1.0.4","description":"Read & write wave files with 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"^1.0.4","byte-data":"^2.1.0","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"bdd47b4e27b85f559cbf985da329d6b8bd167828","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@1.0.4","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-n4dnxMu5WhYEMgn6VFpFa0H6RJLfbt+2IifJkWqP7PgxITgpvnT/s3yQVwLj7eSA/SjZT85O+UqVDqklbCm4NA==","shasum":"03c83ef7cf58a3ed14e5f1169c1ca004000e28c0","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-1.0.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC3GgoQHSS5m9UZZ0HTlb1LUc/lbD/GSLFQmKqWqd/XiAiEA2Nem2aBKz/fhuqOYyCtx98I17APJGldVGp9YP2srkak="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile-1.0.4.tgz_1512408598149_0.9105008693877608"},"directories":{}},"2.0.0":{"name":"wavefile","version":"2.0.0","description":"Read & write wave files with 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"^1.0.4","byte-data":"^2.1.0","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"2423e17aad8fbff2db99d03a64928dd1a3629ada","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-fVpBVEvL8kYvtscLCq4f7g6uNmhwcytUKKixxVtQhP03AVBOZG9l7JWI3KKPiyRbKQFsffY4lnYC9iVS0r6nkQ==","shasum":"044fd7ae24b4ab2d1ee4e2011f35c75136912cde","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.0.0.tgz","fileCount":27,"unpackedSize":306005,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAasPef2JFwLwIjKT5otcwXfhY1EqTzwVqg7wvtUEDVAIgMagLtgLggFWgFKYJmdPKgflI3gAUf9zZAvd8yneBzag="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.0.0_1521809536177_0.020113094348618743"},"_hasShrinkwrap":false},"2.1.0":{"name":"wavefile","version":"2.1.0","description":"Read & write wave files with 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.0.1","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"8a87feb52fd4379fafbc9e7b2e7b3761473c1565","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-dTMWPRpqz2HxQsli0yaxL53YCWdE2dwafGaqzuWfimjBSRcCCw8sutm8iSRDIRBZ1qjZgywU6158pUgTkPhFCA==","shasum":"e47f8e9cd74c8d5382b85a4b50eef67a2ee947b4","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.1.0.tgz","fileCount":27,"unpackedSize":356546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1ThsCRA9TVsSAnZWagAACo4P/3efXtSm32e468lhfeW/\nBFdfemSp0T2wvTJ/Oan+rBUUuZNqkS5xMMmw1K+j0qeTSZVoOSj/U1q++evS\nrQnVqu4lBYR+wjOW2iTeToRT9g6+cW2oTyjc7TT3tkqhgX3RFifA5q+acPJJ\nyO5DWBqEbpJJWh87h/yNxZ1mmh+l+s4nsI0iEvHwEk0PEPkEyZYDUKDlDNUo\no17VcNgtVviww3v9AIVZ+7ZHByjyifoSavRHbIjNPjZ7Yp+rXeltlkXcVP0x\nyjdJ8lSUteBfNduSd5nRPgHozdvB8iWBbbLqsBXlp1owYndujYCSCPvamZmm\nnBr/x64iQTKAf+5m8dtafUDfvu3HLHdUVawy0uWHtaYs0ojiwc16zcjxzQjy\nvu0fo8crS4X2kuE10PVwP92WsSxtBqCBypFCQ9N5ejL5OvdjD5XcAgOcpdUO\nw7lgj72G4r0DVhnEaRM+g1lQF9PzzfuM9qGWwzkVgYqcOjSy1QyR7D2t1/QQ\nR/qRRgzuyv1SY9FNwGZVr2VY2PLkhrEyZx0DvvO8Ph321nowkQuEejBhTPwn\nBl7X8QLi9sz9B0McoBxIdSY8AVKW4yj/Ps9heTdlrunuu+99UdYuvsPffEni\nBcLIpi/9t4UsFfh4AtaG6kqr/l5Ocv7IVNHhUsxQW1/FC0+0YgDsn9g+H3oS\nV5XE\r\n=xERs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGxXDZy0jGfAH8C+CdlNmJaDsV+dcjej/FApaK5uQlrgIhAOxioT3bcoc/OaugzDtO2CANwc3F+lzEakDyrsORxJ+O"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.1.0_1523923051171_0.12104941070352226"},"_hasShrinkwrap":false},"2.1.1":{"name":"wavefile","version":"2.1.1","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.1.0","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"81c1c16c81f1cdc1fc790c96b4ee151f371a0d2b","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-2CP0MXtJK5RXct9kZsgFlCZscHKmAvA1EyBGMsyGFd3PfP8GtKoVIrn3yxfYaK/ll65yMxF+KUp3h8enClm16A==","shasum":"5d7bdeabaa7ff060904c4657aa6b16ec16b6ac0a","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.1.1.tgz","fileCount":27,"unpackedSize":355549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2dVBCRA9TVsSAnZWagAAozkP/RfmUVSPuynO0a3xWdlx\nA7I+2fRDTjLwxjpPAT6MHczOhkVHbN1aJGNdOIfYEAX45qmzURzLgLO0p5SL\nu9ddowcKNg1NoC56E/dPCqChl8DRzzKDPPwF82nZczPyXRWxWHukSomU5NAd\nLbFd5+IEQBXrdLuo+rBT/wK0KF1zp+BhH2bXcJRg9bAaUXhkbUxi3GHU1JzL\n+ghv77h/CWNIPr5Q7+LoNXsCtP1qknXrauMNTyR8veAvralk7pVyFm1/laTk\nnULc7PyHHIhBA+KNkY3zprpbXu4AWf3C3AGP0fWyhEOBz87wYHA22wfCtu37\nY5d5nGdMbsWpsII8veqdvpUMaMBRS/aXcwQfhV8L4B3rWSGJWh9sdtC465sq\ntFE4DjlhhV356s4qBzwIEiVUZJ53+fnneRmk1CwP/CNw67ELWXWRdBxcdmfp\nLv5wxkQA1mkU33ckZcVsvrWteDI2EzWFbOqszVO4EN2TRZx7LPY/WQxcjEtm\nSyBD+6bm4vnckbxs7S4d/54Yz+dphEzew4prmljw7BpLgCmW0jFycgjRoYc5\nqoOyQZPu1RACxYzJmTVM2vHJQI0IIXRsxPu9NRAUUvGPS+ITV4j613SMsb3L\na6hIMfTJ+soXYITjf/OBXfhXQyt7ZdvJGC5tFNnKDWy8i9BXlSxFtYw/IQqe\n6cEj\r\n=Stf6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkAau/9IMnjiheiqnb6qtJtvs17T/3i+n8Ycg3utYPKQIgXBipDkxVrBOsFTRef7pZ2CHy/GWAK37sjXuWG3LcxDo="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.1.1_1524225344113_0.9737739909234329"},"_hasShrinkwrap":false},"2.2.0":{"name":"wavefile","version":"2.2.0","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alaw":"^1.0.0","bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.1.0","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"e857d276cfd14bb8041510e58537a423544e4f8f","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-JoWpzAfWagh54ev7KjVRrMJGW2zfWlc9Q/L+lP5b1QEZBZYnLCpLDqPaXkWkRcXJp/s7+5i00ushRXDOH4E7PA==","shasum":"dbb5d9eb8e64d9ab8a883771543a9ccd74b9ea2b","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.2.0.tgz","fileCount":27,"unpackedSize":365766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2jA5CRA9TVsSAnZWagAApFkQAIL+xnvFxWHgmVE3OwR/\nsmE9kuCXY55Z1hunM7qSDE3uBlTv6GhCpRMQoyXIEPi5d4p1MqLiETr3K247\ndONtl8KdJRL9g4gMvw1Jfn01tLb03hYo+xctLlQoa8y1kVDtObI3frqVu5NU\njmhgXwmoVCVMO/6IuE2FZ3Cc3DUfwFfqIqaO8SbUWRuPiBReY+a0UgSu1ran\nNz2d14++KKXZRzYlaGokDsa8L9+61zBORvK1fqKg1h05HyVRskryqOgJG9bx\nc1J/BFvu+ZJnXq8NRxribgSFpJgjuGhDEJ7uMwGjcLW2JpET+WpE46Ngpb7N\nSo/XOZqkBoTluVjNkwT6BJNyJ2rfG3Pf02EtPMahefo65uE5r4KqhxrdUE/d\no3EsltRj4+d5P5tno21rQcjhlSdp4sb6EfWj20flE4HO94Ua6ZUERosPERPX\nhbagLufFh5/zsLJeU5dlYUjASygbzbpxv5n7s49TRZa2SlBV51UU7dTu3tuR\noUrWYSQ294m/n1Jxj7exlpjifbFRmqqhHK5fAxpwepC/CNYXr1fVsUnS4UTx\nMNDns5nnsSxIb77h17AG9mODtbdg9703KTWOdrfOPApVBLD5unktFlKtcaCv\nxbCPJIslRyrPr9b8GolFBrGwB+momLlsoo1iKqwu4+VZsWRYslyvaYBmc3Xc\nnnin\r\n=iN7R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGO8+9JuWmmu3EvMsDRlqGLxUdSPSGXgvuEWEyl1H6u6AiBI3lEK5WI3ySo5EZ8K2kdzcwMLHfV7VuWEBFqc8cO3Wg=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.2.0_1524248633021_0.7606727585640414"},"_hasShrinkwrap":false},"2.3.0":{"name":"wavefile","version":"2.3.0","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alaw":"^1.0.0","bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.1.0","mulaw-js":"^1.0.1","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"e857d276cfd14bb8041510e58537a423544e4f8f","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.3.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-ROQdBQ4ZwH00MB7T2O6OPEJHGSrRuPg+8a3NHO71jG27B+gg/qYNGSK3g2OmceW+Zto8+XxIZeLkyfwSedf97A==","shasum":"bcb3530b85b161c64ef8a14555861561996f1e56","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.3.0.tgz","fileCount":27,"unpackedSize":374827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2lAKCRA9TVsSAnZWagAArZ0P/jX0nVjKCYP3QOZDKcYC\n7RqD9uhj3nSaFzurLxb7Htkt5AQuk7fXAMCSso1R7n1isMOwJ1nybrwD3NwL\nCaoIlx0HzMEuwt3qI2pmbtR7k1GqXPSYjHk5+cW/3DCMrtzZDvsDgBn4KOzJ\n7oimofAF4RKVf5F5ifUFzv9VecllkTxOwTwm9254UMn9ncGkxsHodk/GxmXq\nSwUJqkQnHIXJKVltMVV2p/1y1Vx0oyMypSLA4sNanM4ulcNanLczkoHUoabe\n/6b9SEwYhpgb9q2PZs9Da4p8q8NqItTIwNX8fmbNQADWRuEnDkwvPYk82vGB\nV0WEfd/3gt7NR/kQJqYBpNDcrtd7u+MfYuFeZl4VIz/OmfHMtSGr1lRcgkeV\ndVsdRjzcB6SwHER3CglqxRpAUol1JXTT5Mc3XN72abH/E8Fv+0l4wad0fJq8\njItQgqq4pwJWkGZn0FEtgK+cphULddlvyWPJx8aikm8sAWh+RjW1dPUgi9h1\nNfKweJ4dxF8LFDIaE3VbH/onjSDsFAkPav6v1aPSvYb33JpFPvnNc7rSgxAw\njqA8BvnEix+9wDLbk1ZwYy9cq3NBu6YWl7NGtAoMVLbgjDP4j4qM0M+rqE0b\ns0uReoP6TSKCsM4Ar9yOMjITXdWND2qzXmjvSGdYtKjC7ADt44fACgE8UJoZ\nklAt\r\n=/0Yz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBHnt2oTBCCme+oXS0Xy6S5KNy59g1ik8oI/CVVw7sdpAiEAri3d5EGpHa/xl5GgSXY2fndqrnNj0+vRNb7k40/iOWM="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.3.0_1524256777602_0.12838715245086352"},"_hasShrinkwrap":false},"2.3.1":{"name":"wavefile","version":"2.3.1","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alaw":"^1.0.0","bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.1.0","mulaw-js":"^1.0.1","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"e857d276cfd14bb8041510e58537a423544e4f8f","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.3.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-QJKuVXiD2zLEZQuCwJhneQy4RQD0tNSe305gtCeJOjWf34t50zbmBEQCw5K5XSRiD3DM1L/sDV5Xj91nXjVSFQ==","shasum":"be19c664b9e4a2d0d8246e89269003cf6e7efa22","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.3.1.tgz","fileCount":27,"unpackedSize":374827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2lCvCRA9TVsSAnZWagAAYIUP/0s1btsOqaMpVwwe1tGZ\naM9nQAt2y3cPKRUsPED+NSuGmrm9XOLj89IlJmOEo+svP/tIeeBQQqhFxmlf\nTgrwgCramZ8E9RJwPoU4NflTB9desCDDwzMdr4fVPT4XNqYNsheXuoMyoHd7\n9wquGRHVYgNbS4xVk7TjQ2bM2dKcSUL/Bnk/JC9yuhQm+yqqguR33hB4vySF\nqNoYxvpyIjlkUq/OwO3+1X7WpTjl0fM6E1iJ+ffwO7ZigDAYL+hSdHm/05aL\n+4EOejr/TsHPDTQ6zwZZrrfK4RSkIjtTB0TLX++KSL/e/Se59yEMDm87twkz\ns6HEEJ1RbO07BLg3TapYyzvWpo7gMJc81J0uyjiXvpjsplYsURP4nbpwJXeR\njvudmu2hrYzOkt/nrGAg3riBFKuLlwUtLzPUrl3P5UMvrdiGlJ1IDwxZKAdD\n5xM+O0tRu5EAj0DpW3wnLTp4I9mTrDvWPu27daBfv+z87BeTFrOoC9un1u3Q\nAoJzDUjrwHsnZXPB4/0eI8776fJQZSZkFImnRNgKMjvoMDj3SwsRu+xquUev\npQLpaXrFRKo3YiFR2b/3ihY52S1Zp7lpG2lLoNb354LxPLTGEb9Em8BUazZa\nQe5XvBFaaDKTGe1RydG4rXXfh/Fn2xBjNjdzOzxZZfThhAzeHYdDMANCN64I\ngH55\r\n=Hioa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD44/xWwHFoy1VS+wTZo70jLUSVebL3i93kKSLR4wsU8AIhAP4cMVFgO8v2m7XHzYOqh3xTGo4RCcU7JudYgpFQe9UM"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.3.1_1524256942650_0.13338393892367328"},"_hasShrinkwrap":false},"2.3.2":{"name":"wavefile","version":"2.3.2","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alaw":"^1.0.0","bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.1.0","mulaw-js":"^1.0.1","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"e857d276cfd14bb8041510e58537a423544e4f8f","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.3.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-do1HET1q9Wnb8YmVW/XwFgHFAhcWJ5c858QaWtL+7r13lqSuHMHQx4o07eRSbGAeTGqfJZt1rjNN1WX1cGmZ9Q==","shasum":"7f161edd705c32d8b3beb91d0c476d6bfb6738e5","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.3.2.tgz","fileCount":27,"unpackedSize":374831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2lD4CRA9TVsSAnZWagAA+ZYP/2RKL2Mf2KLAs30/TBr/\nlq/mx4ZCBft9EgURvQV8yKJW30zsoDdu71mLAH/szOvS9hm8/vLz5cXsru6O\n7VXmgObivU18t5GF8XDv99QZA1VHy9TWrTgieaSYL2FrsODtW29V3c0QswO9\n0qiyYDCTX71yC+G+WTI+XMdOjkgim2/8FTc/OrUCGpaIOkoyKId6Jm7fU2Va\nQ6wPUvkN+3HgJuGjxhrmAIZ+43JWOSxtEPyVHUNJBMMiruzn3E5kxw75EbD6\npfDcK1S1MEcLPtMMyXCk54S/1nj2QVM9lEDyW+dWTOXXadmMIyH/kE5hzwoR\nRbMHIbwRMrE38S7RU9QZQfQgZ6iPA5VtHHNcuUHhYQZoHB0bIdqmk+uxQk/6\nPM7IJ+Sxna0BuEWJwpSm9sGh1ug+v/n9dQVF0V7Xgcr4h7f/fbcrhH8dzPg1\nZe0RIbFVR+9taf1sekNhVMLejPE3FdqwILGpCStcsxc6dQIkGjcZA5HADqrX\nAIn/udOaJqnhtnFs5EFdiykrueDaaJcDUOqkCB9JQkmSNh/fX8IGeOcmT7yC\nuRoo9Hp3g7wMfbQrv78splBKkbgZ4P2ipiDka8Guqh2ImRnBPEcXl5a2Dff9\nZtnKJX4HvlXMBsofcf44FBzY90CiqX71l+REFbFzedFxYYM6iH6GSklIwtZ0\nquWX\r\n=tJuy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvIgMKioKifJCT1CHSUwzjzoej7A8tgrYZP2WXpXgTUAIhAP1+ppTmI4CYcseNtJGrToMvGNkTRkYV7tWtozwde8xc"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.3.2_1524257015878_0.2817368544257848"},"_hasShrinkwrap":false},"2.3.3":{"name":"wavefile","version":"2.3.3","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alaw":"^1.0.0","bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.1.0","mulaw-js":"^1.0.1","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"adb3b1023483ac771a169020ba49db57a4136d7d","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.3.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-6A9Zqt7ucBIhpimp58pR6Cpn2HBiTRzwHlUEmE99sVxppE97nNl6Ra6xhtGg/0ufDvDqM2iMvFAjatZ1FCXDQQ==","shasum":"4ff0782a8efdb7fdf55d9d138670cf73cb04f069","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.3.3.tgz","fileCount":27,"unpackedSize":374851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2lK/CRA9TVsSAnZWagAA+YQP/0Ot5IjptvjxdTbuBDJv\nS04NVLKkMkajvOTExihE8gZpv699kySN64Y2Fyfg7VgcWZf1Cz0lUjSAO9j9\nHM1Rc9/Mmjy5xNSkYb/9YSUwMg85LTFvd6N+xsG/6QkgyZDCoLYEarGxqoAc\nNZikdeSCpmmKq5SKSDX1ONq24Q8uD7xmmwgQO28iwrU811EyZnirg53F/28E\nQht8HnbPe045DNqWJwtxAySX4AaaeLaR4qArvcFl/NtreCQMYJa877Qgbh7Z\naCR664wwb4NAcZf23MlhxJm6cqDVPfoiD8aN38XgjDL5LhQnzOG+LK2hNkfc\nhgkbUG9N643ho8Dolll/A3PvbLBpg0oeRjE3+c1gVQckSIJESAsGWmV2laVc\no0ehUv0PqhVWmtp9QiPQ7UbMTzbZhQKk2v0kPryqouVB6Cj6D+aUxK21hK/h\nlvid2MJQ/HrGLn3Evnzxu92F2KCk9B493yP0fxfR/+qvCASZcEdBRX/foK49\nD5FeJ2kDWmmcKfXiZacH6Ym0VPXEVijMmq8JgP8eTA4VcdK1QxiYnLOqmc4R\n6Me6a3PyGIttW4BQn8Hs821ULQjj1XC0/oPcY19ioWPjKUk8p98yqYjT8f3L\ngXPNkkG91oBA3q53El01Rw/AZtWOVDryGXnHa6G92m3l1bLrQn6QzInTFDpd\neVyP\r\n=y53a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB5FkvLgQhc0astK68iA43JwRWWXp5i/sLFy5Oq5xU7BAiEA4bLBDX0rSDJOQB601coKlILlj4zei7kDCDLEqeXr+JM="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.3.3_1524257470980_0.8238168555996366"},"_hasShrinkwrap":false},"2.3.4":{"name":"wavefile","version":"2.3.4","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^1.1.0","bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.1.0","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"784d38ce7ca7a5ec62175f6ac5f0c93574e00797","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.3.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-5D8Oj6V1t1uORT9pY+jBelHinNdIhM2SqTSakOCbFJ3rupr0PUC/miVELNxGHKLMXC1hcnWPgBTp8zlb7UiDzw==","shasum":"f3e9a983d626daa60f555682b2338a7db82ddea6","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.3.4.tgz","fileCount":27,"unpackedSize":375379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa27/1CRA9TVsSAnZWagAAx1oP/3wwsON4n6qTAW/vwr0t\nm1RQpRkBClS4rcTK0ADHgsLe5OmmyB5Mt5Py0jVfwyCkHixOZegpa5Cc3nT7\nGrBrqNhdmUC62AHvRqCVtHaa0/ri6hVYwC08cGscHZEVijnEgnHpmUz+Zj8w\n6Wz5/dOEv300U1nQkZ9+qxoyFQ62Ubt5czmrP7aAEMgg+jnWHM3JG2WxZE5v\nxF+V4VP232tDlj+zePm0hZGBzsKAXmIzFGS7culTzEwLytu94BTuYpWU7U4g\nrl7I+f5yaLRR6NvOcOZWeuq6+mwX4VEb2LN/h49D/+UYIhkEHAU9rSKr5hua\nsdCk22GZ09uzRWNCHY8y6caPX6KLu1KYnncpumgC925UDPag5+2M2eFaX6C7\n8YDQOG9o9dG9THPO3fuoLvac0coW82TYXfPC0qg+5SSyB+gmU0Sy+N+fN9Ol\nrIN+eI7fBEa0m4X5L/j/NaZtPSkD/+3Hw8Dch63oa0gX+3f/v/fH6wzawbx1\nfASin5B9ZoRhy4kEsQYilSI1ESC45B3sAp0E9JE8oFGr7ITw2Lhdroz27Jf6\nCsoUVMFDVuGK0voFvUmbFHCZF+0+CStZegda7HLCQPbHJatMZ/wySlQ4pKbF\n8j4ZJhD4fX9q5s99a5IpX+px1yE/AI41g7h26xmTRDQYQcII41Y1dT2kH0We\narKt\r\n=i72Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG/yaurz9kjCkT2xNc9gow1CudjHgHn7mycbXJu1FT+uAiEA3qFmv7Dh340+yTuH6zF69LhCKWeMQ/yLwdiLJaQgfBs="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.3.4_1524350964621_0.9150211722703672"},"_hasShrinkwrap":false},"2.3.5":{"name":"wavefile","version":"2.3.5","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^1.1.0","bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.1.0","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"47c54041dec1ac0593062a8e0f7a21d72bbb4c33","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.3.5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-N8RMRIE9YnqnJ/5rFKV+6r3zezWHlfPm8kEn1Xo7NdTkxc/18mLuk4IvKMAfWUhvd5iu852Icap6Yq35dbZ0XQ==","shasum":"8bbe2c6bfb169f5766a570195f80ab6c032e61b3","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.3.5.tgz","fileCount":27,"unpackedSize":375430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa28Q4CRA9TVsSAnZWagAAWvAQAKKHjPNYdTn+WGAy6cb7\nasBcJ34fzqD4xC1Fh3/hcmDqrBfbTVDRY+uKFJFq/FAijZrOxiMaF/vrzazW\n7GAp4bcxzezBjxbueQCsuBnl9wYe+Li9woChQXD1ZkICZI6bPzMtf0Mtgs++\ncEHzvkKiTRc0cPRZ0LCux67m0nsL43g3KookKPpv2ihLgrcHcAVxglZAngaS\nApzRbEb3Dz+MY++Ghbl5K2zhY0VILhYRMQwCg6ksofWjZq4RhQgTYMnOn+64\ntSSoKT70pSW655RZ/5FeCmxjdxIJyxqk0vpOzkfAbHXRt23BTSMRP78zVNfa\n09vTDhcPOZL5ScNXuSBivNwLFLW9dc7ZDGsJQT73r96P0ePlx8z0pTYezrWE\n5326dgejxBsdbN/OWft79wwnp7H9f92r0wO0k8PCEFg6mEq8YLZOUJ2wplB3\n7WyMOt9Sv1hG3v2RtchathXpDNMVM2C3SQDzwuQSFq8CvtztQkTcGGda4kgx\n0HAIR+ftfhe5XYfgFtEpy8PlwB7I5dqxziLlHc2tsAQ7yyQZhl8x1TkAOMAa\nBtsqmIzFCbbmiNPbxoCy+I94xmpY3YEIyLZUNHy+RtLqjrti4hw1hZXrYwkp\nbMd/yoa6Xoizwaz6RS7S8U447yEOptLOkApS35jN/rqv053oSgInhEaC/zF/\nu79s\r\n=74FC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICIQHj9TFA+fOqa0FomcugDWFh+bNDbHBzovOQjOwoIPAiEAks13gZyVIuPsBx0G4px7PZNkeixOsTpQrSiNaKAaV4s="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.3.5_1524352055814_0.987714835633529"},"_hasShrinkwrap":false},"2.3.6":{"name":"wavefile","version":"2.3.6","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","audio","file","read","write","create","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.0","bitdepth":"^1.0.4","byte-data":"^2.1.0","imaadpcm":"^1.1.0","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"200a7f26b7e0351b82284c21dfeabf9ba0a503ae","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@2.3.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-h+z9VuWxxL5SHC3HdN/VSId9X8GhdJq24BbBUgnecUaIvOxFPQLE/+CRkG9gIlFQdKgThtuJceO3DJ21N3dgXw==","shasum":"4ec9cfc9201e7d38d23f688a2f800b930560ea0c","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-2.3.6.tgz","fileCount":27,"unpackedSize":379037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3NSvCRA9TVsSAnZWagAAWdgP/2TJHscFB+/yM8nvhhcb\nxB83E3mx0lB1YWz7lUABzk/53aWhE91IXkDu8gkQcrnUFOf9Q11UIt1L1a/q\n8iEdv8f7a2f/z2gDspHb9FLxRRHv4sqPoPDGQYjowcwD4e9GDAF5kLX3XPjL\nSGNQNHTp0Nd62zFtU/JI4tQ4U6b6UiNU8xlz9H+IXStDOjXCmv2heuN/m9WW\nM3JYblxoyYOJ2YwYxn78OyJqBSa9RP8AR8OpBIj6SO+9kz6F2tfvkJ5ay1V/\nqkGWD6LJv2mQLjm5OFjNGAa65Mv/gG5Av4B79kgpfkb+EoTdpJzDV652xeyy\naW0CSJasPfBWMcLTUYewj8ydxkDMo1w4banJMiR0UxTRW6G8rAojJAA8fYRu\nG3hrBBgU2KYC2RRuLG4OIjas5UEFSQKCaCzcRVt9d6Rdk+ySL/XQGKqeWpGM\nlmx7WOBcUVxBjzjuSj6yTo6rMAEJu4RULaJASSgigzL5j1As5F5qKv7q2hrR\n95Pu16Kzlr0Qp40jrfto1CMgUkZKr+cNm62LYUitYXLhoZPk8OJHLr8YpsUd\nYQ3nJnixydrzcgn8sZVdeeesYTZrUZEj2usiY+IKFwi3eBXcJi4BxKJgz6Dz\nDF+uUqylH0ac3ejrjtsPtYvBv5pyp5OIdALl1dSCMykONc/D5lYOal1Nv83H\nHDbQ\r\n=vTV3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTLXV8gQz4/ylNhYt5FN/25RCUPAdiZMWRTuPkRR175gIhANq8RTAbVRPprArdqYxDzixGXRZrjOvsFduClczmcz0w"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_2.3.6_1524421805716_0.7925984533115242"},"_hasShrinkwrap":false},"3.0.0":{"name":"wavefile","version":"3.0.0","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.1","bitdepth":"^1.0.4","byte-data":"^4.0.2","imaadpcm":"^1.1.0","riff-chunks":"^3.0.3"},"main":"index.js","gitHead":"c049889a0a0366b2c623dd97294e1715ff9d391b","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@3.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-dxU2pbC3iUyj99WritW6tYa/tjTjKZfY4Q8wArJK+y/eiriSyfC80CXCOdEc7NfVko24QAjrbTdTvbZM1lthEw==","shasum":"98958e8543281352277748984eeec0df03138b8d","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-3.0.0.tgz","fileCount":27,"unpackedSize":350128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3+gZCRA9TVsSAnZWagAAuxwP/2P5GggWwo2mtMTWrTid\nXepcpKmGJmDvdEHrU9mRY1cXSoONLoTyjmcuBwHTJnkujMbi5d9LaoxyslEq\nqi+Ms9Aa5FDOJxEaJMghrjci9ZLejFSdSN28rf+nj8DD2HThz0m9MMP5sSd+\nmxZRR1l25VTLzJCdt/hfivgUzm6PqFlLepXcx1OXnJK8X5Eb/78fWA3Dc79x\nIgZKbfCjQldFiwsi8ovAGHEF5Kd8Zk8KdNXJ9sl1XHyyu5S0B70YpG9BNAB3\nKPsYkrdCwyvAPwtwfhqQuUBPpA2jLW/HjkoQavJ+5090iCJ/63m0Iky1UyZa\nC7yBMNy2tO5jfcmdN1vtkdAXhLkvcUtsW1WfdD435BM4RrdAA9ZN0F+v6q2S\ngA+CCWKC3yE2udyo+qIchUXZCXvn2iGN8PkESsiyn7MR2mcedUcuXJX5kaMI\nQLbU0xwpsuh2oB6CBce4OZ2yxkDI6FgQAS5weOK8jr94hfbpUxXV/+FUVtW6\neuINEqkPgP0plVAO0HRchO+wefw0C1U/HMzUTVtxhYNJSM4obD5scBPa7Lyl\n0JcEa8xhW2prW0gcjsfRyAURNe5pFK/x/Oqt03cgmlLMb0dE3FvxN/uH4MHz\nP5t4CNCp1cSIjsh86pwh/qJgcWmd4K3UhdpvonCdVOZPTY66R/L4FaILVldX\nLZ3G\r\n=PRwI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC88fnvvowWmy0yr/j7TAxkokDwhAQ6o1mg5XBP1qz6xgIgFN1Al4OliipxVJ9V2qVIC4E2jbJssA5uWpOE5KQP3f0="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_3.0.0_1524623384886_0.7182229588076634"},"_hasShrinkwrap":false},"3.0.1":{"name":"wavefile","version":"3.0.1","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive","test_a":"nyc ./node_modules/mocha/bin/_mocha test/write","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","bundle":"webpack","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","qa":"npm run lint && npm test","pack":"npm run bundle && npm run compile && npm run doc","build":"npm run qa && npm run pack"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.1","bitdepth":"^1.0.4","byte-data":"^4.0.2","imaadpcm":"^1.1.0","riff-chunks":"^3.1.0"},"main":"index.js","gitHead":"252707148cc6659da97c76624376846cfec692a3","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@3.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-F8vw6ipg9nwqk780iCq9ySEyz3/BOjiwhrNgccZfR54Ppl79JkR9xMccFBNwEI8+emHYyROdnmZ5r5hBhMDyUA==","shasum":"c0199ce2fab2adb4ae5555c6a5e668dd18148836","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-3.0.1.tgz","fileCount":27,"unpackedSize":311477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4AIXCRA9TVsSAnZWagAAhpcP/AoDQvpC9G+V3//AUM2L\ngGR0NC/Q8/m0SQE7EtstITApx6TKHbdQohlyFP3OBJkfLhxNLnV16UxrTE4H\ntiIHv/ug7W4SBoWh/Bu3yWPP6fGY1TmQ6c7pTZcWUm3yjdhjUt5x/9MMAUfZ\nc7m5ifJ2XlmxcmOfabopgxOYi0zDWkeN3O7hUyRLg7cv5tKMgJnqjeNVaEiF\n1PMzGmU5EQzEaoHU/4PvTt6TBj8kmfUoJVn7bcp+dGiZ1cqV11f3gyNwH+WB\n27BFfB+7AV+B2uMKuSpE/Vxzto/O2B6JybZQOHZOXstv2DWn+mGfqMFrAc1c\nOUUS0b+tOR0oNHMMXg0o5OlpAW6uoWXS0x67Br9VKPJ2nLNa2OXBTUTNNeKM\ntUrk7s+MnJiZ9ZPJqDTIblE5Ow/fZIRjkcuXO0ScEpF+Y7YXMWauF6vN54Co\njA/aPaRhVM7d1lQ5NeGCoWr8mGiO4hDKAY8NoXex+N5UTSpA8TeqXlWM1JD/\nNH7VuNcMwVGMgjDGhWHmzTW76ddI7r64u7oW+NKBofC7R9VW9OIf2YgjHgfK\nm1r44kqCaVBkzR22CiKnjWK0KimHLWuVOtkTd9SLN+vHKQYGoaMphEYwoKcJ\nlcM7dIsSraUV2o1cNS2ONJJQ/2CAEbzc6bI0y24V5ZnjyILO9FF4H02+ENdV\n2qA8\r\n=MH94\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGZYXfPN86MalmzEsSXha5JoFdFSu/6oElf4lbw71B01AiEAp/WHpyg4xTpWUOGSybFQ7JFVvdy5xu9qaw5+gmavs3Y="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_3.0.1_1524630038199_0.7451220306618891"},"_hasShrinkwrap":false},"3.0.2":{"name":"wavefile","version":"3.0.2","description":"Read & write wave files with 4, 8, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","resample","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run compile && npm run doc","build":"npm run lint && npm run pack && npm run test-dist && npm test"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.1","bitdepth":"^1.0.4","byte-data":"^4.0.2","imaadpcm":"^1.1.0","riff-chunks":"^3.1.0"},"main":"index.js","gitHead":"d21d520500f502e561fd1fd584f1b2b90e1dc129","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@3.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-6wQPkoS9Jnw4oASg8o9ZEmVKiJJUuNoS8t9ljQ2Y/K1EwbPZubB3XXlEkKEg4twWTsubmYT7ntIB/XRS3Kg61A==","shasum":"023b3738a049b13834aa820575db422b53dcc803","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-3.0.2.tgz","fileCount":19,"unpackedSize":239524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4CEwCRA9TVsSAnZWagAAVDUP/2/vP4i5NRlbAIUE2w+2\nMzIBr+d65vlhRPEHTz4dLXj1c/65uW97ocJKylBS6Y1RIay1tjFvbNrzJ+fA\nIALfR3Xl+85DVRFK3mjYIolaUkjLuj20b2DTiJ7x1e0oilkJZ5mtVAelj5ev\np3+K245TT7IM8pallS9kmYrc5tDKPlR0B+i1Ndw3C0mgMC/8IYnZN/Nd9cwI\nt2igWC/S1VR/B/GrBK2BoZwBENQvehw34YdfLlsEs3xeZCc69tk5v0yTJnQ8\nzBnZmH4weU8KhZ3IoStFDgWfEXXErITa3EbTODl3FMY8cPUatsFb3oBG/+ip\nljuwfzFjoWp3SpXVlyWk0Bn1pl6os08qB3hp9mMuxRZStiorKhnFYstYR8eL\nZXG4wg4Jq4iDaQi07jE2vD2olfz0/c3lSt/QDQcfiZamcAHZpyLpQmNxN4+B\nJZ9O2fMu5SUkRX8eNBaGXSqcRFXkfZS+FSQBgqmhId+cy9P0Pp2a+wiiyugb\noi3aDypROfGIlicls/oKLWKK9LmSngtid5lJfYAjLJjZp4ePHsy2Yy2S+XOB\n9sVqLceJ455xJ+ov9C27B2RrsP0E2cQm834Vn9cue8wrKuTCh7/05QpwdN/n\nyCekX3jfGhpyFBT3KvCF9zUl/eFKJGm1PXqgpMMzIvKtI6+CFqEtCIMcT6Bx\ndxgx\r\n=CL81\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/KSgUpAuv+jui+buUdng3oaUUmZsIacyB+vGYE6EcmgIgQoL/u/yPpMDbdt4CCwbAxRio9gFsE3PqzM4nJ1pCuUM="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_3.0.2_1524637999872_0.5536805875276685"},"_hasShrinkwrap":false},"4.0.0":{"name":"wavefile","version":"4.0.0","description":"Read & write wav files with 4, 8, 11, 12, 20, 16, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run compile && npm run doc","build":"npm run lint && npm run pack && npm run test-dist && npm test"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.3","bitdepth":"^2.0.0","byte-data":"^5.0.1","imaadpcm":"^1.1.3","riff-chunks":"^4.0.0"},"main":"index.js","gitHead":"e41d9801ca7e48727a49dcffb891aa873f27d166","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@4.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-EADv6YXT5177Gm66F9shTMJXaJhAbP/oleXT2KnEMfaFVOCaihVy2a90CiwZcZsImQMzoValBAWwyNsrcCdheQ==","shasum":"19065fd775035ab8b2b03088155346b83e4f5bd8","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-4.0.0.tgz","fileCount":18,"unpackedSize":245790,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4uNsCRA9TVsSAnZWagAAaHgQAICGfqNIDls8+ill/IKM\nUll83wvllSQU3LFeJQaOjJ0wwlCXxifpzW8/TPc7/7TOyRxtTkZ7xkVUqgNC\nDk1ePm8jW4QvANL9aSSFQeXpK085uOVqj87toQFyfL2bkqmlCbxVUVrtGrWc\nWP0veUWKsseR+UISBq7p/NNSmto5yY2tN7pK/+BbJWckvOQEuLOwh+Vc5vxj\nz36kPQRvAn6keLtuILGbKsUbugUcIa1RlwiS/V8poqsRSJo9mLM/rId8m5dG\njFM7M0zLZBZuKX7xj5iWyzkIG95PckvGYiWqtCrwMfDtvVoZkpoyfIBekGVb\nrAEOrDv2O4p75LTC68VAriQKBj2OFAWFjy1oChYWJ/Opslt187OigOkWWLgY\nU24hTthVB7TkbkCtSRk44bxqujI0PjmvmtNdELtomksDYL5QDdJfspduC5H5\nDAw09jKaQBDf/HsavWaNea/gi2KRbfi55HMRmhjtrdRsOrb+AZhKAdpaIlte\nwTZBfBPt2bJdV9Jpt5owTDfOpYK1JjfkikNuONK/zohZ0Sqo3WjpszAab+IJ\nvtChv7K4wwULtgKhbvYrnL4HhETLiQjFpvVXs27Ebf5osjLegoWXiTj1aZZo\n/Tuexv4zHPRLkwaNvGipaXZ0QnsMNady1Ezli00xcih8Se8bjr6voxXdN0QH\nJovn\r\n=IZfg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEj+DUaaxkWF6mJrImHv2lm6cCif2PjxofxVcH2AVl5ZAiEAwxzM6NazBjZ1ANkOLQGOviD74gfVdMZhHnMNSqv+fS4="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_4.0.0_1524818794472_0.4206818520312965"},"_hasShrinkwrap":false},"5.0.0":{"name":"wavefile","version":"5.0.0","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run compile && npm run doc","build":"npm run lint && npm run pack && npm run test-dist && npm test"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.3","bitdepth":"^3.0.0","byte-data":"^5.0.1","imaadpcm":"^1.1.3","riff-chunks":"^4.0.0"},"main":"index.js","gitHead":"236e2abcb6285fec2a09d7e5cd894e426824792e","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@5.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-KvY+JM8RPav06TpkdHNJIgGvjehQnYQIPM5JPl7PTHf4/a6vtP47yrlMLbFlaA8xBsXJbTlpKKD6nJCKwhcjbw==","shasum":"13d07ce9df6057ffd236cb9d7063dcffa7dbac5f","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-5.0.0.tgz","fileCount":18,"unpackedSize":261749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa51DPCRA9TVsSAnZWagAAGT4P/1Sx2pi9Oa1+U7cuParc\nSTT1pLOpOSspFvcWUE4mdC7/u+QxN2qlbaW15zufxXpNBs+SZ8XmyhF+4C+I\nMroqc/uBALE0g9/20AgmQ2dvV+5maHbPMF1q9rM/1oF6ZhXW6eEyDtHPQB/W\nNrLvyFnWPKKN30b27seaKo+szH1bkufAKin2CXG3pDGAXiSDSnlC/pmANXkO\n31bQg4ly+hemFvkZ8/dYkDFA1bAQdLBYELhibS5s+sg6Cu0fA8ypHiyiSkpD\ndS6uQEVruzcnfn2WF944pPpU1fVIQucndpN18Ar/3pK52uqEkSrUeSCuZYX5\ntqpkxqlVYjjFziUQAj7M5IkkLYoAPhUpqPM8qdoao/BXVq5N9Lb9lNwLUr76\n2lWx4qjRP7TDc+taag0vc5MsmFd3dbzVkA9wHWEWcBiLw8W/SOJ5tw66rOdd\n2VnwHIeznVxvw95NdQGFRcXRle0ycI2I6FB1m4eqBeJHA8igoFwvaEODrZhp\n23QgMJB5H0FD/54doLU+1AbOUQJyvP8y0EuZVik2YOYRF+JrTSdxAN5k/DTN\njUoCztA1yIYdt48wS91OU20R1hKJQvG2Pvi1jyJNRs2A4jup1UDyqgpSNkBO\nCBWfYuuAzQ0OcqSTINksBi1Tqnyq7bXF7RW4t6sk3fy+qh4FF+6poIcO/34r\nYw3l\r\n=ZRkg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICkpUTMjKXyGaiCmHIbkqSoBzgDuNCQTR1a+RgKu3CWZAiEA1ejFJXcIcporxwOtPOBWpu9w9I8S4lYIf/IZut714cU="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_5.0.0_1525108941734_0.5310698296249898"},"_hasShrinkwrap":false},"5.0.1":{"name":"wavefile","version":"5.0.1","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run compile && npm run doc","build":"npm run lint && npm run pack && npm run test-dist && npm test"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.3","bitdepth":"^3.0.0","byte-data":"^5.0.1","imaadpcm":"^1.1.3","riff-chunks":"^4.0.0"},"main":"index.js","gitHead":"77dbb8fe9306cfb1dc35f894a3f309d994020775","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@5.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-YZ+HpYaGHyR3i7NJA1+CGfDMOny0CM6ea9ysgZa7W3WI9Le3SGNq73k+WcBo1xeu/Zs/HPnJIbZlEegHaUJCGg==","shasum":"5ea23022aaf32b9a32cb0fd1e41ad05a5bd67909","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-5.0.1.tgz","fileCount":18,"unpackedSize":265057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa5468CRA9TVsSAnZWagAAsCUP/0nx2vIrU3YVs2/NpAp8\nW+a9Q32J3gV8g6t6liYX4n3CgInt0o/Y3QEneQa5x1sZLaX6Q8usubFgpHtM\ny9MAFEiA71CQyvx9GZpNCccb2F+WRtjSyy2tNCkVv0rnZaq0OuQrQ+SQLOhz\n20ohujq0RbOkB4ajVLEOD6Dr2EutYxbZE+Oi92fVb1MNSl9vgzIvFXtlmp8M\nTIJ/ydZS8FuqTo7PDWT0qyrjGHwLMzXP/X2+l6RFWWT9mL0DfXHPIFfkPljx\nrDXdLMJvLKMHk0CXo4OvqAeYJfrnxPkyR7oP7dDtnVJzqWF8Rxoetw/epcir\nPwftRulTVkv867rfMmIuEIGxTuHwf3OnaWzBTr33+hDZFM8UsDY0q22aeiJj\nq0V1gaKcfxwv7gW3M+drGmpYJJScjiEA5nBdr3utYj985AmkpgZS+RRFpphE\nAW92obFAoE/NlRUPU65GWKz6OM2NGzwM0QTiNSsqi1xJzgHgip6QCLMzhROp\nbC/r1+DTw4gGprMdzGsdHlWPRrZ0y3MGDTwVK2iNbcUfxv7bA/8xCaLRPb/l\nWy6pv85gEhUeBr/mEOUj9/tKmICistOv9gFErxTNzvoVospEtreJ66kLZEIl\nSjMpPGipxORYG8EVHWcXxJ3eEPDyIrxa2AZEJ3FhR+BYR0x/LGcOc31F3TqL\n+Nzz\r\n=ztNm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFMQePcsGGB7wirMSfDz1PMjd8F9+gG0ERIwURK+KL5UAiEAv4HH1mXuEogBpQOkqX+vE1upAVQBz0aQOVK586zWTd8="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_5.0.1_1525124794786_0.49298376427182156"},"_hasShrinkwrap":false},"5.0.2":{"name":"wavefile","version":"5.0.2","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run compile && npm run doc","build":"npm run lint && npm run pack && npm run test-dist && npm test"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.3","bitdepth":"^3.0.0","byte-data":"^5.0.1","imaadpcm":"^1.1.3","riff-chunks":"^4.0.0"},"main":"index.js","gitHead":"f794d63f2cd18c89ae8688e14decff87fcf128c4","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@5.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-3uvLinIA9059deQ3nhpkyxqRU+pXBFsrtY0acHoYd+zih0KkM8RRrxSA3JpLt/Wi14Hx9OMrWJojCjBZB9uH4Q==","shasum":"2af305137cf7d915b607879fc3c247896e689e85","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-5.0.2.tgz","fileCount":20,"unpackedSize":298957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa55eRCRA9TVsSAnZWagAA/e0P/3gcsHROCeFioW/vF8e3\nNdnzwIsCJ4H6U2mOP8gGzjRb4mU/fN0MlTJTTMMpUTqNwGYHRxDEqjUNPT1S\nx+vK45pNFH42lvQk8hZQmob6PHQfgSxFjqbJcXqyEa20m0CqOfho+gE+l3HF\nQcmrQZ2w2hCtvmDdxR+X0dkAKfsqwH0McGhzjP0XpiyDnNLDw8K1Qb+QQkTb\n3QfNmfq4ivl6NtzXVssFdwdzHzdtBIKTKWXxJ9E/9kjiWIuSDHcswTWA49vT\nRUOg1n7WdjDcmWsLEWhDeKS0BQDRmkI6lWR5Gjs8GzG1ME6gjWmG10VKrhID\n9vtqCEbY3BFk4ersWWLmeoQzr8Nu1TDVFXn5DR04xWmf7pPHVOpmJlZ4ut91\nbJVLw5jNrygO1cWcRYwgbPfQjLjHXhW7aGZ2j+g2LwmfSWolngZoAQ1BnP0y\nLPI6lJjzJ4eXJ6yDhs+Q4A5eGEf/6FUpgd7HdNMjwnC6hNZ4O4dNMFoaZtSA\nEB7TAJQDuXgdVUNyGs4aS68BCTu+uGg1PUgS10s0cMVdBDNjnkBI7Z0x1b0m\npSgFKv4/y4PRug+adwn3UVQfjYlRAvIArMqmw8K+weB5N9WLXPHP+8J9CciL\nKdhnfccWepgsgWiKxkEejm7DSLap5zfAyXIy08PFXg+jQFTUlUUWc++arTU/\nGrBF\r\n=kDUz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOu3VZseWLznYC7aJ6XTskpTXaMJR5n+sxCupJZa3RnAiEAuD5b6Edtv/Qoa92vVqTXgUlA8XmcBsz0tPO7SRabtJE="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_5.0.2_1525127056777_0.5834536227272582"},"_hasShrinkwrap":false},"5.0.3":{"name":"wavefile","version":"5.0.3","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","compile":"google-closure-compiler-js dist/wavefile.js > dist/wavefile-min.js","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run compile && npm run doc","build":"npm run lint && npm run pack && npm run test-dist && npm test"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^1.3.0","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.3","bitdepth":"^3.0.1","byte-data":"^5.0.6","imaadpcm":"^1.1.3","riff-chunks":"^4.0.0"},"main":"index.js","gitHead":"faad3d840ac44b7b6d1947981d1718b598132090","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@5.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-QMcvDz3I87B5YUF2Zj1sm/HnMHZHvLz+yYbm2HXvIMuSC2ZYFr0j+XiYHNqVc5Rw9OmRO4CF+owCEYZs/Qb7UQ==","shasum":"890d4e145c359cb50eaa79d33c65622782e63251","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-5.0.3.tgz","fileCount":20,"unpackedSize":299337,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa56rQCRA9TVsSAnZWagAA6AMP/3LaKGW06r+VXILytx6E\n6foaeTkNHWT8IJF/NZ/heYhTNUqK1i47VPD/1TGBqSzx34pKBCvYugIEsW+u\nxiMdkdf2lqN+f8Yiv0rxFkRWjTEvzBABgLKaIWbYCdSnzU+lXcusubr86AzI\n07CnQh5uB4R09ySRwiATTpoZTtP/qlGcgTbjUO/WGq5qglMMkqpRU3F7n0K7\nPMudTs5Suhi6PUHy6XVl86NxbZWIKzzrA3sLDVRume/6PV81tO5FQzv/B6J0\nmx2wL1LX2Mu/MQG1uQ+G85A4bOtYoPJPfpqq5xpVfKecJo3chViSUaEetKIt\nwZdSFAVAA3WMTEslXQSj1Vu5yf/nCoDTpRNNGw7mvhJZ/9umLcZBRi/JvY8i\nejpRfOmgLtFcrDRTaUCPXSPkE3kx1ToQryA1m1jU9SUmHoSdPMhjW6oR+qE4\nnUcvrOEiMaUdxJSaDsrUUKU8eM9pehv6c4rqdCA+luzwZ34PL333feEFmay7\npiTPbLcvdU0qU7ATqVO7kY0gnbnZLDouuPmaT5/gDjTZrfHoTktzQ25h4+50\nBXeyHOwsvoa/Iaa2ABZhyJqQp9dv7IAhL1Fuc8YW49GvRoQD9KcG4sD+uIKQ\n9/haEnDNo026z2nnhJUXvkKfyU7sbQM/uM2wG+/a1T5i/4w8lQ8gPPuaYuba\n71cP\r\n=pNsf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDe/3TdE2cNF4bqc76B/OXiIppCwq112NS+lfCLsixcSgIgaq07MOsqRfuayI8taWWKUCQd4YXX9sdCgyo4FiDANGo="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_5.0.3_1525131983558_0.6204237204496588"},"_hasShrinkwrap":false},"6.0.0":{"name":"wavefile","version":"6.0.0","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.3","bitdepth":"^3.0.1","byte-data":"^5.0.6","imaadpcm":"^1.1.3","riff-chunks":"^4.0.0"},"main":"index.js","gitHead":"201d877b9e0955ee3aefe767e45ea7dc75777ddb","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-w6nSQgqM5Y7pbj+aq0133rfefulGikQSJ49GOY1fpiuoUwFlaPBMEQjzSaCN2T8Vc+n045HTlo+saKifAf/JgA==","shasum":"31b01f5ff03eba988fee39bc1527b46092cc3ed3","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.0.0.tgz","fileCount":16,"unpackedSize":251687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6UfXCRA9TVsSAnZWagAAQkYP/RE34POMrxL5jLoniG3w\n9x4cH6uKhq7q1gKinqZvjkO3BEpZV0QLw40k7Heg1bBmiBMXX+9LY07BKreB\nyYBxdlgAoQzsgAA8BL6hnXbHRIo5RYHOhllt3v+Fyris/QIO9F0arcGk9IW5\nucLxh6zqkkNAldpWoYBiMcCmBJgap2SxiD+8gZSch+rsdozIiab+fgLtu7Iv\nLw9+e0mCBL2dvtfEcTD9rNGaFDmIiW+y+9BsLOVyu2SgRqXRf0TGZRRjd+Sh\nlHYyjNFFrBj//NOw+HZ7vb7FjDSQYSLibBpFqW68R66oPmMhpKbHPE0118ZJ\nEZyn7O5C0dMvPNPolpccprUSQAteX9H4Fw/3DJEy926139dpt4wmRFqdCzSG\nUL98kY195EYLoMdd4YX8q5yrOWRkO5ddxsePHJUWKEU4HYvBlWJtanDsxceU\nPJqKTh1RZYBwRojQFbFqyi/RKfTVQm9lD07+HTKRQf7JVUsjj2foelqK5VXO\nBafVSkMLE6ma8RK5S5UBRRF+SBklrGZZQF2s1O2InAWZ6r7X5g533RTThOCi\nZb6eM9yJUBfNCdART+vXHYvaCqEujK51CHOqXVVPj5fDn8h7KyYgq3zu9Gu1\nbP7yEcrb+87EqCJoqERXd76vpDyZtxatid5IuQqmAHMIq7GFKEpnRD6rFWuZ\nZv4r\r\n=Z6ZL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCz73pRmDG8BvfOJlTnYdGF9LPySuZOBTSz5iusExzo8AIgb0G1vp5xNjQaYpZgvIrL4YUUREM0aAT+Wyjlqn04oHE="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.0.0_1525237717540_0.4180252917236873"},"_hasShrinkwrap":false},"6.1.0":{"name":"wavefile","version":"6.1.0","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.3","bitdepth":"^3.0.1","byte-data":"^5.0.6","imaadpcm":"^1.1.3","riff-chunks":"^4.0.0"},"main":"index.js","gitHead":"bf3828a564787041d4133aa1c290bda825a921f1","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-QN33e82cb2quTZy9n7cbo8wbbQlucp4UBM2tj6iDCa8/pKTHEMnibi7fBZMGa9W+3rTmkUbiM1yPscjb2/Su6w==","shasum":"2caa988d50b72ca60a72b075c58ca1b6f14bbc05","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.1.0.tgz","fileCount":17,"unpackedSize":260831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6WwECRA9TVsSAnZWagAAkyQP/1lMPoP3KxOtkDnVA39+\nlYFtbcJiXAhd196XpRFVn0gBz57kRwFe+De2BKrZrtNAxzqVKRe89k5Hx6fZ\nfqCWPJJPmiHTdx4P3V5ckvG6BIJ6ciEJNSYuJojeuhA7cT5MVe/tGGPaa/Ez\neqH34X4lcJnveZRRGdROVs7hHpTN6KgAJBjk4q9RHezxCdipDWW4RgT22Qpt\nL/lBTXqUVDwVZaaQqn+c3wPs0jV3JEP68ujV4r1I/coiBw9APHLuvrE6EKHB\n3ZfzfsWRLGWTg9egEGbgbqL9WwHAOMKVfD6mcyD+Xf7cf3C4GIGIHJUzCcRd\nxLqnSMudUMkCGOV8L2Sm9/gx3KSiwKTHeD4UqmR1++RY1WAsH92ZXUXi6mfe\nATeU+IlfoMBVt/rFLh8ZUWg3Z2VgK8GOrtbqe6eGC3mCI5+OwYx4DHgpamIf\nJ8t0hg7bBKzRgBwjV+rfzWbkhc+RwfnZS0MlxniZeWzRSiyOAigQWiqEEGD4\nfuRQy53MVERJWpfQcCP3/LVSyJU4kPrYnuL6y3QncD1gh++FkdL64AmSdxbW\n5nbqnKScRACKDbsIw5PG+5tAu+tpEUu0QuEZzEKfUn1Vd6Ck483RZGcrmB1l\neL2ZzcEB2k1PnJNE5LWGmtdDEAZswGfg1WXteeoPD5jxKToDmL7bwtzKXwDd\npeaJ\r\n=pJgq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQzuuprPwWT58uR+1ig4hHvsg/Z6U5G6Ov+p8F321MaAIgOGKkv///2lG42UeGgAlgHZhe0wM25k4eW0Q7aOr4tYE="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.1.0_1525246978958_0.43328460189153706"},"_hasShrinkwrap":false},"6.1.1":{"name":"wavefile","version":"6.1.1","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","bitdepth":"^3.0.3","byte-data":"^7.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.1"},"main":"index.js","gitHead":"50e196d42169f07e695bd607066b41d1718ce1e8","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-Pw9kqrGd38IN+dkurlAdeYfJJO6hlYpaRd4OxHSAziEdkZbJyGO2SJjMmFJUDCmAySKabXuW7WD/wMGOKI3/1w==","shasum":"34c69e1e9734c9ff90d0b09a25d8f6ddddec1ec5","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.1.1.tgz","fileCount":18,"unpackedSize":256107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa68ZpCRA9TVsSAnZWagAARCYP/jVkGimg4nRGFMvDwtEU\ntYmFVbhN8IS4KZpO1FCv3QubJ5nFAPCrXcCYXBP34A9Zq5pPt+5lFnYXuRgp\naWJU0s9eB0q4CsWSoxverfPqOXDP3EqxgDR9necjhakHg/6wITZzQTsjllIN\n3E9IzbMEMira34tz1asaQTcsDP7TXDQv7/Y6diY0ovsfO/zBNiSM0xtLRJYs\nL0+/bw0ypWbbUhiA7aT6ftqUlqWkW18GXNdDfOoyHerdFA9m/Z2lUVJybl6L\nu7YktckjdF9DcEqHqO0KbGgKT89OvzWW2t/q0BDQGxXxYjVf7lrUnOvdUE5U\n/z13CFR3pqWVAYuvFSIJoAkCTRHkuTa7yrUpwhdHLIBvpOIw+1qUIkIEi55Y\nF6rYzrYmWTOmQPSCIx8MTFMM8LdFmUFbvxgExZG+IvraK3eGoASyFoT2wtdW\nvkudV5tmKKwD7r7feWyCjfuEb7KHl+818r5sZzeARVZ9YP0oY39pSenHgmYL\ngWRrx8yEDX2ACrLFs1KFvE/nMJHKyrNcTJassp0Fyht8NzEAxhAmmNk3Illz\nmgY7fENdfqGJW9tmVyIbmNH4AfGBoikUQLFNbpFu2OJn5sNc/zjZvLquvty8\n30jFEaAFx64ijUIOiBHXRrBNLhKipVUYd5Zq0Z5Fi9k7z8uTvOfBBQnquhMN\n/k25\r\n=3tII\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6UjhwI3+D+JjuYC1wFLwPdBIsZPNQouPqM6YGB6KrbgIhAJ0EkiiJfeBp+fVC8sytSYzKPEf1Yh9xRb4FymAPq3n9"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.1.1_1525401190837_0.526983194420253"},"_hasShrinkwrap":false},"6.2.0":{"name":"wavefile","version":"6.2.0","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","bitdepth":"^3.0.3","byte-data":"^7.0.1","imaadpcm":"^1.1.4","riff-chunks":"^4.0.1"},"main":"index.js","gitHead":"efa12d5c830a60277f04d8b324d392284e144f5f","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-i24mxIL2NNlxZrZzSjrh7EUcfKKBS+ZF/JNh7aHszb4qhcN/0wg0Y5fGNigXQBNlmuv6QXlCYD5sBucEKN87Aw==","shasum":"820b8a5e07b35e00771c2415c410a0a232b394c7","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.2.0.tgz","fileCount":18,"unpackedSize":265751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6//ACRA9TVsSAnZWagAAPx0QAJT2BtLVtowAAN9qBVYM\nofmn4biknVTE0RKBmTDPmIGRsPW3hyzcNHZjw3+ah+8X/d+F5yoiWF969CsS\ngpoG34LxeFYUjueshU064kLdh9NiMiAa5T92TJ8wPoxNB6beEatTBQcgB89o\n2/lPJbdZP+naR15vMmHBtD5DoJZY59QjFAHVBTLhqtG0l08UkT8W7DXzCf7p\n7T6OlsmLzPuOLqS1HIUocAq6A62j145xQY6L5q/i67hf3LIUSZn4tfyODac/\nWmBwYR3hZAaR42oZk1xo2aFrwU6WB6CLK3r7czxjejGuqamZSTFq+Dq7Q+mY\nm04HNc3dwxs4cVdpwwiRLgIWwzEmlPT7vmTiPEpy6MFA8Y4RLABnLX8XgLNJ\nQVgufCZs7fO/6bN74KfI0gY/x6FSylqgEU6WrMT+2f+nbXoMPpUBfOF9buw4\nQfx5H36IFidYoOvMnPzqSwq/p9EDfYuSzxiniR8T7PcNSdOFqWJGjnrSwrcg\n1iSDjgvAJdFZv7bkq2T/bj2dyaIa7mMQu6h4gNp8tdLs5NpreUHpWkiewPIB\npsJW4DrmRDi/tnX2jtIUGPiZr9HSLaXiy/4qsDu7oyj4p12tmb/5tn0i13TT\nxonRfvSadjRcqNKqlfWdURBqmPJ+jnXHwbNLVkOq2tzsrtwi52bqQJCcEkv1\nVNSv\r\n=8IVA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjbhIPqkSlQ4FMN1/McnkIN34jbg2HNJVsUDTMxRP5BQIhAJIFEwPVLuOoTDFX95Z99iOCiTY1biP99oDyp39B4PDe"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.2.0_1525415871059_0.6939765775720244"},"_hasShrinkwrap":false},"6.2.1":{"name":"wavefile","version":"6.2.1","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","bitdepth":"^3.1.0","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.2"},"main":"index.js","gitHead":"62ab074b04deba81561d18d5e0ff9b415f2a4762","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.2.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-MNOxyEVchlSBBKylmD36/S+4WLVMLIe/uAk9qBo1nlV47jxfYrYrPd/MQIuXj+a35nBeTkG9Y0+9xGmTFGkbhA==","shasum":"dd8efc25af7024b507ff7dc6fb25e3e3a41a47f9","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.2.1.tgz","fileCount":18,"unpackedSize":261493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa7lYzCRA9TVsSAnZWagAALt8P/3C7hpqs04y7NBnv36UP\nU5SdcxWlTYdQLzSG+bCWFbzab+n2MyQToHOCo6NXf0J/KO4MeAMqcMz+/MMm\n3+O+NE7niqW++5PnLWVZHAJHUu5t3LYO6KFfbzeVSWBUiCtrkZ07GV+W/0EK\n8qwkaG9E8jWH7USnAHngoWlgjX+B/U8ITcMG/bAknn3zuqh1+on02cL6yDsp\nhguLT+wrHp/XWqPleiQJjfoidd2EpPrffjVK72yo8KGuIR/dQLjJuxoQD5lp\nblZP1KV7QQwbFvJGkr0m3nCvw15Uo3YKtsN1bNiMOMvvASDs+iWw01q5WVQ5\ne1TRhLsGYGxZXYg2tnKg46D7oGZlp/tIW/dMsToLTlw0pz2UXkZnjpWN+Lla\nWH2/pjrPXAultnKo5BFXPNesEznLcSicZS+nAjKgZx5sybU0wZAhWYB0uN8R\nQVwyMPZ+R+1H36H/1+WmCyiodhCVSBUPmh8+KrgAibgmZjRzp/oZ25imVHpe\nKlRFUr0zMhO8PNTE9NccU3Q3zl1bDQdh6DeFVgTVMuNm/vD07zLi9+fzrO0k\nEgDzQl97yT23mA6CLNwm9cuAIKBq47fT346SpLS8htRm74VH2iKLXyohJWq9\n1gewoBlnXaAGYv/HCcH6gIi6jBCvO0jn+nuTflKvoxRQZk7IbsZBKzVlsvgW\nji95\r\n=clSc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF8CWBc4fbMvq8wKTTFK8X7JRneK0UL8ZgkQMBQ74QPFAiAGMf3FNjljXZMfODfew1zoS534mm8FBdk/xn45SfHFCw=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.2.1_1525569073684_0.9059677296184441"},"_hasShrinkwrap":false},"6.3.0":{"name":"wavefile","version":"6.3.0","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.2"},"main":"index.js","gitHead":"d927b7baece5d3be2b5ee49262772ae643068f0c","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.3.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-SdaS3GO+h3/YQUsQ1ueLHRwOvXo/bed79zS7Upz8ACOZhZzChSzhsLZ2KH7UyAyho8c570rgoxOz/h2ssoSnqA==","shasum":"aaeb684cc8bbec9f1eb55cbabc4b1d0651925c03","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.3.0.tgz","fileCount":18,"unpackedSize":267605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa72YhCRA9TVsSAnZWagAArAIP/A6mUKNeNc+/zuu9Cbdz\nq70zxeVu07jAMYBTQyJFZ0mC+wciNhUOXIQKiGTgsGkwabdN2weYwt3fnrqu\nLtdxd2nX6tECV95XOzvURIdizI8CDdKQzOTKURPscfE04T85dQrEWAoBtvaU\n/BHpxfcGZBBDt3i87/qZJXbB+od8hvqzilw51oOiLc3z+thD6VRU9GrQnXf4\nGSnYDs+7BWPTQQoE0kQv9a71jtmD3d7b6S+mKnzFDAbJnYYkAndoeR17vZjA\nGS2Wwnh5XHCSz8o88rZTDWh62eG+60iGkc9jEB1utqkdRxuIbNyuGVFroVr9\nlDwQDDlwlZLTZF8F09n/rKnoRYIfMV6GMmgFOuRA6kxk4QiR8vW2XI0L0gnU\n0ZDZB1R2yWlr5J8V24IVLUSEDd5S3qB3BTvuLwypa/Q1iY6PU+0yRMTgryqk\nGWUKwLl93kmj7pC+jb92GLSIlHnNcWoX7YJGgj1c8f7bzyOcnUIjW+/OOopD\n/m/FYY8UKqOj75VbtqA0blBXgQuCgsYy1Ucu2/eubGT/YnQNfCpCg74w/dWM\n1wKZlVzQzJJYNTSNCmB1r4KDakSWedVQtovYQ7xMIWYqW+bM7upD7Dlu+uLx\nTJdGs9LNN4snRx48Nggx0NC1a1ImXRhFEpfm8RhxcGe3NflO18PUm+AXRhxY\ngyc2\r\n=x/wK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/7xqUfcQ8vifdsx/ouRP6c2AdU+sP11AHn/F2nWE6TQIgforsbmvNaJnx1ZvjXoFWUzAhNps8YL7a2/2dCSNeS9c="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.3.0_1525638687380_0.4266399183587304"},"_hasShrinkwrap":false},"6.4.0":{"name":"wavefile","version":"6.4.0","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.2"},"main":"index.js","gitHead":"de0a164d9f1de4a3e2620a7f191aa7712dadf29d","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.4.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-CQuxSE92zyJXfUA14QmZImFB8XuXwFDjBYiGDTz/BA6J/9fspxW/QGQ+zKy2SoBqU3N+dEX4wzfmK8CSWIpv4w==","shasum":"368174b2b319fb3450f9e0ee409aa868e0acf1ae","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.4.0.tgz","fileCount":18,"unpackedSize":282028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa783ACRA9TVsSAnZWagAAANIP/1L3Hqky/LrbK5ZZTDa4\n3w8X9dJV2T910Xn+c2wS6Aat8nF/lt4U/+dNEQV77nEWU8t9E/BTkiYgIkMo\n9063e/uBeK+cSMqtUI80Dy8u/lKqtuKqDswghcsNVH9+vJ68AN7QFCKrKyrA\nnATeZZpyS8w1lRCp12MkFvSJOrg//j0kG9TCYmD5e9G8LmizF0rWgIC8h8/e\nCddg6MRooNgyF/tqyvS+wgY3PXdBoLJpsUDQp7wd6l5cDTR0zfXrv2Rd1J/6\nBpeetmKBoTn0t1Sy126bTDPTdV/GFIlGhD/SKvXmgeblbVYL6c38hmhl3ptn\nCdPIaFel5wCJ4f1wvkAgmFOCmcbI+qAd5y57Zh5QwMgpTvnjbl/jGGwl0Nzv\nuBpnjxl2lAdO2hf67tRu7i7Kg0tIgfIzEO3ZDxzlswcDlb/YGNeI844KcUl6\nHedpg8VszUb1ujUFVJv2OkJScE0Jk9xgzAYLOu8ggsNlydhFLkutDxBEaYpu\nLONXVDg9SrepfjbRcCXsAG8aBv/+wcGMn8Ohc3oHlyw/9/msB8KeOM1tkXuc\n3Dd/iMX5z0OP/KwPW3nOzJ+tS8uQ2H+mjRlq+KMuCvMNw+dFnA9+HDKZMGLJ\nlD6BRfJ/K1oY624ysDwwdtdAnTC/HJCcLeeOPQQuNfmjBR34CfHu7nfn9SAq\nno5h\r\n=efjR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPYlpE0RC6tHbbzeNGgZi1eWdzlRI3BDu//qrgtkCQawIhAMQnNheu88dmp1OXT74ULd3e0aymthku8SPAj3MU/28W"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.4.0_1525665214581_0.8342485639598867"},"_hasShrinkwrap":false},"6.4.1":{"name":"wavefile","version":"6.4.1","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.2"},"main":"index.js","gitHead":"e3a9583ff7876834e49fd22af10850496f15e9c8","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.4.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-KoUcpZpAFHuPXrtABBKiWaf0rs7pt/t6jhqTmFCzDj6eL1AjHpx5HF8r/s9+QECSAgtCUunvGpiO/oJU0rsFsg==","shasum":"990b7b89ad3a4522db041961de5e90678a7d1a36","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.4.1.tgz","fileCount":17,"unpackedSize":273070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8IR/CRA9TVsSAnZWagAAEi4P/i+HeNJ9pMSQohNaZkBE\nBshvTNs0bb317Q4o3kwgqIWzZ4QH+qL7HXnmM2YVjRzUiObXtILQ/4c0PXwo\nSX1Zw4gervQecon3yPdpA6mdp8TDCaDmh9zo8420CvuntJIxMXJWja+lCJ0J\nXd4iw+pnDcXTfkzSJm9mcTIEJgz50MD0GL8TUOA+JnpiVlK3hIG6qVYloCAQ\nbDq/laI8QCGd/1v0wOlNS012sJFbyV00cblDJx7yDatthG1Fibpgg9oqjM46\neIZ7NT6vD6RtSZoSLLjrLXnJCQDE4Jo8jgOQnr2W2naH4FNIRgb05AzPS6mh\nNjCYu5AsRHY/DvSsYGLXc3yZKceKfyA16e4wVd1Lh/K0D8flryzjZ5yVJUmp\nkevHYsJktpXkz9Z7kQ4igXuxRFQnh5I+gfpyK2Jc0t/7FSfdMJis3L69UogO\nqWm7OadTXn9ZylgOd3FmVA+oUEDjDLMgCEzYytyE/c79cGUJtp6IFZA6THUb\nLKxLFeRRXX6Ojtukq0UTjL5Xfv+3yHNm+H4Vbt3fRoMOox1OnbI6Tbu3Hcg9\npj/5P5NY/AQg/GkNKbJshkSUIhBu+tmEGBc2eccZssVfIj3yqwn9uLOhvn4I\nvUKfJtJhUJvmLIM/ZLpNk9mH8ZI4rhZrdX7yC8I9mz2Hs108sRYMu9O3/JXm\njrwF\r\n=5V32\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHNZhciO48amOehu/fLCl1Ik0owRCmYI7mMGnCRzxONQIhANrnDotEllnfEymjn0gjWQwU/Jow7vE0+y/C4tW/ekdG"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.4.1_1525711997985_0.9977822533301941"},"_hasShrinkwrap":false},"6.5.0":{"name":"wavefile","version":"6.5.0","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","ID3","chunk","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.4"},"main":"index.js","gitHead":"0c0ee9f14d059f1776495e1a1d4c650781a6c639","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.5.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-VB+CfvU7zoiwZUcnLD0J9/SEYWsaJWNPCAKLjQwg6RBFplo3Pozw23CGNDkgUrh+yL1wgsaDabGZ74yTNoSQoQ==","shasum":"c7f9041016028559cd376f8429bf8e5ef77c9a8c","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.5.0.tgz","fileCount":17,"unpackedSize":302010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8+j5CRA9TVsSAnZWagAA7PsP/j8wTqysJ+ELSR7n+2RW\nwoUozHVXyhrfOZvQhnkQ4ZTxunRRhdvE1npAuFNfkO2hjLfPyQrgEEUhppAu\nIyoXCPCeliGXeXiGxeO5psQSblJ+JM9rGdf7xq9cblHsfKobAsqT99aVkAuv\nzpIrLD/7KIE1ADQZ0W4/XiJz/YUDOkDKQAKN3MfsYWsknds/FGvzqoXxfqHn\nDSOeD5OL7//Gq/PdRk10RMh779zvlNihPMPKl+sqpniZESZjjfq6fCr07Stv\nbT/hBQzBFZDm/i5Q8OvBu6TbrhVuUPC5mWzIecv2aGC3/rQBcpVxdyArDgKJ\npRSAPYc/HXNkUW6GOhwQ080N7rW3+7k9hiPGcST50JaDW50UN5IHl8Bz48Of\nIdXSTJFbDOJ4KrlqYQQf2AVzP0p7uGShhY7MONvBetBxb+T/wpsM3NesnnEM\n5R/o3Hu5LyB650A0c1bt4dkDJ5qE3PaPAcJ/pOyxXH4PPk/XTsLzgoLRDVaa\nyoW3Hs0XCVu7maIDf/YqkX0OIKthE43uEjKTX6ge0ql0bzsJG7KquEKUui3r\ntk3TUhITgbEREnmhwms14cXV+zt3eJaFoflVb9FeQLC6qYQmgEfX/VfHDINx\nEKlqUPNqs/NerS1EoOjZgoZM5Dy4KYlcc6hwF8psFbZMC6JEvYpTkc5bgNsC\nreLD\r\n=Isf4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUKhy0uPiprv24Z7rGHC9P60vTUQO25vrEiN8FjB9RzgIhAKjkTvpCy+GfOGuUIFL2YHXpeoJRSD3OQwIXMChwCRf7"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.5.0_1525934327674_0.3952367569393771"},"_hasShrinkwrap":false},"6.5.1":{"name":"wavefile","version":"6.5.1","description":"Read & write wave files with 4, 8, 11, 12, 16, 20, 24, 32 & 64-bit data.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","ID3","chunk","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.4"},"main":"index.js","gitHead":"f844b0117717e420f3ba8663b23b45fc1f199107","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.5.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-LKLER4+JAg3PHLGHOFsJhCDluGW+86GNgXqthFf52J3aepv27z5LfaCLzogXy2JSYDeTL5xcUSNoVdy9p+RW4A==","shasum":"c1fbd164562f8bcc0108e21a0149019dfd54a22e","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.5.1.tgz","fileCount":17,"unpackedSize":295278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9A+fCRA9TVsSAnZWagAAEBQP/0KLjBPq4SRTN2PY29IQ\ngcbgxNXXJqSMYTzVA2ohG22TKvlIGBFCzmjzdrT3tDAiKD4ajRFmC11xseS5\nT13FUHm5nbCcTWX7ix4NmGebXKlq/ErwVM0Raj/dykfPrhyznqRyVbbxB9WB\nVVsddFwpLprwoPnRI7BpMsASwtzGFIIUH4AA1xeIY67xB/B2D7yLMt3J87DX\nx4caRNta96xJ3/bnPhn+m1efM701BsjZQfBjOQjQimd+fR5yjnbY4Y3QKRl/\nvddeK+ztHTObdvsOfzIPhJthuKF7dzH5OkVi0YxZLFIxzSjTHkxJvmq/P9hO\ny+/L/8aEGXbwjCMq+1Re2yobSkh+rOYFC3Zou5dWxtCfSluJyhFuvnCCeUNz\n5uxt8DirqTygJISAEUWGWkfF0ieoI7WS4ymotAikogyqeDBKgR3QNBIsE22+\nlDgIfWTRljA16sKY3QrGGheJOtlcsHDcDBzephuw1SbcyupFgGxLby01YMsR\nWAiuIf1LRx7RGcPFPepKgmPmiZnhP1GJkNvx+zY5NsgSXcOCeZF8uYr9uTu7\nfZPaGn/sis2JvO+5pTBCI2O1059a9uj5426oDjkoAsiSDcfRATHt0w2FwIEg\nLOPOEt6NPEHmvGIzYapqWvW/GCPQbLo8SJJQrI4Y74uBZ5OSrQWseTekzHRy\nXx6n\r\n=rUdC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBbJCyxgMCEeBwzBSwv1S+3PjsPLFnHYwF4pTR5LkxyTAiBlIlfo8Q/7xDwP6EStk/e54bvOIWHCa6WkOdYLYBlQgw=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.5.1_1525944221998_0.4222645053105132"},"_hasShrinkwrap":false},"6.6.0":{"name":"wavefile","version":"6.6.0","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","ID3","chunk","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.4"},"main":"index.js","gitHead":"b17e082d0284694a5ec2f8f72bb8a5ee6cecf64d","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.6.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-1SSelo0mtPkiyWZFcFPTy0QBK5riu4i1ul8ln/iPajCSEMt1rgIV644mfBuIrcJiK7HC3t+Hm8BUy3EJ8qVd3w==","shasum":"df938cc4744ef8c97a6013bb8da59054ce971075","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.6.0.tgz","fileCount":17,"unpackedSize":311440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9NpYCRA9TVsSAnZWagAAVrAP/3MiVCT4Ehpjsq53Lg6E\nEYQmgvmKFJPjSupqiJj20s13SDazFe6Bp6v4FfC8JrpGtexGBh3eLvZa1f22\nSeHte/R+810YDDJnJUrtnqOHqDc4J1uEQzdkCPzyWBJa5ZKnWgE6/DCiSYwt\nL83HqjY22Pfed1tbsSZAeDF7R7x18Hd/vEPmx1MOsiMpf1+jCpIc4Kns3wKJ\nJlxo9FRiWrFYGoL6J07rIAbcM8vP5PnfQ8RcmwmJ1KS1ACz3PLtZscbJhF6X\nc5zjjQ72fgGrnBhPKK6mAt3BySxaQP5SMbDoWIiJvYpDdJsdojm7uOl202O6\nUGcE+Ga5CvjIpbpkZYnEiBZdRQHSTYf6+4x19kw6D/hHR2b0nLqu8gap24Rv\nGaBT2y0QZV30NhPO+ptuDobR/wd5V19c1412E82Ww3eBIrofb76VgpsRchSo\nypJLbo/K5m9AsWphr1WVWtyOPmWV+UOMuAmuEDscMmvKbQsZrqSZVDPXbBzU\n2JFIq/Cs8RJEqYILQyTOs60opPfHvg1j57WghSMBC0yiT899/aYDndeq7UFK\nI3ZJWScHOSJ13Opp7m2Aor80EPi/j6fXjAM4VpVKF/m3ocvlqESuQgbdhwaN\nszL40DyShioGA/uxh5rat6x+KziWPbnnUkFBt/MIlIPDUPSXoH+g43SP0fYU\nXWNK\r\n=9Uv4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKlZJjmexn4LNjF9wtDHNYBiGTqNFq3SzQbblpMe3jrAIhAIyKZ2OMHzL4hsOozCmb29FPrjRet5PUBMPa1Ct5SFyV"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.6.0_1525996118773_0.42131960538298907"},"_hasShrinkwrap":false},"6.6.1":{"name":"wavefile","version":"6.6.1","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","ID3","chunk","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.4"},"main":"index.js","gitHead":"e411458f900cda5dae7cbd861737a87cfe3d592e","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.6.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-HOLHMl1TwOFERd96AqhAwG+P5PcZierBdlKPgh2bmIQ8F4q7uKErAEpem6s5eTrFs7ISr48BRe90BQFHzLz/pQ==","shasum":"40882abb602598a7316cd3538829347c832f4dba","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.6.1.tgz","fileCount":17,"unpackedSize":311440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9Nx7CRA9TVsSAnZWagAAg+oP/i2pUpvMQ29rtioQHJ/t\nBnVMvdJkuwSLz4/bz0b/9GMtrJs5Dlf0/dzGL2xDoctOcDwix+D4MjlcJeCU\n74lYft/7f1vr2MhKZ/bSABnUswcY76KaiWrMTdm5NeRjLGBIhEdmdePpCEw4\nXtJtisPJ89IcM5VceSalsCDgOLbzkhOUSbSqYnAXStn73qe8ixpsPD1QRlDU\nJozwh9m+EZG3EY91nAWso1VEC/YaDEv56rA8BNJOmT9AZmnWK5bm8dh/Tf3A\nCg+3OHyIRHHxJa26SabrsAPIw3kLqvyuSIAwaiBhv+rDfZ0FxgwzVaRuhJv8\npqP7lgNMrgWIUfm/xHcwBIJ/FbkJ1yAUX1mDb8gW/hi+BtrsyoVP2eKhhFpK\nYzrR5N1zgUDjghN32AGc4kc1L261KvGZTy2/p28SaXrQev2DUxotggcwD29t\nolWFOYyZorjz40R5fBTxmE3mhZUN+epwx+e9sVhP6V+wsH4bI2vXNt7pLdE8\nbky0UH03IXcesY2kyUK1IdPgbHTEzpmXnQm/6E7vP105WLcOjqX9Knt8vPBw\nKwuSrh/u5YUKEMACCq4jJj4WL61vXIQ5RF8TGxfJyUGp6ebW3yljbxnwBY3a\ndr2P9d+RDQQd6Zn/LBj/Y7YWbD0qEkSbpLuhkdG5aypYot9fVN3Ib5+yJbyV\n5AtK\r\n=1X6l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDiMrrjFofC0fCE7njY385MxgaYfS040bmUGIJeABNoAiEA2ui1DAFCPIZkE0mBeSyeXatIZjprGM6IZV4eFgrrc5g="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.6.1_1525996666622_0.199968833906365"},"_hasShrinkwrap":false},"6.7.0":{"name":"wavefile","version":"6.7.0","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","ID3","chunk","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.4"},"main":"index.js","gitHead":"59df0c26997ea5b5f1ad520ca7b81cf432f6ac04","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.7.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-YinaJ5MZ6hLzbI+3TiVrtFVKgUw25FCK7LleZjU9QsgwXlJkJkclLdeOSYPNQVUzjsQYobM3Esg7QjKYsCVlTQ==","shasum":"885edca12f14ecb75194dd01a05aaab714a8d8a4","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.7.0.tgz","fileCount":17,"unpackedSize":331626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9U1hCRA9TVsSAnZWagAA9W4QAKEB4IExW++QIinwJBXc\noqdR4qKPAXZ41fMHzrPeiyWfeA+dZsGBiMARD/UtT6Yc3FkYvR8+Ln5CYQyk\nkDN4bjXupoQWOEFlhWSGimEDcnrUBGdZ2qvwtig4bmZTfULdhpTLv8lbJ2MH\nsGTxon9qdwUWlWtCDX06VKzB9Wes6QcihOAvEzNXRjV8SxPz1bWg/bdKIrNS\ns2fGKowirY/7t1uHO1flmfo4Y6zd9O9JZXmdv2D2pSvbmq1EpBHcESLA1QBa\nyJQDn/zbaxZtf4rMlw8H3Rr9UWVgDv5jFomi2u4sgFCvsg9yGeyhBkrvlPNY\nM/r04y/g1Oc4mFFXdDuMbqufa9GtIWk+8i6Bc9QH2vxj/AqnqrIqhr4ePMie\n5eC5k9V9VliILLR0B9WmJHew+OVNhdUVEYxrQ8gdQs6kSMFK/x5aYaxGAYLH\niR+S5Vpj9yBtaR4YgmJzT5F+ihuiNrMSKmSEf0SiDA/6Fn94sIqB+iqGLBrx\nCXcsL05WhmXuHEomNd/Httaqu3mDi+GMV6byQAHjzeFOdGsgLGXRA3/DcR3L\nD3DtGZUe/VAjIGeuU58NQ53oXVyE5peFjBqllxnjCdF5W469hh5i9t1G/XuB\npPo6KEbKpjo9y5/LwSRsR5Zt/w6IPSvTf9L0VGruXuXUo2KD1pnHIaxEYoBs\nbRPD\r\n=DtHg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEimkN2AeKQIpyJr5yq4ZDLyGyJyjermuyZxwuAuB+lrAiEAjNcKuA/mDINr04wMUnROPH7l0RXVC6DzS1/P0yS02cM="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.7.0_1526025567954_0.11065438824815677"},"_hasShrinkwrap":false},"6.8.0":{"name":"wavefile","version":"6.8.0","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","chunk","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.4"},"main":"index.js","gitHead":"fb8bedc472a5ba70d1e20c9e57f495fb308c1fc7","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.8.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-kgNs/unmq32jOynywhH4Q5JLzw2xaCYSjFL0zTrA5MgpUapyX+ZVR7gskhlhayBoV+eSZfOLdCbVctqND2yq2w==","shasum":"7b48d60898968f0f23db2769417210f78c05797b","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.8.0.tgz","fileCount":17,"unpackedSize":338555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa93hHCRA9TVsSAnZWagAA4xkP/1rXu5ajYM8iSliJ0+Kx\nSUqakpTnhOqoQAbBZgcukDeDb7XbQicvs2evsVhu9D2Ku/klJA6xf5RS10ke\nnz6L5CbQGaRw3QEMRJ3yuWsRwaFVfI3K0AnDFbyL5gJMcFfVvpAguB1H31sO\nARwI8LUxCjrCxpx5hxvcprAj2xRpuM8yzBVhgILi8SgbKoq5A9s+d9UPQyTw\n+SsmaiU/lvGCWHa4jo3ZZBNYFhAfU5/rQs3MTWWOqEdMGt1wytGo6uyR8Ajb\nSq8fCbk2haenc7rkaWg2O/3YWXpiEBDSivj0yf8efHceeSrkFPal3dKYIkqh\nUOi2sfgmlVUKJz6fuR++BivUXm7ikH+xGAW4y/tO1CcKceQqv8WKrDaF3hlG\naGf84F/1VHmnE9o96G91CqRsEpzJzJ/6jbDAPOYjtNpDBs0D4KWZ1I+DFcUa\njAvMha3L7GpKySgRaMUntZcOmgvHP6U0kCEpu62mKAFpd8WljdLY6//f3Dmw\ndQIwdaltcAwW8WuE+b5sgZQhryD4ytnOkhxMST2bbcNhw/WlbehvwHQk+Cqg\nFeim6R6/hzfJn7HLyrge9L5GLd8NEhXc2Ka/9QCqbDmElAnr0v4mE50oAd7U\nWOAwO9JnlX51wtmbPE4B6/M54YOlm7H3Yd/H5yPZcJoa1HHCmfts/+NBVljY\nOqW9\r\n=PZXs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEfVsOTc7mcJ9doYkg5TPaQEJh3pVM6Fr+pYNiP4eDPzAiBs+X9oZE5g4QD3mriUZXgGCCtXBK0h/QdbMpTaWokHEw=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.8.0_1526167621237_0.17484605142930154"},"_hasShrinkwrap":false},"6.9.0":{"name":"wavefile","version":"6.9.0","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","chunk","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.4"},"main":"index.js","gitHead":"e11a0fbd5c399cda5910fdb6c8aa006dc7323493","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.9.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-Eav86ofwWusTyuelMLc7Sg2O2myLPc0ElcVKimrrIcXdJmj3ED0KEqc11E28TtUleOcmVrNYfRzoEoWgwTdLMg==","shasum":"ec36248428887f445be6c415e09383c047478d5e","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.9.0.tgz","fileCount":17,"unpackedSize":346784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa95BYCRA9TVsSAnZWagAAvzoP/j+e6Cq+RqACDg7IL9zl\nzp6WvxTln2+nbX2dxx4PQP9FcxBC1GdTA0UMCS5bmY3QvfKpjhINYMLiRDhH\ngdp/KJJFV7hC0eScSmPVGrWQZMmsgNpKi/K26VU+NhkxL6ChTr+W/uQIoipf\nXqGBWMA8yHdAHQUCdapsk+npDFy5MWlm9qZBomdQyYKvESqLvF6Adsa21hl7\notcyzScPFg29UevsASJpZC2kyOHjUQLtvvxl9Ajb/0n/oxvK6BfN9C/hX2c9\n8FSqV1E3wMiSJPSnZAvEzso6X4OgGTUSnkeHQxuDW+oDqwmtp/rAp+DAr1/e\nffL72uZozl73fS6rS2U3hzHj5MedCtLAmiPt+/ol/4KvfrXPJlWQEpHou8oE\nJRtFI1khTBu2e942B02zi2MHzTVlxphHn7JmBV5WSQxGLQ46VoPa3gOQir0U\nHlmqTcSnuQZ0WbBiaCPy5Zq0FqBBbqyPQhAXCg9DSsjGAzPCznOTmv+5yFCS\nWQLOXMxTk1CKywyC/nB7kWcUmlRFeDDd5YfwuJ2Q+eCK7RNytLoHGd+uVJkZ\nR3+DClkRgIE+fXs/RJaChpr83TEBFP01D1TXUmn8GJtVikl+u9bukaWJp4J7\nbjTiIFf39juTcajdm2Snp6RnBhevtxbp86B6YoioN22UWi33j+vXdBtjgo5y\nPEBd\r\n=rJNm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfl5Zyz7s/5IBstaHikpg/5p/fJnsUKrpWRG/CodSk5AiA1cPEtfP2MvCIIGqNCdMhPE5Lj77a3xmM+SIEJs1DERg=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.9.0_1526173782912_0.968443059218808"},"_hasShrinkwrap":false},"6.10.0":{"name":"wavefile","version":"6.10.0","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","chunk","audio","file","read","write","create","edit","save","server","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","IMA","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.4","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.1","byte-data":"^8.0.0","imaadpcm":"^1.1.4","riff-chunks":"^4.0.4"},"main":"index.js","gitHead":"96fa95daa3ea45d17fcdf9ea7227e1e4e1221d0d","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.10.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-CfuRArZpRlz7xArdR9gJADWGo1GOylMoend18KgW52zuxJIkbttPh9+yu/KJM3Vd8j8rZ+7oI4KAb0rcIgodzw==","shasum":"f53bf3999cffdd1e8a7dd962ba8b2a5a892645f9","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.10.0.tgz","fileCount":5,"unpackedSize":89978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+FAECRA9TVsSAnZWagAAy1IP/A6xAZABXYFv4yTqKsjC\nNsCFm6eNUIhIeGO31MVxP4rdAU1YWvGgBnKdHERzOYlWSTlGpX1Ie45tWyaE\noDnBQm2GTnZLhoz8XhadonEbsKGw8D85yohArnGmXiOdsv/zzokU+gO0yQ10\nPPBQQjtELNQZwygBPhIVkrtAqRqHwTEapeG3Jwu6TzfCofEpUU1KPIr0ZQMs\nGwfmfu9xRp1wwsPjFCVfSrKNUoR68KPFA1zp0CkfYjBxEwsDAb0W5f6K4QQe\n3a1tofKCWPVk6w6GNecxCvEShHz+WgsXta3jaoFEvipaYAWi1TZfuV2K+qux\n2Y9Is4z4SvqFHcgSErVFXhfNrnJT/hCeZeBXAOWV5puE8GgOdp6Eou5ugK9n\nbspYI1Otjewtm/Ab7jkcYh73B2axfcmvhSBbowwEK2nHvaPtN+WlShc6BDB6\nFWbAJp47UO/4k4mqraGPFA07wmFHhm4XvGc9JR4ra+TJaqlP3ZwvK/Pg1hYo\nvWiLxqz4CNomaN0J+dQM8yeocv7oO4Ni1fcauE2xpq7hc5oYuGNx1BcWSRSG\nsIXEsGPNC/KyBQxlMKrNml1IryG0bMsp0+93ECjnePYX1MASoGYkffrRF3Ja\nkNZVR2gUnXj0Zx88fef8S/FMZXyKb7b+gESgy7fPXf+DLHDgEywiwVIPnspb\n5Hd8\r\n=vp0v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJyrMC/5K+2W18+nweZtTsik1wyY3Pgzm9XK2JBb2c5wIhAJ1udEd95P6Acqqtv3pB6DCIg22k3x2Ac1ZGTToK83zI"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.10.0_1526222850757_0.3104310559798473"},"_hasShrinkwrap":false},"6.10.1":{"name":"wavefile","version":"6.10.1","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.5"},"main":"index.js","gitHead":"bc734de1f626a657a852920234c959362da6b872","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.10.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-p5Kmxu+BRZ2vhqHgkyEnRadqAgI+wWl/xWo8B0Tiu9jsS0khZhxReh9TN9ngLzJ2L/8NmjWTLY3xMvdXfcUP7A==","shasum":"02eaaef6f31780498ae063a92f0fe20d17caa980","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.10.1.tgz","fileCount":5,"unpackedSize":90038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+QOVCRA9TVsSAnZWagAAQV0P/35yTT2kYOoThAeTIW5J\nVuZZRaANc0BjuNokAxa7L2mavWKqC6plxxbODp1LAvpXD1zmPQ3dEt9bS4m+\nJsvuXhjz5E+FG2vijmJV2ITaOuH14yaVbvO186xGS/0M+xPvCKId1CsKdix8\n5IJyI473QLeZDH18PPM3feinvzBrG7aYRH8y2eiu2oDSC3niYjM3dFecAgke\n2Piib1ODK2wyU/1j8TAmT9LNIuepO9rt5T4UkrdJnTgX/JScdHGRjIWkuxXw\npGtT/+eBfBWVtuthXcw/r7hi/acuJCG9u8kX1lo1boMms71IIJbuGoINcxh8\nMyK0iq043OL+ltjSdN7ZUG8rDU146TcwcTLgi2MmbPuVybjuuvMdlRnO7OG0\n2qhi/K7UUjzFc5PuSCRjjJmOig9hI5S6bPZ5lhKitcbIkHesXI5mV2Ih2kbS\nBKw2SQxR6kDofvyHMPGCoJ8Ex5/eh3igboqGXhnrJy32dUv9BenHqm85VspT\nHzO9LKarCw/7nKWKj+xErxSGDSojJHm2r+QhLdhM0YIZyh4yQRxeX4GpJ0Bc\nkB7w1Qx8dySDy3oz8Fkq2slbKrQod070izKW1PJ4TkzsNh1Qu+1Zan1dm2CQ\n9UHZ9nzA7UuUzUptx08HJgbuDV51ZD5MyaMCCY1z9LT5QiU4I/LhLBadoSSf\nwI1s\r\n=ErZP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDG8sQQBsD+AfzvtwhIeRaQdIXuvcPWX0yzCmrfHbqJiQIhAJGFrHv4yFCc7x2Tavx9jHieefrAFNNXO6pEX61lNLD4"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.10.1_1526268819026_0.04729578672185086"},"_hasShrinkwrap":false},"6.10.2":{"name":"wavefile","version":"6.10.2","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.5"},"main":"index.js","gitHead":"058802d9cf73959f386bf2b0666f40f2c0b23a75","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.10.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-zgmtRYWYREdflkT/ngRWe1WDhjou5ArsTITXM06bLJSFxqI+3evi3Ryi4f93ncifVnYihyN8M7mBklL/RR23+w==","shasum":"74bc197821ae3a058de53cb16a46ab117ff317af","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.10.2.tgz","fileCount":5,"unpackedSize":90261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/rdeCRA9TVsSAnZWagAAePsP/jWTox2IUve+/xz85IIy\nw/fACdVxigfa3hROGqEjVy9TGqwd0G6CLH4sqUHq8SnSop6BMcp0q0JACCLz\n47uYL0D3igzQCE8na/0GSmERHPf4tptbziXAcoX7Q5eW5B8p+sgDA+z6bC3M\nvxw8T5hSyi2lfIujN75SnI+iB8u5Z+WKAwyJOaJgmCrTNNK8gMT7YZFUYtOs\no6V8Dd6JgtIQeDvr3ts0VfTI+B/T1jm6Z91D3VCltKhxYveOJ/QtNdvPKmZN\nsfxGImivIxIYwFxbX/We5dHHizlxtfPoxQ+bw+/hA6RnVNFDnvGJf8V2JktT\nvfPGxSBqI0ZVvJ09R6yEA6BY46PjaAMAsl6zEwr7cbsX7/l2UuspbvQrtAFW\n2hmSvycWFrC/N4wt7nZCA8QyQ3g++8XiYLKGuywUqUTw4dx6dz2AIFcGQzqC\n3lfBeQkD7WrVtpO6j4hRVqPZClGkPgp9wT7dm0sBPBXoR8I8LQMBXOfu3e5a\ndc8jrmDbkMglL5DDbzOAvWwjn2siuhpZvTknKmnAoZ+mTDrwqE89dVabQlL4\naVJPSZPZ/zUtn9a3TnhJGDxdgjSrFp3uq8YB3Fc3TlfyK3M7F36o+TVChB4i\ntJzCUBLCraMPULpfYBzOtao7UNNGNRuHWDtOfxI79JX2xqSfQk4td5X9QTeT\no5CA\r\n=J5b4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoJRQHzPswGHF2FWdmii1ATzIs8UnpaoXWmXleAllkfwIhAJd3NA9r6UeIUNvIcW/7MxXy3+X2AeI7CjzzXM4Xronq"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.10.2_1526642523547_0.7934602898165473"},"_hasShrinkwrap":false},"6.10.3":{"name":"wavefile","version":"6.10.3","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.5"},"main":"index.js","gitHead":"d35290fc36af02d4199b60e92c45dea81eae406f","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.10.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-I+jdnxPPVBm6JNxvD6wo8LUH42YmU2lfLwws4P9Np6Z/ro9x3XKaKGGo4U2rdF7G0IvBzDEsPBkbmyAjVHLozg==","shasum":"85e8009a833cc97ee1bb30f03503ab4fedcb90b4","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.10.3.tgz","fileCount":5,"unpackedSize":91091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbB5j3CRA9TVsSAnZWagAAwS0QAJNqoejfXjMFroTKbG0Y\nB894e5HoVb0UAcoib1tJw5lVaSQ1RvnYE3dq7ZSwENs9sAt6P2n6f+wm6pCF\nAUEgGa2t0/loRI9XhCiNbNryq09UucqBLQ40xZmbL46lqmriuqmK3Mc11THV\nnc7T0VguX7ouHjhJA+DUgkVF+lJ3j2X4NARnS5ms8NCKyPmpiKuSjK9hcsn0\nUtvZcFjUQwnvdA/bUF5fYMIqJGT8L9vVOy38n43okpaM+AhzUMfuH3+losS3\nxbViyoV0/fD1jqSKlgi3ji3mMq4TPFoFhPLICaASSaGnJDQBmNAO1RvpJNyq\nB9MfoQGpShxYqshGzBDrUOsV2EPzlx1C0OxqJnaUYEWP+2Qe1uUJkclPzewM\naINO1TMcbK9AGj2JxMpP70pTt+BQXf342IQPzpfQX+h2EjGzlhJSbOKuDZDF\nPdLQG7G8p9J98qf8zlyntqC1MxRR6D4AmTkyvnu2UTxjxqgN+R/tNOtMossd\n73mTpVpPGYz2Liw/xZJwx2DleBLwXevV/Iu2+gcMEHjHolnwk/SKRVeaChhl\nK7AKzz9LWG37IHrbnaL/RpKsW60nbxMk5gQNW4bUtSRBb/tErjgkJhcsEG9X\naveA8hXuelbKkTSxRgcL1ybT84jY7ST6cZ/JeC31xKa+nEZkeG3S9dgluwgf\nd83U\r\n=5Duy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+VcdjgQTp5xkR7N4j0ndqpgr1k31/sry9vxTrqs4QYgIgLtJL/vPyzdw/iibOH7jg7r8/OBcdrcTtm2OLELzxRsw="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.10.3_1527224565400_0.08744439411364624"},"_hasShrinkwrap":false},"6.10.4":{"name":"wavefile","version":"6.10.4","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.5"},"main":"index.js","gitHead":"1b0b84bd1acacf81c889ed8d6894f85ff2d8ebab","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.10.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-qKubT7uwF2QL5BuiwzxaFO8DcL9HnG5eNADUFfa92xupNzU/o3G9tp0cvsgF2jRnoNAmjUPjamqXRtSkoRyI4w==","shasum":"880a6d255d2934237f10dab139f2b4704c6fd853","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.10.4.tgz","fileCount":5,"unpackedSize":89749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEZZSCRA9TVsSAnZWagAA+qcP/2bK5z1fjLNyhwP45N9l\nXgnlDXo+fwkgDRNay2JV7j9+cVCzBMIbmzWfp/MbxR6++xD7oeKex7rnLnaw\nLTx3u5lGOoaFWr/5gAQbC5miF00WGw/6LWigJeKlJCnlpEH5rqKEHIN6a7ih\n0LNH9yU4FvyniJe/EIOvut/2ROL1l/X59jomzPO97rD6Xl4GC72PSGzHYI0X\ndX8ZyS9AUgiBawE+G6HYcpiOd5+pfYlwy6vdtVBUVG1Dy/Pvo8JuwSSSFbuE\nhMuvfw+MF35yYnNHkmUBQHPl3cWGl19n1IoNkEYBWSaRL1x9EoYWgErdaHhe\nAW8NwMKrHFDiBxvU40nQYKqyimDmi/rusdVJksRW3GXT6EzNAqdVNIyL3d89\nHo/MbDnqjJMj1SP/uMGVMfRY2IKgIyOIiyCTRAmEuNM1Mx2OELC4Y2qbfdzd\nhf5wmi9fBPh54T59/6jDlVCdgDE//0AgYJt4FdDscVpJy0LF6KNIxyZigaI9\nxBKq6KJYxfX2Cqr0qotFCkMG0+oi6LdfOxIg5bjp1S0tHiz06mvuZuWjFfGA\nLow/DGifJPzPK+E80FtLHz1M/TcA+BszevviwoxwWuWNPfzD2yjcURa27nie\nFDOfvpHsyzPoS37Q1iPreoqubNCPkRq3XpUiG8+Ywy3b9YxOz7NptXcCNXD7\nqLan\r\n=y36c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4/0EOOMF3DZ1K/SOBq0T5h7iCQRMoKOShM55+835IXgIgDyTRxy+umZKOqkaq39ofJH9ueWBlIdysU82irT9vK6Y="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.10.4_1527879248330_0.3326870869941334"},"_hasShrinkwrap":false},"6.11.0":{"name":"wavefile","version":"6.11.0","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.5"},"main":"index.js","gitHead":"38760ef22bce6e45763582e334e0f3427edc85a6","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.11.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-qvAJ73KmkvwU9sv503gjGLZ2e9ZIbFHMfzZ+WGgl0JRfrxr/F1KVOnRaZGLxMO5CGkY7N/0C3i0Z3sNX3LH1Eg==","shasum":"4b16865204bcdb1253c3f454593cba938e3b5519","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.11.0.tgz","fileCount":5,"unpackedSize":95983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHIwFCRA9TVsSAnZWagAAMdgP/A6BneewklJVJp0ApEK9\nIEM0x1cIlUBTUJ6WOh3vKgTfEl/75e9q/P17TWWxHALJyVVthsF42p+5ZjsZ\nAMssUb5xXLLUlRXt+otRnjEmIrufTlZwG0t2pnCDd65QU7xmlZHRrnXBL999\nS7vBDuSOGgJuyJucc8HiWnPUf0js2TMQeC7EyFEY7sF+dA0gRGnS1SGo7k0w\n+kEjxZM/LcdRQEB98kWHfsso9vnzHttP/3nrENp8Z06mKuLE0kKgvIsQP/bH\nLO7VJMJCZ3IM7FY75DT9fMx9DkORctYvRVX7XvEThocK+tGtDRRj1JU/15Ju\nYH+PVyUshW/cHIDwzb1p0Uc2LPFF3ebvl+qE1BcApwPGvzj2UwLTynOOnZgF\neOXwJ+8TFbRUHtDzfVz7RSYgWrf7V8KqpnBsbz1BhPcd2yOn96RZLR4GwKq8\nfq0CXaLnNp/LHSOIxa3/UhRIRJeOJ2eSWUqNuIwDuJkTwpdU9fy8TsMvqQZN\nEWF15LAPj4OPBBAbyM60QvlUgcVq3ldW0Rbz1AitGT3qVJHzWX6SC7RFFsR9\n2E4OhCWFFSY5CxhJBEbTedm60CqlTXbLJLrwG8gTGuDiNgX8+jXcyKAR9pRa\n3d5Glm3HWKv2lDlvlKp+Caua7X+pRQSqUTjUFC32xiLYMamYnsjMGwpwuM0c\npkri\r\n=kCXk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsEmPLTDBERNo/WgTQJxeIOO/JdHWmJ3dfoWrdi0IDyAiEAmXNZr897gXD3ZLbFYbyhKYQizk/eG2g0BZ/9pRob7bM="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.11.0_1528597506344_0.4433007169827101"},"_hasShrinkwrap":false},"6.12.0":{"name":"wavefile","version":"6.12.0","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.5"},"main":"index.js","gitHead":"a39658ed282107f8f06a2da5ef66ffaf6c68e5b5","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.12.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-ez/gvUdI9B05RrmED1lec13Q4A0yCof3e4ack51so0D6SDsixm3ucSG8rN+d1uhSHmnB1g0WzoBxic2EjcBEjw==","shasum":"82e6b5e535a6077172fb1e6e274f987e95d4974a","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.12.0.tgz","fileCount":6,"unpackedSize":97747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHcc/CRA9TVsSAnZWagAAQ1oP/RznFXQMpfLHFmzwiP0l\nHjgvDN076paO81lXC+h/aOyJwxVPNrTdbR9CHoHeqQnjJFTr63kZFtJvg6kD\nsePlypf1ycnK0tMPCN4beWrXLLPCohmVNNKnnByo9E+LAMWUsD08mN/BS5V1\nfB5opORs+YjF04rwL3acN7Jt02+QstfcwZ7khcT83yW+gWgm1E/WFMh7kzh6\n7Jg+XIWjN9lQUpJ7X7qOTBt1p3/1XXcfiiRo/nRrqXOH92FmOXEm+z/x0pxC\nkpDuSbwRvsYBRbRCGjq/XKOQklYDpPSEipwDNQtahmeT5P2J+aIZ7mrsx/yn\nuFwlCbBtBy/K67VcjjTrWFprGZ7GppsgfGvx+k9Y32ztbMZwUFz4cQNKtxWB\nN7y6k69Pxem3oPKX6Jwu1PLuJjmHEKUJK5FuU1F6AwEuDL12SNBIC36rY4Nj\nwODoWCP2BY8yXDc1+Gc+ep2XxX1dU6EN68Xpu/4CixjuiY+Apf/o08H+m8gs\nN94upHtR7dVOMEbmQIToVfIEDXBkkmbcEp0fTsRdsDhR4bqjFVrNu/Te/xQ6\nVRhmokrj4zEDSIhhzV+edpB1JF2bZJrLSctzH/Hp0kFhVI/uVzk861AQWlfs\nGC0ni8isVRtgquneuDVv0jkMWr/1Teq/jQwFufrBZl+5O1ACMDR+MTpSU75r\nCCG7\r\n=LOzH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIExb02eg6BJrK50Te+QNfLzSgRL2u3x5PjBG417wvAHoAiEAyTEp0lewEkBZj1+TSUoKJsA2RCyHCYUBhg6CcTmornA="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.12.0_1528678206017_0.7947730151204906"},"_hasShrinkwrap":false},"6.12.1":{"name":"wavefile","version":"6.12.1","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.6"},"main":"index.js","gitHead":"848d6a4b996e9d43099170221dc142566c16b6e6","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.12.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-YH1+2eiTkIYeSGrWzHZf6LTUZV1uqnp8umPFDiqyCdmDqZsiXECKT48MLNb6g88Vlvo8cW3nNt1nNHTLXAMNSA==","shasum":"2dc86c422ec40dc6aaf939e69931303c916e4c24","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.12.1.tgz","fileCount":6,"unpackedSize":97846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHgbUCRA9TVsSAnZWagAAwu4P/igenG8aYoTMGn349VOj\nVu7FwDGzNAVTc3OupxQhXLeRXxLW/PAOy8+WV8Tcns67l2897SXEv2amZgpT\nVkPqKC+iNfB2Tlp1b2ECx+sLq8jqh9R5RwlzRnKktyz1QxVK/cPIWYxuG4Ug\nXk0YNBbAfh7Yd/9lanqOdZG+Ctv3XM5WyMc6NVSAHxNwuCSKIQq3em18cP8h\nkncCG4i4whukMACTyhaoIvqZMgxc7wq9VjLorFy5pNkalYuToGlJvN7P1RCP\nl0dPaNbjbhDWKzyeYjv0n8PjW6Mt501VVTrZLq+tvSXFet+jF3/LRalKz11e\ns3HGj3RPMISdJSuFGoFT/dwrBwdwgG2I4Soq5owQ/KWcJWaXgJxbQw43UpzN\ngcXxMULJQFuvZI/zdaIwAEPefYpq/Y3xnN4R6KxvTotlYFT1HSze5bNmPyv6\nO6rXamulxVcIs7AmPjF+Upwfmk6xJ0lC/MUcNlmze+bLgHixThLOh/Zu6Ixs\nuSC8xrfOdCnO4tMJtMQ+gJnG45npp4wRJsJ8wY5KwUzKsjAcTA5YXnhy9nP/\nPEs0EI8ResCGR9hDE4pd6fPfy91FTx/LY54n2JsE1dTOLVAjhn/etA1X56u9\nitxeMRayQ192GI3ruFjSsNTByU9n9F83Tyb6HzmmvKh34MJ2PQjSbsiHeuaz\nvhD5\r\n=m1Hp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiTcu8DCCb8X3/k7pJJGVVM3YBgQGVg+jyDuSFgAyHDQIgTcGQSMClFy/VZqsy+LjpVwKGWJWNgoZZe+keBzCZOzc="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.12.1_1528694482857_0.24429596948351073"},"_hasShrinkwrap":false},"6.12.2":{"name":"wavefile","version":"6.12.2","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.6"},"main":"index.js","browser":"./dist/wavefile-min.js","gitHead":"795daf0c96714ea4b27413d40f4bdbdb1bae4bec","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.12.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-F6jyQFpCg6PIWke0FFPJQ48KO/Mjac4R/7kzL3Vo3fs1pjmjQ8dhN5Jg2dYG7NI8zVVY8jcAdFni8R1ChDjjJQ==","shasum":"d380210e64fc4cb3cb3bc972814cf908420bc31d","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.12.2.tgz","fileCount":6,"unpackedSize":98243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHk6kCRA9TVsSAnZWagAAxjYP+wYuofGlMAl2RHYPtOsv\n/48YFa0T4iXLxXEfzRXmRaJGfuoaF7A8GF0UgzhGh8jR3UXwMSDBnSSSV+wz\nE4DsIEjUR2jekfmSXqRMK1vS4MVDe+jFTcS4QpMcI6bOa0dyqvRORy7fdYwA\nY04/19xnLeWf9yXy6e/C4nMBj2Uup9WlEqqcN1GQIiv3pB5P1Uoac1NUnwE3\nHgDToPNuuqzFGb3X6TBBhhRIO98HZbI6MQyg9LQ5VhQFyIQIggubluYIzUAY\nFMLeSCGacOSKr7ZO75PgmGlLk+nFHLl8/au9EVngDRNYhwK1wegfpE8XcRHE\nHouYZwk21fDenewmE9M/CpdHta2I1l2mOK7MQNfOD4SZn28tPWtoFysMmfjb\npTnmVmHk4EUummTmFAufBRYAvLr6m2Vl/TDUEjPZ+1k638EQuDpMNjBs+0cN\n36IndmOVRUZjUQGvSrKWvkN+TX+zCQA5eQ63tx0BWGQVvIwzaY+M4u22Q5lS\nvL1piaKXELMsWNiXKTMTVMZKmmPKn1Ih5AzogB+ayUFsSIQT+wY6cp144X8B\nQTJ5aGQYkxwvIM/3/gQn8doyBrwouqdGuHiERU45U77BIeCKA0vsxn6a8thI\nIihxqFYEm983V85Hhd+QSGyj/Tebp38UeqmMgYM3VWSQnp3R9stvkmJQAlBz\nSS27\r\n=Exip\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1Yxkrzx+T+cNNLmoPCVSmYzejEqo1mj1smBROzHZdKwIgKo0b98VjAj9IFtQ8JPDrLXPO1EgE655FCoa/hg8UsiE="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.12.2_1528712867576_0.38089261376791006"},"_hasShrinkwrap":false},"6.12.3":{"name":"wavefile","version":"6.12.3","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.6"},"main":"index.js","browser":"./dist/wavefile-min.js","gitHead":"795daf0c96714ea4b27413d40f4bdbdb1bae4bec","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.12.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-4hM55gPtYeFbomvopI9DQuVmE0r4JjwC9IQAOaAWUfObgitmDfXohhvj004vWAKdNyvrtENPnD2wSKVVLh3ozQ==","shasum":"d07060de930ce14578cebb975c2def12644fd664","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.12.3.tgz","fileCount":7,"unpackedSize":131114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHk+rCRA9TVsSAnZWagAA+GMP/AzMeHXIdu3hlYwj04it\nreXze9JkVkDpXsSZiA0SC6aKGPhJs+D3idrdj00gjwmu8s4SmJEa7M/xYhwe\nhANrmTYJ2OBlwn0ntFL2K4H1Ntiwykjw8g+jg4Qk7PcjaLWRDHkJXn4QB7XI\nGrZqknOyGFPa2vhOvHuNlBFgTc4ITlAmsrjk5rXnwp3q0kwDutZMtPmdAs/f\nKVSHZQj5HIL4yPLrw7UEtI55Tinyw7HQRINwXe5BMmoMwMHEisTnae+dqEJi\nQKs7NB2R7O7j4NvlNgOx0WWxyJ7k3XajWFtIQBzDIH/L7oMyjYUG3ttdB2P0\ndLS5KMY4DDJRkzdU+vfCpIELsZbbVIJCBQu0faOOH6uDm4200fYikGXAKFfm\nNUQqkVG3XY/Frkuwc+6wOrdvu6s+o6xssvi/ijmaZSK4lJ6uqfWJFlIKUB28\nh5+Uwr5zHsYy4IVwA5Piz+HvcOVpyFz470qBM0i/3POFipTU/2wUShyKKRfO\nXNDDx/0Bx4ag2efNImGYnlRgihlZV0NyV13mqMZf+OgH6wdxvhQ1yRuah0UY\nNQ90mqSL24TM7X5E64q306f4YQqD+pbFqiFF0zIul0lweW+FAOGaO/smgqZ8\nCVMtteQSa8qpbTVwmHqQluJUBftdeeKBO6rrIGc7eG8fn4seSRtHSeaNy1pm\nZckR\r\n=1RPG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAhCPh5T7kgue08SjF884yrVIiCK6GeV+Th/yc6rQId6AiEAkDv2Z5zak+3zLTydDCh1fuhdY85XXAZ2q8dGJrC1qkQ="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.12.3_1528713130911_0.782151070753702"},"_hasShrinkwrap":false},"6.12.4":{"name":"wavefile","version":"6.12.4","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.6"},"main":"index.js","browser":"./dist/wavefile-min.js","gitHead":"89d6c37523490e36e0b8b1d0d695381ccb691ba8","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.12.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-wIKDnnxZ/xQHc/wfGinLFv3qffjJlMNjtvASsmBIFswaTQjolJ82vLpc/kkH4OhXauApbPXJE4pDCs/sC4Bflw==","shasum":"f118369d70e925b46d7e8959ca52de10daf8a7e3","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.12.4.tgz","fileCount":7,"unpackedSize":131215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHlEsCRA9TVsSAnZWagAAtYcQAKRB1mkYGP41KGol+H5i\nfLV6NURnUhTEbdsEBCOSK9ibCymycyBqivPrIzNMHA7+y0hugOmuZ2rvlUR4\nr1Wg27Zmtym6H75CmpNS1xQPNR1coTruf5qMbXCiFM+pE5pr1RfEyZiB7iZV\n2PGGrVPRAtPHePadf4KXDiKYb1xDOUytj1rIgeBtSthvsewHYBlEFSbwS/M/\n+TaizwBF4uxv/4jLugdAMkT9yZICjp8JIhxzCzhP0izz0LG9Aw6GeQnCQY8K\nSUShgsWbA/g+hc+HfTkuNQvjDjxPgbcpqQt3RD8nv7Wwjz8qPbjdeJELgamN\ngYoT8PNRIuvPN8/vDHtgSL6iDtnrLQFMM1K3Njftp0jsV9y0MtzuTP28iIh2\nvC0AjOtn0UpxVP9PomDn38uD87vdreUTxtAtu+AwyGNe4gJwu2CJSLFyFzRg\npSQXgDbQCtmeB0iKGjuHs4/Sey3HA7qG+7t0lZcSblObMew1oyJPRiF45gyR\n9t9zHxBW5V0boWSl6wPX2WPnWF5KdGVXTXJ+Fh8pvmT+Km9HcR8GyA6Ff2OZ\neBLl3oBzHt/dEjU7kv1GakOHCXqM4Y0DEJMIbWqxqaGyCwH3gQ9SadIlOE0a\nAv8WfS0ChO9AxLLlPd300pmrzQp6nM/OBrkukC2gP2soMHuFogkPRwQNUX2T\n2eto\r\n=Ksja\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFVk+1QnxFfnw4xdBwVOHxL/Y0cfzQI4Ld2a7r+RovuYAiEAp9TNJht6Q5BXGhHr5ZuVLS1tVU0d8EORKzEag/kHQgY="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.12.4_1528713515712_0.8745468908999205"},"_hasShrinkwrap":false},"6.12.5":{"name":"wavefile","version":"6.12.5","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.6"},"main":"index.js","browser":"./dist/wavefile-min.js","gitHead":"b8f0bb68b8cb40e749e72debcc53dc27faa061e0","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.12.5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-G+2IbUuBlB8A68qX6jo6uKd0JPIrCz/7EKqug0VYqkCz1ArxVeA338b/QttqHRC1uRYsHjzyajXfqrwf7Z7/Cg==","shasum":"509099533a2590e1e07773df194c213b6ff91ae4","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.12.5.tgz","fileCount":7,"unpackedSize":131317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHtgDCRA9TVsSAnZWagAAiR8P/AwW1SssuvKiffg62iPr\nvFm4NLMMiEPeBtuIZzhXXluD+tMWr4dpgXAPMcQ37xxU+uqC4UDhvrAI3cVn\n2o77q8aSklNcMTwqI3rl0jtF2hQPm1HTbzpkwQPN8uXjQPzCBoK69Ag9l6oK\nsTWe3sTlCzdvWL6+apNZ436pVE9MkpcJ0PfjiL/fDm2zMkr6ua5/AyK6BXQZ\nZJKyhE0YRxGG0sdx8syJ1U/mhbNbCOfPvYepiFKNNsK4ZsQDWo+szukIyrqR\n5F+Hw7GEUOXwy1TXRlzhYSKaJERUNcSLkimvyXrO1s5+Z1IXOnXj/lNosehq\nJ5lGlzAirqpg71kcbzABB+8uxQwYYxGUIo/U/+8sVOau/AEmrKgjXUe6FVuj\n50+y3+rrPYxY4XY/zaO1avdAbETcNjXM6vyjlBvhXDWjk94zdWY6tqEGWH6R\n8WqYmIrWpENFwSXznxDQouND9Un1Ravn4pQBR9pnEUXcGSxdBL0vxbDdzEWx\nIeFfBUFV/OVxD7S+3EEEiM59yR97OkBeJmGz7VdyjVbVTU+PJishdnu2T8Cb\no5Ifv4LuKqY9GNHEIW8RKDLfvoQx4H2Bf1xJ9XQ53o8Bc51cGQcCm1/J7pvJ\n4j8WlCeoPZDEwGiIJqufYi0yGN9/rWcjmdv9er5wR+Hw4jQ63R0ENUPpyhtG\nusim\r\n=hgvA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFy/JgL8lVyUkJ5Pfz8LtLKsU1kCsiIWrkDfr9tgt4KJAiB31GMMhmj92ll35LSdJEEMgQS6Vmlk+6HB0QRvPeG3/g=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.12.5_1528748033655_0.454912531937784"},"_hasShrinkwrap":false},"6.12.6":{"name":"wavefile","version":"6.12.6","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^8.0.2","imaadpcm":"^1.1.5","riff-chunks":"^4.0.6"},"main":"index.js","gitHead":"8c49ab19ab1e8504bc2dcb7ea3b57961ccd291a2","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.12.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-uWrL6dmt5qG0sJzdz3GzKZeBrFDWBtf7+WUwyDhdS1uTOsZvkU+VHAeZ0Yzy3VDSqWuchvO5MpJ/JH+tNzeKgw==","shasum":"0d657270180696f1426954f8469449047cbc8ba1","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.12.6.tgz","fileCount":7,"unpackedSize":131229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHw3iCRA9TVsSAnZWagAAVpAQAJLzqUzZDpD5R3WZ6gEQ\noKDCrzhrAYCjhELSYL0p/kQA2TCwRT18P/v2viAvmauzz0kCGz4JacHb6+XU\nD0G15gVEPzTyg18igMcXZSalQQxiny/wlf6vMWu4zL1Vs4Bc1c41Whk9WQVa\nYQda0gSM2BPioTXI1h9q1WqyGPcAp+7JHyTjniAVPYXWWGnkgYlHCBc5PY6H\n1v7AwP8RsQpGcPgQtHR/naqsw6tr20Z5+8uLMu2EtW0p6qHfDuLLF+t9OOg0\nLrGgVej+iSc01QCw1EcZ8mNFB1mtqTQN6EicxcWH+fh10DAwWQsMNGxT4Kpk\n6zsxwsYrOsr9mH+LCYkUB435q78wumhqP6dXrKuUtvu5b2tpawJcQx0dEXsf\ncjX+V8HsSt7VYnFW3n7Lgn8hGQ5GEWoPUUp3i2avZ1RfsuTcJ9etpGn9rvs4\n/1l1PVqX+SyDC94NLothmTQuevGSYu8nS89DYB6pCyG58oz/i1TPDQCdjODR\n92kXYWfR5smsDb51DY0Q2s6GRfwO6CPCajawnBdk/+Xcuxb96PmWKomQwHH0\npm+DaFPir5Ig22SnSxZUjdVERQ446qzyWf/hP5hWdL/AuivJZrM2WFRR5QHB\nbtKA0pWdj8KC1IGjGwAU48/9K+CX5JkdctqJ8YCHKGjomLLo6+erse/BMCwi\ngbyo\r\n=27rq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAhueKFjEGMxo67Yj/5K6wdyn7PHUZYzb78QxukSVCD2AiEAg2DGLHcLtBe9g7Bg3VJ/GAUKRP7LLnJavSS5/0YV7Rc="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.12.6_1528761825604_0.8171320723450144"},"_hasShrinkwrap":false},"6.12.7":{"name":"wavefile","version":"6.12.7","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test-overflow":"nyc ./node_modules/mocha/bin/_mocha test/overflow.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^9.0.2","imaadpcm":"^1.1.5","riff-chunks":"^5.0.0"},"main":"index.js","gitHead":"653cb92c6400b868d276bb0e0d303069b224ee06","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.12.7","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-AxND/Oh+r7JNooT5qY+5l3OJVeS6CbMe66Ef0B9I6xyeEw/BqNFMZM/0wZ+c6Lz8mXHsnqmrY99cwC2IBaXXwQ==","shasum":"13fbe16a115a9c08b532bb9d591d836d6d90b7d9","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.12.7.tgz","fileCount":7,"unpackedSize":132305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbICC0CRA9TVsSAnZWagAAzlYP/3L1L2duN2Q3fCZXquZC\nicKMXYRbg5P5zSXDdqs6w/H7nNRQTpD/A+Hd9vFgAuzC9kFJyBT/8VCpucUc\nw59LFA/6w6o5nw/kms7J0zr25Ija3yn5Q+2LZTU5xmquIE7OhORulr4zRF5h\n2p5hvQKARrGMVrXmBSdnkv91brgFnjx0eImgFBgF8r5jLFuF9RnkSKEKgKPn\nyfCY7wcnvsGXUaAxogIcHFxxpO2kK8D6qBbcYHpZhgCct1gvtg08sJhLe1ai\nxmhoDDV7gwLlM/0lYBG8Kcv8ujj67peWkfPnL0PJZEIJM6C+mTnwuwEtyVcf\nH4ptmFcio9qfO9FHYavxwO1UZmtc7dvtNu4dIBEq+EgGCqJ0P4Q7wM0RVfv+\nojIFFz/IMcDQut+SNcbu0m8cLoNPr1oBVeTWplt0dtS7yK9jcPYkIAiVbbWT\nyVZxOhxixCsdTRp6k3e8pUBtfe1xj1+d1qqqBp/Qj17kfJUA2oz4r5qI3udN\nBoYleClNqXrBaTHbrgj1Krpn662EJPyRNWHzulU/HTtvrfx2h+7Qk7tNEz+D\n20lb1aIBOw0KhEyXU1mK7y6qKRq+hVIN3Ms1g6yiPUWrKiaIl/OoxaF3cT0X\nRcZ3TtNKalkRVQ1480YY8CuvZ1Um+v27H+1h22WZF6lZbls1I04A6Gn7+ckp\nhhXM\r\n=yZfD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQjuWNebvxzfrNa/fnqJ8NvA3TFGFThWraCOSZhccvsAiEA1s1Vadet5DGIAKMB+5ERa8JR4jd6MZXeLAEE+KfH0ko="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.12.7_1528832178067_0.34337316559502584"},"_hasShrinkwrap":false},"6.13.0":{"name":"wavefile","version":"6.13.0","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test-overflow":"nyc ./node_modules/mocha/bin/_mocha test/overflow.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^9.0.2","imaadpcm":"^1.1.5","riff-chunks":"^5.0.0"},"main":"index.js","gitHead":"cc7fa35be59ee280d9e080dcbe07f03019e9dc94","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@6.13.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-0cFnYw5PBfT2C8dMbeY3nmLlhi80arPX45YMKeqtD4q9NPt3usOK3vOqCmHwh45tCS+1JHsThzz5BrbF3JlUgw==","shasum":"1311f8a3354f375153bb8faef39c9ae31da59ea0","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-6.13.0.tgz","fileCount":7,"unpackedSize":133828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIUQ+CRA9TVsSAnZWagAAS5kP/01FBdWFn2l8inyvNYKo\nuj1eukYRP2S7KtBStYrDMA/mNVtnrUk1NqsaMXH4up9Dy0JNL5EsxmXKlQuq\nS2wKuL/ib3oZxkDtDIbCtDHM/SnA5vCJE8qGuslMrnsQBSAK6LnkTCqjKC3J\nL0Sck/sB/NPmvYPxhVF8AnMW8KsmA4AyZBA0PcFZu2MHfYh5HAVQxAtDWozV\npcMA7dMb6fDPnfzahjIXyyrZi7zGDHGXM57CVoJHUT+yV9dgL/ArKedR0olU\nlll8AtLEk7LLVCIxgtsHzQT9i+p5opxU5ayNJ+Ta2SztZakJM+wTRXYlJIei\nEpfvQdc3mtu00fdgBxhIrbbA3MoBhEd/+u7lGdvEmSfH2u/e55XHlxHnCaDR\nfEOJ+4gdNU+6BX2bb1pnzlwDv+HtMMiTxLS7XiBfCDcIBi2idzjiIiy8Tn9f\no3qDmXNYdh1zw1IK7HxiWB6IYtzbu0k8QKifhkaP57s686rXS0i4o1bQRGVF\nbixcSAUC0CU3YwjY/wugy68XduKp2l0Yqh3xhnuunxiMJuducMhNWOgRXDT5\nkd4OxpbcKQq6lL1qbpi1OmvinmkbiQ0j8AWjIJueRti4DOS6e7qA582sEh0x\nv8rUsvz0BVDqatwA6jOCQSAYwzQ7k25BGDf/QNxEHOWhMV3FQvmnFfEALz/y\nGn2I\r\n=m0Xj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmjm6UFC4KVzCOLH9bIEec+NRjd5goSePuMSFGvU2+uwIhAKvNEe3O0yPoL2a8e1QGay93oOOuN3/APbbzBWi7au6X"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_6.13.0_1528906812646_0.2389163493834381"},"_hasShrinkwrap":false},"7.0.0-alpha.0":{"name":"wavefile","version":"7.0.0-alpha.0","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test-overflow":"nyc ./node_modules/mocha/bin/_mocha test/overflow.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm test && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20170910.0.1","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","string-replace-loader":"^2.1.1","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"^2.0.5","base64-arraybuffer":"^0.1.5","bitdepth":"^3.1.2","byte-data":"^9.0.2","imaadpcm":"^1.1.5","riff-chunks":"^5.0.0"},"main":"index.js","readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## Main methods\r\n\r\n### WaveFile.fromBuffer()\r\nLoad a .wav file from a byte buffer into a WaveFile object:\r\n```javascript\r\nwav.fromBuffer(buffer);\r\n```\r\n\r\nThis is the same as passing the buffer when creating the WaveFile object:\r\n```javascript\r\nlet wav = new WaveFile(buffer);\r\n```\r\n\r\n### WaveFile.fromScratch()\r\nCreate a wave file from scratch:\r\n```javascript\r\n// A mono, 44.1 kHz, 32-bit .wav file with just 4 samples:\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\n```\r\n\r\n### WaveFile.toBuffer()\r\nReturn a Uint8Array with the WaveFile object data. The buffer is a .wav file and can be written to disk:\r\n```javascript\r\nbuffer = wav.toBuffer();\r\n```\r\n\r\n### WaveFile.toDataURI()\r\nReturn a DataURI string with the WaveFile object data. The DataURI is a .wav file and can be played in browsers:\r\n```javascript\r\nwavDataURI = wav.toDataURI();\r\n```\r\n\r\n### WaveFile.setCuePoint()\r\nSet a cue point with a text label in the file. The point position is informed in milliseconds:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label\");\r\n```\r\n\r\n### WaveFile.deleteCuePoint()\r\nDelete a cue point. The cue point is identified by its order on the file (first point is 1):\r\n```javascript\r\n// remove the first cue point and its label\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\n### WaveFile.updateLabel()\r\nUpdate the label text of a cue point. The cue point is identified by its order on the file (first point is 1):\r\n```javascript\r\n// Update the label of the second cue point\r\nwav.updateLabel(2, \"updated label\");\r\n```\r\n\r\n### WaveFile.setTag()\r\nCreate (or overwrite) a RIFF tag in the file:\r\n```javascript\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\n### WaveFile.getTag()\r\nReturn the value of a existing RIFF tag:\r\n```javascript\r\nwav.getTag(\"ICMT\");\r\n```\r\n\r\n### WaveFile.deleteTag()\r\nRemove a tag from the file:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n## The properties\r\nThe WaveFile properties:\r\n```javascript\r\nlet wav = new WaveFile(fs.readFileSync(\"file.wav\"));\r\n\r\n// The container data\r\nconsole.log(wav.container); //\"RIFF\" or \"RIFX\"\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.format); // WAVE\r\n\r\n// \"bext\" chunk\r\nconsole.log(wav.bext);\r\n\r\n// \"fmt \" chunk\r\nconsole.log(wav.fmt.chunkId);\r\nconsole.log(wav.fmt.chunkSize);\r\nconsole.log(wav.fmt.audioFormat);\r\nconsole.log(wav.fmt.numChannels);\r\nconsole.log(wav.fmt.sampleRate);\r\nconsole.log(wav.fmt.byteRate);\r\nconsole.log(wav.fmt.blockAlign);\r\nconsole.log(wav.fmt.bitsPerSample);\r\n// \"fmt \" extension\r\nconsole.log(wav.fmt.cbSize);\r\nconsole.log(wav.fmt.validBitsPerSample);\r\nconsole.log(wav.fmt.dwChannelMask);\r\nconsole.log(wav.fmt.subformat);\r\n\r\n// \"fact\" chunk\r\nconsole.log(wav.fact.chunkId);\r\nconsole.log(wav.fact.chunkSize);\r\nconsole.log(wav.fact.dwSampleLength);\r\n\r\n// \"data\" chunk\r\nconsole.log(wav.data.chunkId);\r\nconsole.log(wav.data.chunkSize);\r\nconsole.log(wav.data.samples);\r\n\r\n// \"cue \" chunk\r\nconsole.log(wav.cue.chunkId);\r\nconsole.log(wav.cue.chunkSize);\r\nconsole.log(wav.cue.dwCuePoints);\r\nconsole.log(wav.cue.points);\r\n\r\n// \"smpl\" chunk\r\nconsole.log(wav.smpl.chunkId);\r\nconsole.log(wav.smpl.chunkSize);\r\nconsole.log(wav.smpl.dwManufacturer);\r\nconsole.log(wav.smpl.dwProduct);\r\nconsole.log(wav.smpl.dwSamplePeriod);\r\nconsole.log(wav.smpl.dwMIDIUnityNote);\r\nconsole.log(wav.smpl.dwMIDIPitchFraction);\r\nconsole.log(wav.smpl.dwSMPTEFormat);\r\nconsole.log(wav.smpl.dwSMPTEOffset);\r\nconsole.log(wav.smpl.dwNumSampleLoops);\r\nconsole.log(wav.smpl.dwSamplerData);\r\nconsole.log(wav.smpl.loops);\r\n\r\n// \"LIST\" chunk\r\nconsole.log(wav.LIST);\r\n```\r\n\r\n### BWF data\r\nBWF data (\"bext\" chunk) is stored in the *bext* property.\r\n```javascript\r\nWaveFile.bext = {\r\n    \"chunkId\": \"\",\r\n    \"chunkSize\": 0,\r\n    \"description\": \"\",\r\n    \"originator\": \"\",\r\n    \"originatorReference\": \"\",\r\n    \"originationDate\": \"\",\r\n    \"originationTime\": \"\",\r\n    \"timeReference\": [0, 0],\r\n    \"version\": 0,\r\n    \"UMID\": \"\",\r\n    \"loudnessValue\": 0,\r\n    \"loudnessRange\": 0,\r\n    \"maxTruePeakLevel\": 0,\r\n    \"maxMomentaryLoudness\": 0,\r\n    \"maxShortTermLoudness\": 0,\r\n    \"reserved\": \"\",\r\n    \"codingHistory\": \"\"\r\n};\r\n```\r\n\r\n### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### ds64 chunk\r\n**wavefile** have limited support of RF64 files. Changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n\"ds64\" data is stored as follows:\r\n```javascript\r\nwav.ds64 = {\r\n    \"chunkId\": \"\",\r\n    \"chunkSize\": 0,\r\n    \"riffSizeHigh\": 0,\r\n    \"riffSizeLow\": 0,\r\n    \"dataSizeHigh\": 0,\r\n    \"dataSizeLow\": 0,\r\n    \"originationTime\": 0,\r\n    \"sampleCountHigh\": 0,\r\n    \"sampleCountLow\": 0\r\n};\r\n```\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project adopt the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"c37d2501fba9a5251f9ec80a01b4ade530416625","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@7.0.0-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-0czazxO88+OEcixxmZhetwhYCYDz2ZGMPHExVuv7OZdIIES3++RMj9wiejycwVrvVwVK0bQOcD+4+kQ1NMbBDw==","shasum":"e0ac4d61be2252e51a2c3d9f7744145e2e21ef9f","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.0.tgz","fileCount":7,"unpackedSize":133989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIw8xCRA9TVsSAnZWagAAIc8P+wWWCFper2c8S2rcyKLS\nRvuIvVeoOpOZFkcvL3e5J28ervkv9AG8V1S9QzTxAkAdl4Ks2g38axdsiSbx\nYQI5UpwM7424mu4iVvbaFVSrlBAex2DgGrQtumutAOgGO6csfEOiqw0LKP6R\nLLpR2mWbb5EzgYjWYFcsoDE2QfjJNvBYXKmKRdu+xrC0qPga6uKHsUmnvT5p\nLEMxvZwMT9S7jYkosQgIueBm8jSOTIeazSwNfnXofhZIVWXWmoF4wWRC9kGQ\nnKEMzhFlyFqBjr4tDau3q2iyL0BGSXCHj4KVYkK8Vscl1kywVDHYmnDDFYhX\naVrP95Uh6EYq7rKJHBA8HtbaIayTm8kyIkGbwM7BI/tZO55Qz4DwDofR7To+\nEOe1eMRuE4UsIcRGb3obygpkKkRXW/qdz1NTHhfxdEAfVAKbeOhGnVcVzcn6\nwhGsj9WzerjK+Kx3qPjL5+VqC0bRGXMhdwD+WbW6Z/ilHVPK4/dLbl0xymDL\ny0OllXdbd0S05+Ey+5r1WhGILmEvygvsHe/j2rt5Scx/5K2XncwnhIMNrq6w\ncCDD1bsBTX+ckv5x7NeHeYtWxyUk9CgYFWpZHsy0/ytI7TuH7rvKZuHQ06+e\nfVJIB/UQyPnp5bi91jIfSLe7DMrgQW4059cwHCyJRS9Vd6xbdzn3XDcUTjqh\nu5dq\r\n=p7Uj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFYhQXQYyoizkZVsJF4f582PP58aw/sjK2CtDyK6wYj2AiA2kF7tI+r1lscHRGz/sFhzeeFsJS2RGHwFLoDXvf0gNA=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.0_1529024304507_0.8978480948012626"},"_hasShrinkwrap":false},"7.0.0-alpha.1":{"name":"wavefile","version":"7.0.0-alpha.1","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","bext","LIST","INFO","audio","read","write","create","browser","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","40-bit","48-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test-overflow":"nyc ./node_modules/mocha/bin/_mocha test/overflow.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20180610.0.0","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","webpack":"^3.8.1"},"dependencies":{"alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"10.0.0","imaadpcm":"2.0.0","riff-chunks":"6.0.0"},"main":"index.js","gitHead":"67b59a196912dfc110f5f35e3a1dcef3b7e37540","readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## Main methods\r\n\r\n### WaveFile.fromBuffer()\r\nLoad a .wav file from a byte buffer into a WaveFile object:\r\n```javascript\r\nwav.fromBuffer(buffer);\r\n```\r\n\r\nThis is the same as passing the buffer when creating the WaveFile object:\r\n```javascript\r\nlet wav = new WaveFile(buffer);\r\n```\r\n\r\n### WaveFile.fromScratch()\r\nCreate a wave file from scratch:\r\n```javascript\r\n// A mono, 44.1 kHz, 32-bit .wav file with just 4 samples:\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\n```\r\n\r\n### WaveFile.toBuffer()\r\nReturn a Uint8Array with the WaveFile object data. The buffer is a .wav file and can be written to disk:\r\n```javascript\r\nbuffer = wav.toBuffer();\r\n```\r\n\r\n### WaveFile.toDataURI()\r\nReturn a DataURI string with the WaveFile object data. The DataURI is a .wav file and can be played in browsers:\r\n```javascript\r\nwavDataURI = wav.toDataURI();\r\n```\r\n\r\n### WaveFile.setCuePoint()\r\nSet a cue point with a text label in the file. The point position is informed in milliseconds:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label\");\r\n```\r\n\r\n### WaveFile.deleteCuePoint()\r\nDelete a cue point. The cue point is identified by its order on the file (first point is 1):\r\n```javascript\r\n// remove the first cue point and its label\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\n### WaveFile.updateLabel()\r\nUpdate the label text of a cue point. The cue point is identified by its order on the file (first point is 1):\r\n```javascript\r\n// Update the label of the second cue point\r\nwav.updateLabel(2, \"updated label\");\r\n```\r\n\r\n### WaveFile.setTag()\r\nCreate (or overwrite) a RIFF tag in the file:\r\n```javascript\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\n### WaveFile.getTag()\r\nReturn the value of a existing RIFF tag:\r\n```javascript\r\nwav.getTag(\"ICMT\");\r\n```\r\n\r\n### WaveFile.deleteTag()\r\nRemove a tag from the file:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n## The properties\r\nThe WaveFile properties:\r\n```javascript\r\nlet wav = new WaveFile(fs.readFileSync(\"file.wav\"));\r\n\r\n// The container data\r\nconsole.log(wav.container); //\"RIFF\" or \"RIFX\"\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.format); // WAVE\r\n\r\n// \"bext\" chunk\r\nconsole.log(wav.bext);\r\n\r\n// \"fmt \" chunk\r\nconsole.log(wav.fmt.chunkId);\r\nconsole.log(wav.fmt.chunkSize);\r\nconsole.log(wav.fmt.audioFormat);\r\nconsole.log(wav.fmt.numChannels);\r\nconsole.log(wav.fmt.sampleRate);\r\nconsole.log(wav.fmt.byteRate);\r\nconsole.log(wav.fmt.blockAlign);\r\nconsole.log(wav.fmt.bitsPerSample);\r\n// \"fmt \" extension\r\nconsole.log(wav.fmt.cbSize);\r\nconsole.log(wav.fmt.validBitsPerSample);\r\nconsole.log(wav.fmt.dwChannelMask);\r\nconsole.log(wav.fmt.subformat);\r\n\r\n// \"fact\" chunk\r\nconsole.log(wav.fact.chunkId);\r\nconsole.log(wav.fact.chunkSize);\r\nconsole.log(wav.fact.dwSampleLength);\r\n\r\n// \"data\" chunk\r\nconsole.log(wav.data.chunkId);\r\nconsole.log(wav.data.chunkSize);\r\nconsole.log(wav.data.samples);\r\n\r\n// \"cue \" chunk\r\nconsole.log(wav.cue.chunkId);\r\nconsole.log(wav.cue.chunkSize);\r\nconsole.log(wav.cue.dwCuePoints);\r\nconsole.log(wav.cue.points);\r\n\r\n// \"smpl\" chunk\r\nconsole.log(wav.smpl.chunkId);\r\nconsole.log(wav.smpl.chunkSize);\r\nconsole.log(wav.smpl.dwManufacturer);\r\nconsole.log(wav.smpl.dwProduct);\r\nconsole.log(wav.smpl.dwSamplePeriod);\r\nconsole.log(wav.smpl.dwMIDIUnityNote);\r\nconsole.log(wav.smpl.dwMIDIPitchFraction);\r\nconsole.log(wav.smpl.dwSMPTEFormat);\r\nconsole.log(wav.smpl.dwSMPTEOffset);\r\nconsole.log(wav.smpl.dwNumSampleLoops);\r\nconsole.log(wav.smpl.dwSamplerData);\r\nconsole.log(wav.smpl.loops);\r\n\r\n// \"LIST\" chunk\r\nconsole.log(wav.LIST);\r\n```\r\n\r\n### BWF data\r\nBWF data (\"bext\" chunk) is stored in the *bext* property.\r\n```javascript\r\nWaveFile.bext = {\r\n    \"chunkId\": \"\",\r\n    \"chunkSize\": 0,\r\n    \"description\": \"\",\r\n    \"originator\": \"\",\r\n    \"originatorReference\": \"\",\r\n    \"originationDate\": \"\",\r\n    \"originationTime\": \"\",\r\n    \"timeReference\": [0, 0],\r\n    \"version\": 0,\r\n    \"UMID\": \"\",\r\n    \"loudnessValue\": 0,\r\n    \"loudnessRange\": 0,\r\n    \"maxTruePeakLevel\": 0,\r\n    \"maxMomentaryLoudness\": 0,\r\n    \"maxShortTermLoudness\": 0,\r\n    \"reserved\": \"\",\r\n    \"codingHistory\": \"\"\r\n};\r\n```\r\n\r\n### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### ds64 chunk\r\n**wavefile** have limited support of RF64 files. Changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n\"ds64\" data is stored as follows:\r\n```javascript\r\nwav.ds64 = {\r\n    \"chunkId\": \"\",\r\n    \"chunkSize\": 0,\r\n    \"riffSizeHigh\": 0,\r\n    \"riffSizeLow\": 0,\r\n    \"dataSizeHigh\": 0,\r\n    \"dataSizeLow\": 0,\r\n    \"originationTime\": 0,\r\n    \"sampleCountHigh\": 0,\r\n    \"sampleCountLow\": 0\r\n};\r\n```\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project adopt the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/rochars/wavefile/issues"},"_id":"wavefile@7.0.0-alpha.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-U0uv4Yo0tcHW+HQ61VqMI8bL8mjgZRxYzYf7lTrHv84jDfn8DRN3EY5ORhkA7i59HOzxCdh43Eci1gMkBWWyVw==","shasum":"2ed6215332e2426a2388cbdeb9388416e3065df9","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.1.tgz","fileCount":8,"unpackedSize":275372,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJy3zCRA9TVsSAnZWagAA09UP/jfkKSv+Moo+AWm9Fguy\n4vbm7mCna9AxGZik8F58800OLd1Vn7sI/87eZabvNNO5NJbg+OYStVwnxkIQ\nPl0FdebckK3m7lQsT+pLGUgo7zv9JGBU+/6Z0HwEQFvLfvK9taUus+Or5oO4\n+hKM2bhkSJkeD5bAmBaQJCFMpYrkExYfQ5k/vy3UPBtHTpJ7QOtn3e2hHtYl\njsc4kS5ec1F7rBQoAAbdFy/CZD1CmSp9Sm/w5L7zNokMd/Oxeo2qWK507ETy\nzS7xMRKlDN8xB5MQ//ZUcTFcYGhdjOVBtR7O4oZlbS0nYoLFHup1cSDitovn\nPJSnA3wggmEkE0xelrRBx5jxORpSBPOHYn4FwgHncNGSOGpJMXg8UhvGCuWH\ncRZ2TPBFqvzZxKU0Px5V2/NmX1b710Ovv7bQbnnVj6iYCrLrn6KDvJUD06aM\nquwkzmvO3siQ6u+S50qfwYCy3c0cPdtdcnii1oeCqezORqvD/xTSANTdDzWo\nSRdDLIcjo82BIHkRPaoFmgo7WJFiSDNZHRw9HfH59Lftz/wgtmmMvTKUvgt3\nD44JzjgFqAHXQuB5FYGtBCBfcQh6Oey1x3ukIKe98N7u7GXj+fCwlfillh4Q\nP3tKPwDTZTPvgP8TDEIFli+89ZnkNsdo6FlAg0DjC/q5YnbLpC3bNqlMId49\nplFO\r\n=Fhg0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGXSXHTYNz+cfU1oY+LJ5GMQGVOR92cMCUg9OExZj/LQAiB9PQhDzqFfgI+oe1RRtbscjCtDjLmuIrZgM3Q1Wv1+yg=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.1_1529294323172_0.8562013305998974"},"_hasShrinkwrap":false},"7.0.0-alpha.2":{"name":"wavefile","version":"7.0.0-alpha.2","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"index.js","unpkg":"./dist/wavefile.js","jsdelivr":"./dist/wavefile.js","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test-overflow":"nyc ./node_modules/mocha/bin/_mocha test/overflow.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","test-dist-min":"nyc ./node_modules/mocha/bin/_mocha test --dist-min --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist && npm run test-dist-min","pack-min":"webpack && npm run test-dist-min","build":"npm run lint && npm test && npm run pack && npm run doc"},"devDependencies":{"@babel/core":"^7.0.0-beta.51","@babel/preset-env":"^7.0.0-beta.51","babel-loader":"^8.0.0-beta.3","browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20180610.0.0","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"10.0.0","imaadpcm":"2.0.0","riff-chunks":"6.0.0"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7/dist/wavefile.min.js\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"6ba9d689323b403542d27fb01e704dc38895cf71","_id":"wavefile@7.0.0-alpha.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-HRkQqgimTFa/Q515oF92Egv0HpA/Xqgo227XZtYAsFsaWh0GpVdMgUy6+Hw7bmGAHf8qmnuE0vu3qeUm5SUI9w==","shasum":"45b1804a3f15c2a7a1c7df6543a178ef34585efb","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.2.tgz","fileCount":8,"unpackedSize":283584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ4v7CRA9TVsSAnZWagAAv/QP/A/bWL/1GlGhaxVsJeRO\nG8Xq3dvqDAo93Fg7xgXgSBKtwe+THI+uKruCZh1Mch1aVyx4vqvp/yjXXMXP\nurvjKO17q3UZSCOVBrZBmfxf4CD4sPh4EIE4x7kHU4vndDgP3TzF3oVR++7K\n5Hc1qzKNDZTFlXhm8ZZvPW8HjywOlr0NStXUZghfNY+TFU4YOWVf3ane2rOx\n8imdB2/MpsOcaDiVxF5sf790GxwrjS2uoOv2RikazTJHveRUYrx7QAz8gOts\nHZy9OdUMyx50F1xe0jtWxuJE882q6IxdR2K0710zubu+v54p+pUJu/RbR6Tj\nEnw8ytGKqh8H/mtljKyvNOc0qgn6Bgk0QylSrvudqE8pjM27+3N2hF42ekfS\nPyhrz8BarYjudy4FcXCHt5azfTM8QnYg0a6eztGX3fS/JNyGwfhTZ/1imk52\nWl3JC7eG1MahSuDs94XKJ3c3U/2SGogj0zlokCRzUJaDY/NJHoNIrWRjx3pw\nMsFZL+fr9EmE16Rt3GGJHJZQjDGNZ6aZDfGvVV0jnG1iv3VLMPjvUQ6bc9zH\nYKtJc6K4Oikxnyx6pC06Fpk9TtFjtPsER33Dqqu8NG+v13q+vuHshjfVw5Xr\nw/Wvc9hsJONv1Sx6m/Ddoxg0IcZ1lweEWtp2hOkwmUw3RFE5uQDXI5i4zOtw\n38yc\r\n=CE37\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC6OMyVvSFxOGfg3A/wspzb/kUlf4IwCbU13vw5TDxr2AiBR6vvkAgVBNdUs5rrG8NkdrRqIRGBy7bUxE+Dqaa93Ag=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.2_1529318395052_0.9506123189813598"},"_hasShrinkwrap":false},"7.0.0-alpha.3":{"name":"wavefile","version":"7.0.0-alpha.3","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.min.js","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test-overflow":"nyc ./node_modules/mocha/bin/_mocha test/overflow.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","test-dist-min":"nyc ./node_modules/mocha/bin/_mocha test --dist-min --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist && npm run test-dist-min","pack-min":"webpack && npm run test-dist-min","build":"npm run lint && npm test && npm run pack && npm run doc"},"devDependencies":{"@babel/core":"^7.0.0-beta.51","@babel/preset-env":"^7.0.0-beta.51","babel-loader":"^8.0.0-beta.3","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20180610.0.0","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","webpack":"^3.12.0","uglifyjs-webpack-plugin":"^1.2.5","alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"10.0.0","imaadpcm":"2.0.0","riff-chunks":"6.0.0"},"dependencies":{},"gitHead":"6ba9d689323b403542d27fb01e704dc38895cf71","readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7/dist/wavefile.min.js\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","_id":"wavefile@7.0.0-alpha.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-VyYXJupZo3AC4BKq9Yxgb16LdGiQ4RKCSTmCJSE2dQv93IRNSBXXOV2RDRbIHE7cEUfl3p9hVvSPwWRG/lP55g==","shasum":"62ff3d1bda5d6ea887a0410030689314178e3d54","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.3.tgz","fileCount":7,"unpackedSize":208519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ6l5CRA9TVsSAnZWagAAzWwP+wfUoq1f6bOIWS9alf16\ngaFU6/3ab/G54ODDOTd7JdFacfGNgsqWIq/caQay5Ure3zSx46sjOnQYj00Y\neaz9qeTF7W2iEROmgw/lqV3V6QFsuJFGVMK8gOI3Wz7tzUsauIN4PQRr1Whv\nNnHzsM6jS8FDGxxhduK3VpD9H8pOZbuFd6q8jZTzEej40WAG70lTkBs1oIHJ\nj3j6Xf2hVZanhYkHbvt1VqLQomolf928kQJ/pPzKEMPn8f0c60QaWLH7aIRo\nxxMPzWMvKYx+dGh7LGxyjDrmtE1N5zlBhFLdh+kSNTEDpwWJwdTRTNS5BOae\n/ybcW6BYuHxOjfcKuif2gXNidHNtgM9fc+k2ybVY8ILnGYOt+ggWCqFa77HJ\n5T/0pgXUMSVHb4mjLf3eBX5uvMYhMQ5ldTCscN0Tyqx8Ip54Iih3R/JB7ldH\nxiIvcguWn/Wp5l5lYniJuvVt6A75426H9IvGjSHJRPWDTj7Bqt04GxFh7ZOa\nPbLg5xyBPJ0r3WDuhEiy8Qve+V9+IGt0OPVVrCRxfiSVIKPYNyEBUW7BeVUH\ncIG236qLbTvCmpxs0Dn+shkAwyx6fOpDnHfIrWE1X2PppfVG5CJMJR5H7byd\n1TNAeIgQi8G1mLvKEN/RYObuYZVBIgpQky0ujN/8TBSzRtjIKVAyuFQEpnYD\n+Yv4\r\n=G1yf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpGz0z4yXMOAnpdJ89HhkoJb8IQpXsdgNm3DVCBO/CUgIhAIxBhIrBQq42FrVHqKD1lFMMTlt/yy3Ci/0A2xlF3PO7"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.3_1529325944715_0.06286246874250168"},"_hasShrinkwrap":false},"7.0.0-alpha.4":{"name":"wavefile","version":"7.0.0-alpha.4","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.min.js","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test-overflow":"nyc ./node_modules/mocha/bin/_mocha test/overflow.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","test-dist-min":"nyc ./node_modules/mocha/bin/_mocha test --dist-min --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist && npm run test-dist-min","pack-min":"webpack && npm run test-dist-min","build":"npm run lint && npm test && npm run pack && npm run doc"},"devDependencies":{"@babel/core":"^7.0.0-beta.51","@babel/preset-env":"^7.0.0-beta.51","babel-loader":"^8.0.0-beta.3","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20180610.0.0","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","webpack":"^3.12.0","uglifyjs-webpack-plugin":"^1.2.5","alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"10.0.0","imaadpcm":"2.0.0","riff-chunks":"6.0.0"},"dependencies":{},"gitHead":"6ba9d689323b403542d27fb01e704dc38895cf71","readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7/dist/wavefile.min.js\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","_id":"wavefile@7.0.0-alpha.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-FIOQcuTbvMcJm1tyrGSI78AxocsjmYHUEullLpf3N+yTpVfD3Ksu1KnddyJeeaYp0YL3yROWeFlURyKF66CKvA==","shasum":"b82fa2de8b42617b89bee82c933d3cd02ad2e0fa","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.4.tgz","fileCount":7,"unpackedSize":208519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ6orCRA9TVsSAnZWagAAeQAP/j5P7w5YWJiKNj4OnZ/i\nf/v+efR7Uk2N18qY/4ub85/X/e2J9FFcPELaxQbEctLMiu7DDaic6EYdHeML\npACVRjL1TNqs3oTcHOoqcYOm62IiXqwDDNbUFRyJsS9EJP5S21qN0pOBdaxp\nDhcinbOsEk5PlPkkV02AlXGEHOkA8M6ayr9OijL6AoW1ZPaawusWGJAWGNOM\nwH4bp13s1gykn821ef6FFM+esQBqXq+ZPgLwhzK4x3WqGC4QNlsbPkDxkKtS\niwzTnPj24no/XbDISHAZj9NjC6sxrS49guBRXD6Xg/ULj2aqFRRrrIpimYBT\nG8bVzDI09QO2/lDrClXDgD0NSnLQHb78MYfy9kvxNg9ZI+b01w6iO+/2ame2\nOxCmxymeCtSBje7Vt7ie4dGtcumPQmh2QLhsisHKEvuWruzNX92o0UsveqBU\nieRldA10TtnHFilKr0eyGlunYX9LsIsAnsIt1rM9frLDBQIJU/bvac2YaSP5\nLdxCZCLygvuTEy1PeoZIaPdJ8FdzmbLVGzAu3h9CqHqPtRwUIYVeuYxy+lb5\ndMfexc+VMxjAfFDFurzl2wH3GyzILmtINWO1ug0Eg3LHvJz52eM4c10SFQQW\nHHcLHiPh4zpLBaeYQISctUkYNceij5xWEEo9EbPhNrzsIkEoJtWg6OalvJu6\ngV11\r\n=uFFs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHB9uOs8qjFVPY3bP0ktUVYld2pSfdfv28ZdVASDC4AqAiEAunZcCIunCIbY98zy+eXros//4HUIssREr2rmXGQrF/A="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.4_1529326123441_0.33153892660265627"},"_hasShrinkwrap":false},"7.0.0-alpha.5":{"name":"wavefile","version":"7.0.0-alpha.5","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.min.js","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-list":"nyc ./node_modules/mocha/bin/_mocha test/list --src --recursive","test-afsp":"nyc ./node_modules/mocha/bin/_mocha test/list/afsp.js --src --recursive","test-adtl":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-adtl.js --src --recursive","test-info":"nyc ./node_modules/mocha/bin/_mocha test/list/read-list-info.js --src --recursive","test-cue":"nyc ./node_modules/mocha/bin/_mocha test/cue --src --recursive","test-overflow":"nyc ./node_modules/mocha/bin/_mocha test/overflow.js --src --recursive","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","test-dist-min":"nyc ./node_modules/mocha/bin/_mocha test --dist-min --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-dist && npm run test-dist-min","pack-min":"webpack && npm run test-dist-min","build":"npm run lint && npm test && npm run pack && npm run doc"},"devDependencies":{"@babel/core":"^7.0.0-beta.51","@babel/preset-env":"^7.0.0-beta.51","babel-loader":"^8.0.0-beta.3","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20180610.0.0","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","webpack":"^3.12.0","uglifyjs-webpack-plugin":"^1.2.5","alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"10.0.0","imaadpcm":"2.0.0","riff-chunks":"6.0.0"},"dependencies":{},"gitHead":"6ba9d689323b403542d27fb01e704dc38895cf71","readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7/dist/wavefile.min.js\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","_id":"wavefile@7.0.0-alpha.5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-s1DpK+OzYugKq98vQuBRcc6YpmkRFIseUuub1yFYoZhBgO3D/iX2n293XOA21LcIWKUCFivXyo3TiDNRIuKCTA==","shasum":"ff0be52898de8f778ad93100a626264e5e219c8a","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.5.tgz","fileCount":6,"unpackedSize":68407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ6qKCRA9TVsSAnZWagAACqIP/RvdppLsCyMjpiAOGbtj\nhKfEnC4iXNumSXOFESYMfnKV4M3Aj2drdZriTIfUUYlrsGqdL3Y9Hzo5HbG+\nmn+RsOffG4P8UnHdoJXILWhFiBY2P13qXQb9il/pxCWefGYaa9L3d26GDLyP\nhAOCPlw+gtqLtiEzGH+e3MGVabBEhtUfzALCiwsqZVz2KXQJH6rJHhTV8kZl\nx2iLwAoRITbSaBXIqFCzBdxuDZGRp0BfdqHAxZOmHM4YspaXC/SACj5mPO7j\n+FMWDBxMJje5zs9zcKLyQBArSFXIPpRs+hKbD1lVh1ShCAKKX6gTpY60DaBe\n6rjHwsp1VdMrFSFAlxPyNK7MuDzarajkaPonrQjql6UQqx9T7lu74NFajqHZ\nE9qfijTFgwdLFHvxVl7QybGuLnLkKP6MroKbY+PguMXyL/kZDLsauwt9AGvC\nuyJCs/fJpunNJqKiOB4BcDdfml0P8kSWMZxnDS5gXQYLRVs/uKWbwR7nguPt\nOkFBOBq9vQ97d8h0kMNPXHOonvFoTcsqm/uSgGV3KtHNDlUK+MKQ9pJoTuip\n1ZZYgs/WwAE7kBqWvHQTxHJlAYDxbgF9kbH7IjZOqKZKnE05oieJf544WmKx\nVTEeZUL7Bx6h0r+lBQGIHE4aXoJRePYJM/x3N1n9qdOKeXz1GsB2hhRGbgUp\nKX+3\r\n=V1iX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0ETSleY+eVcnEKgpjosTuCGKfYczd5O7eRP7H3QpERwIgaXEXFY0/4IAucRAlsm7TdVuaogp7o51VCV20K37JcMY="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.5_1529326218204_0.7417508827329495"},"_hasShrinkwrap":false},"7.0.0-alpha.6":{"name":"wavefile","version":"7.0.0-alpha.6","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"index.js","module":"./dist/wavefile.js","unpkg":"./dist/wavefile.min.js","jsdelivr":"./dist/wavefile.min.js","keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-dist":"nyc ./node_modules/mocha/bin/_mocha test --dist --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && uglifyjs dist/wavefile.js -m -o dist/wavefile.min.js && npm run test-dist","build":"npm run lint && npm test && npm run pack && npm run doc"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20180610.0.0","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","uglify-js":"^3.4.0","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"10.0.0","imaadpcm":"2.0.0","riff-chunks":"6.0.0"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7/dist/wavefile.min.js\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"6ba9d689323b403542d27fb01e704dc38895cf71","_id":"wavefile@7.0.0-alpha.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-RpRU9K7BoirlYzmw3l6MMENbabYN5z0FxlPk1VWAxVEBcWw7N5TmeKJgljAFgRD+0nFdNtmTDwiOMsSRYmtlBg==","shasum":"851aeef6d64ff5d5285e6aea8e63c6bf923124ae","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.6.tgz","fileCount":8,"unpackedSize":200850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ8fWCRA9TVsSAnZWagAAaUkP/it4tCFczpJmbbJ4pu8V\nIBfQ0ZRP/JYyS8xMBRbaCU6OWHInFS3lBHmp/KTVwjIq/CLH6JYnXtEjFkEX\n8YrpY6JKS6dDC3iIS1MT8fI3t4gW2am8NPlNDP9ok36WcKDoRhUXywys7ZKs\nExFIcefkkmA+xZz4V6gY6spvgZXiNgh6cvdLPQJ4FcF2TTLEx+7vUdb2clIk\nBRh7hxrO8V8VwwaAjksqhHKaEYBLXXftbR+UIWW7ohrI6hQPsWehFYlwk6Hu\nfHj19v5eb+8KQuLdYVvsgYdrcMVXGC6ht8kXcOlQdu0GGThuFLg2bhq4bkA/\ng6iAbaB74B2ql2d8ht2TioSg1bfh9oMJh00AIoVa0PXBmaJtrKP0syyGNe2c\nkaen0B3ku2fZGxyv621hOUhAv/Tb9VgSNMrB/1uC5OBXmfnZRLNRQ757RQ8z\nwXxYhYTHmhHMF2etKLUHV+KQ/mzRRXWgjCNhzcjODd7hmIQhc1PjyWExNmU2\nohFcPAenyCpP72XiEgd05PViwQXeLuQrOK9fI6oaZuZmYqXvluy6EVvUwYfK\n2zb94LZ0rC0RrkeK8y/b6nLlRvpCwgCZTBBwIJkRma5cZFfavCiKdFy+qBRq\ncvJW5TbhRBkGXTv0uomhqpQnW+dZdHPrE3o+XjQAoZpAzpuUQ8JY6d1A8P00\nUlk0\r\n=5dJ/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/x0jONNcjPyw0ZvZJVsLFta6vw8luurpENtep7Ep0OwIgOsxpCMcUTWFGyHllIPB0CdN/aBvjNHhGu2fu/CoY7es="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.6_1529333717967_0.813984111271707"},"_hasShrinkwrap":false},"7.0.0-alpha.7":{"name":"wavefile","version":"7.0.0-alpha.7","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.umd.js","browser":{"./dist/wavefile.umd.js":"./dist/wavefile.min.js"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc ./node_modules/mocha/bin/_mocha test --src --recursive","test-umd":"nyc ./node_modules/mocha/bin/_mocha test --umd --recursive","test-browser":"nyc ./node_modules/mocha/bin/_mocha test --browser --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"webpack && npm run test-umd && npm run test-browser","build":"npm run lint && npm test && npm run pack && npm run doc","build-ci":"npm run lint && npm run pack && npm run doc && npm test"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","google-closure-compiler-js":"^20180610.0.0","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"10.0.0","imaadpcm":"2.0.0","riff-chunks":"6.0.0"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"a643c16e0fa2120c3a16cc4ecdd999f121e94306","_id":"wavefile@7.0.0-alpha.7","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-oqtENpba60BXKVcRtmz8AcVvi6WhXoSaHmev5EDCMPn1qg+QTdwSH/FeNDj4cGBZ1xeL5Wl/WDZqxvDBWbzQ2g==","shasum":"d545c593ad7aa1f326a7ccb36f2fbe8a5c60caa9","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.7.tgz","fileCount":8,"unpackedSize":214701,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKJfUCRA9TVsSAnZWagAACKoP/j6mrlDJZ4PBiRtlvLm9\ntUCVTwLbYUf7sZnCSz9TKBoKMlDKursn30NSX5c7apigu+HZrsdec7n8Caft\nR53k3d8+h8+cQM8ikq5rctdtiDMUNcdDrkmjMxeXLB8YLCVHdwgRPVsCOYte\nz3tTLFsF2gQeHq69zVCFFFqT1UywHStiuw+fJfZQPmoOYYwbuqmGSoYog6Ip\nb0yFfStqrijlytLc63Ca4r+4AyQAU1OfAO3Y0sI7TVFHRkp4FqJRsxzhP/Lo\nHU20IfeLe3kmTLseOR9Oo9fcAGTigJSlYAoI7n302BJsgOh8kp9j6zIRUNmg\nfYksYZo4tugMERFmS3shpLQDuSTG6UY+WRlxVjp3QS8LhIkGV8gf1MB+SWdE\naFY7ZjOObNR+FAKHXI7CeuR5iu0Alf2ug10gDdqX92jrfKAdj8SrIw8yvDRD\nXLtaRA27ThD+AG28D+3PyEBtxhWnYc2HanerwtxD5kfaS418Z26vYry/F3Qm\nxufkVTi/gZzxCDycl6LmsjrjP1PPfJ5h5KpUmulSbQv4Nt4Ke+OBTDTw+nh/\n8PE3lRQImja6LaSUNkSQHSpts+RqAzO8IKetrq4TvJRyhifztXH16luETxo6\nE4HHhvlqR9j0FMF9DG/8miBHgFjoVLQhvuTCuJoBqykAGczNyIS+HItZdvAj\niO0h\r\n=8nLS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICu3U+q1Fb6M99hvqOh3BBdnseOA2xGcN0FtUA6RAMrxAiBtWRh9SUGtnMaYV4XiMKaWSvCgUPfCvKxdpOkjKDTSsg=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.7_1529386964190_0.9360971233433109"},"_hasShrinkwrap":false},"7.0.0-alpha.8":{"name":"wavefile","version":"7.0.0-alpha.8","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./main.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=7"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test":"node -r esm ./node_modules/mocha/bin/_mocha test --recursive","test-min":"nyc ./node_modules/mocha/bin/_mocha test --min --recursive","test-cjs":"nyc ./node_modules/mocha/bin/_mocha test --cjs --recursive","test-umd":"nyc ./node_modules/mocha/bin/_mocha test --umd --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"npm test && webpack && npm run test-min && npm run test-cjs && npm run test-umd","build":"npm run lint && npm run pack && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","webpack":"^3.8.0"},"dependencies":{"alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"10.1.0-alpha.1","imaadpcm":"2.0.0","riff-chunks":"6.1.0-alpha.0"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"a643c16e0fa2120c3a16cc4ecdd999f121e94306","_id":"wavefile@7.0.0-alpha.8","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-fv60CNYQgJA9AjtRjHhNICzKYWv/a/Z89EOasDzlqElcX+It5vnFsg2EgihAaGgUVEP1W/m2T3ZoEF+cMzOy4w==","shasum":"7761aa11cf117bdcadbcc2f579ea93eeb5931ef8","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.8.tgz","fileCount":9,"unpackedSize":374954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKtePCRA9TVsSAnZWagAApQgP/3P8lLQtoXkSeutuVl+m\nT/0y8REiJBCiIRCjPAyVMdgXyCBTq6Jne12Fja7cfNsQ46KYxvLNUIzcHQE0\nNZHA/8wOHdS8mQM5/1vsNpjeGezYKBIFxkChGJrYHKvANF78jmwnXcXQG0rb\ntJSh8PpsjobNumITlHWlJEIwLXLr8hi1emnOhO2qkmdI8ZtfVp9cAwLA3Thi\nE+QBv8KLwV/L7xo2ofj+8aY5u1Ux5zzBhzQRtHb9evjMFnVK5kNyLs5c1B5J\nA9c7QW3PRJBUUWgg1cDBn4P3u/3GZAEf511dX6eZLndRfhOJrsCY9O/bpa/o\ng2wVEubC/tupqv77FP9zcJk1Pt9ThH4cPeGFcN2V3TKIxBfB/kkukN959U8W\nQItBJ0KOQ7kEiBUCulG7cQ9em9p45AtrYIhfDwkyGNIrICpSufUgd1Sadxoq\nxwLihs59Oa4+Q/ocerrO/1tdpLUjOSqwAlr1aJSfyql46Pl8AVi490QaXFHG\nYRganNtvPm2XNMRXiYD0V7ElMtQUfVLmQY8r88JKzskrdUJWD2L0fJuI1JBq\nintP/whLPVIMYkVcDM5ijFkKKFoGaHLEBDpU9C8Ng3KRdA8DLnvoxuoG3NpU\napVPDm9Nesfoeqjuz4lEvxghc0A2+ULqrfE13XbpIuh+0oqG1DQ6jn0CqNjH\nNziB\r\n=NnmX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAyomLDg1jz8wFBNC27g8rSf5LdLOjfKQDfxNPeSAXuCAiEA4CQnK7Nc+Fww0L9L9lMdIY612VOpmSq1U6+P8e5AIXM="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.8_1529534350061_0.30629513343209847"},"_hasShrinkwrap":false},"7.0.0-alpha.9":{"name":"wavefile","version":"7.0.0-alpha.9","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test":"node -r esm ./node_modules/mocha/bin/_mocha test --recursive","test-min":"nyc ./node_modules/mocha/bin/_mocha test --min --recursive","test-cjs":"nyc ./node_modules/mocha/bin/_mocha test --cjs --recursive","test-umd":"nyc ./node_modules/mocha/bin/_mocha test --umd --recursive","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","pack":"npm test && webpack && npm run test-min && npm run test-cjs && npm run test-umd","build":"npm run lint && npm run pack && npm run doc"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.0","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"~3.5.5","jshint":"^2.9.5","mocha":"^3.5.3","mocha-lcov-reporter":"^1.3.0","nyc":"^3.2.2","webpack":"^3.8.0"},"dependencies":{"alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"10.1.0-alpha.1","imaadpcm":"2.0.0","riff-chunks":"6.1.0-alpha.0"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"b16e14b1009a0a0cd475942fdbb2ce03cab3177b","_id":"wavefile@7.0.0-alpha.9","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-uaYsEJF2TK+esf6faboGZJw1Mb48OCAuXkLk2A1olNk4t6cTg007eap1+Q2M+/R4dYzNaGm0jlrq8aANLI6P0Q==","shasum":"eedd92703b6a6625305e3d7d42daec1fc572d414","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.9.tgz","fileCount":9,"unpackedSize":375169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKuFqCRA9TVsSAnZWagAATQMP/3Je0bPAby1uXp1thESo\nGpxUelNw08otgH58jzsEToUFyzfVH2XIImzheUwSv5wEKt+l15rhWGgvGZn2\nzCqJM5k1ClNAwOHBBdyPWh1P/CVeEk73AsT6x+U42cBY2BjDOsQulOa/sUcU\n+UIqG3dJyrlndKmhRh2v3u8JZLoi+J8UI/szog/MYtqFvWrqegpe/C9rk7dC\nfRA9EREEF8h4eeJ+08Q8fG0RlNTyHuKL2iE3N99PJIvq5XNO3PsOK7aEApDO\nIeMGUQJrofU2WI0c4VrxrzYvTlu8LAwluQSwrb4cnegaer4GACrPbeoJidkG\n2SJy3eZvNV2pBlvEGcQt5XeNSREeCks95PinSurApcxj0hzRoPqqwVqiQF5b\nqimra1Q7Dr8fi6BAeI3HGWJQdB0zQ4sVQ6aDD/4tiB1k+SvXMJENbf2PfVSJ\nyc2POgx9i0NYl7SwILulUc5m8V5DU2BcyK83whX1hGFg+i+TvzuZXOE3Qgie\n7Nek3rB2HZ7JQay9tbNIHXCVQPSOHW9Xbs6WJ8WmlE3nY4FOPh/X/3kZ5gAO\nBaEtLLlydXgRu6+7+NxvAvAWQ1DPKTjlumgPHZVlmNKC8CTF9mF79ephn7cv\nT0Jx1mFeiBtARGxoLdXQ1XDNRvlwutj9IwKRs3uxgs049uf5m4vgzAHqVH5u\nuYcG\r\n=tHRf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4Q8AEi+YfW/N4dbHbqLpxydROP0/M7D8tip2QNjy3NwIhAK4Ia60dNxgbkBiYInBq9nMGi8rPAVXuAmxoY9lQW0v4"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.9_1529536874128_0.35191063557650626"},"_hasShrinkwrap":false},"7.0.0-alpha.10":{"name":"wavefile","version":"7.0.0-alpha.10","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R min","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R min","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R min","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R min","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd","pack":"webpack && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"3.0.0","base64-arraybuffer":"0.1.5","bitdepth":"4.0.0","byte-data":"11.0.0","imaadpcm":"2.0.0","riff-chunks":"^7.0.0"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is implemented as a ES6 module and also distributed as a CommonJS module, UMD module and a compiled script for browsers. If your system does not pick one automatically for you, you can pick one in the **dist/** folder.\r\n- The CommonJS is the one used by Node. It is served in the \"main\" field of this library's package.json\r\n- The UMD module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The compiled dist is browser-only and should be the one served by CDNs.\r\n- The \"module\" field points to \"./index.js\" and should be the default entry point.\r\n\r\nIf you are using a module bundler to compile a module that depends on this library you might need to specify what is the correct entry point as some bundlers will assume \"browser\". In general, you should point to \"module\".\r\n\r\n### webpack example:\r\n```javascript\r\nmodule.exports = {\r\n  entry: './index.js',\r\n  resolve: {\r\n    // tells webpack to use 'module' or 'main'\r\n    // not 'browser'\r\n    mainFields: ['module', 'main']\r\n  },\r\n  ...\r\n};\r\n```\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"0be9a503b06a0f04a922c6786788d79a3d6a643d","_id":"wavefile@7.0.0-alpha.10","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-9tNaMOM8IwVLX5QsTa2TQcGk97UolcnB2SfjC7N9N3rd7KUQC6iEAGxtP3QZwSyHmKhlkGHz5CDg3ah5WzGAaw==","shasum":"317d566377ec47a39a99d680895614634c9888b0","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.10.tgz","fileCount":9,"unpackedSize":358983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLLz8CRA9TVsSAnZWagAAQ4IP/3+9248y68rkoYKkMeSd\nibFk96fjB878jHAvU8qdM1oUZ+GLZAItdLrAd8M6t7hNTanzGcnEgsravRGX\nZKgXOb+GBio9fqrjV6ZCxnEKElmK/RHOBaCrxJySzdd6O01Rr8DUaI/bpJo3\nPc0tVQkwUVSQoCDzI6/GxlWi6F4S1lwyiJ+Sr65obf+Oy6VuQrhp1j9qZEDT\npdG7cTFaH7eqG/sKl+3o2j4nJ4VbASSvnx4IczPN28IeRig9//hgN3vCPzfp\noc9SM7e9Zau78o42XSAcZ9GQI7uxwXBhEWXfJLthMVMHt3yo3LMYNioXSdsD\niEF37HB5Zbxlv3NpvCb4DZNKQNr9b+bGTOWfqzfHC0r5xfUgG7esT7v9iML1\nYhpchuS3Ip1AOcsjtazf6uoEwC5zLMvnA6zg0b1nJx/J6zaYFj8yQdUoMtrH\ncd7JF9GuanSyC+ixvmJ0bsbL+QdurwN/T/b7cy71wd47S8D80KtBFiTOCKGU\ngfmSGdMIOdHgIv3nMOpdj56YCRvh8JDsa2gWgtaMml0RO92oCr3G2sZ0tqhW\nNt7O/POUtxHft0ScOHyKux+D/gRvRbzVcDviBTr1WHt8UtpZTvq37LapYi8F\n14VRXdKkOVpd3ceq6dHyYExTtxZcFVvN/X0r7dFDZLRtsI5VCo62Oysn0u9i\ntGII\r\n=2dZ9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGYkTuIHdeoKDSUjzaZYl3WC9Use+CsFZd+RPB1FmvM8AiBwNxb9/NhcCBLizvgUPxTEYd56At1//GmH1bAFi7wjow=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.10_1529658620553_0.416215172852326"},"_hasShrinkwrap":false},"7.0.0-alpha.11":{"name":"wavefile","version":"7.0.0-alpha.11","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R min","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R min","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R min","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R min","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd","pack":"webpack && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"4.0.0","base64-arraybuffer":"0.1.5","bitdepth":"5.0.0","byte-data":"11.0.0","imaadpcm":"3.0.0","riff-chunks":"7.0.0"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is implemented as a ES6 module and also distributed as a CommonJS module, UMD module and a compiled script for browsers. If your system does not pick one automatically for you, you can pick one in the **dist/** folder.\r\n- The CommonJS is the one used by Node. It is served in the \"main\" field of this library's package.json\r\n- The UMD module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The compiled dist is browser-only and should be the one served by CDNs.\r\n- The \"module\" field points to \"./index.js\" and should be the default entry point.\r\n\r\nIf you are using a module bundler to compile a module that depends on this library you might need to specify what is the correct entry point as some bundlers will assume \"browser\". In general, you should point to \"module\".\r\n\r\n### webpack example:\r\n```javascript\r\nmodule.exports = {\r\n  entry: './index.js',\r\n  resolve: {\r\n    // tells webpack to use 'module' or 'main'\r\n    // not 'browser'\r\n    mainFields: ['module', 'main']\r\n  },\r\n  ...\r\n};\r\n```\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"19f57fe6e9e98c1c3737870001766740917ccfdf","_id":"wavefile@7.0.0-alpha.11","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-KGtAtEJYmEzSbfwlkYz4OFQUCUgGeZq52oT90d23MIu+1jNPwcDPFhDUM6AYLdHft0m3mb4miz8Rohr8XlI6CQ==","shasum":"cb20332324e1abd55e3d75acee37d679f9d88820","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.11.tgz","fileCount":9,"unpackedSize":359476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLVOuCRA9TVsSAnZWagAAgDoP/0O35VHzJeOX3+cQcS7V\nigHORgLDP+xcgcpbHXrj3Anc+cNzYZw8QZ4HMCCMO7bNin0QqXMAnsWBxTtB\ndd2yjCy96IJYszYvgn2adzxLKvMA5o3w91P8io2H/51n2aaFJflzDXkOoZNk\n0ihtSADIXhsGUsp1ZncuXd2/GWypjEq6Uz579I8Gm6Fh47lluXCUDYhWzJbb\n1IuDUvuOZaggRqngHSlLqKCsCez0MV3LmIMHxHI34YuK8PPokLyf2m0HfXec\nBsjKRKAFZMmEcVIMOTMrlJhs8Zu6CyIlahTcVmJif6YTbc7Z6Zv9X4jHKfP3\nnTTH7vGZX9RoG7YbyHyYYo/pvPzNaW/pzPTE7eLuZJncU2YnwLAmoXCs1p4q\nrelLqhz7JFCNefGEMtO1GZ0MT1Kjys1IvrboVZ/dpKeikxH8K4gTdiPq1/Pb\nI8W9oHKMcG+5nnAMJFHuXzYa2hf3EbuD2UzR+k2soQd832QMk8XWcQSedqm8\no/vhVV5/pfN13gICHfC0IBmsOCJsnAFI26US8K1lvfIwUS8iSuFEJCE4+KY8\nJoMHKtR5Pc5RSdtZGflCSsGKoBwrOdAT33Q06ApBfy59OOWILYZZGaYJBxhr\nlDV5gwnLrytOH4GMRXbf+Hy2gn2GH7rL8X4k4v3JG8N2kGzn1tC9JbVpkL7D\nlh/R\r\n=w2DH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcJ0IyavkjZiLr4KakdUpIBpwvotpkZP+6sXSNoMNedQIgRhijlAeVSICaODXO+3xbCGe7nDNrKbHxKL7lMYbw9x0="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.11_1529697197888_0.6300111286019336"},"_hasShrinkwrap":false},"7.0.0-alpha.12":{"name":"wavefile","version":"7.0.0-alpha.12","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test-large":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/large-file.js --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R min","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R min","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R min","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R min","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd","pack":"webpack && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"4.0.0","base64-arraybuffer":"0.1.5","bitdepth":"5.0.0","byte-data":"11.0.1-alpha.0","imaadpcm":"3.0.0","riff-chunks":"7.0.1-alpha.0"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is implemented as a ES6 module and also distributed as a CommonJS module, UMD module and a compiled script for browsers. If your system does not pick one automatically for you, you can pick one in the **dist/** folder.\r\n- The CommonJS is the one used by Node. It is served in the \"main\" field of this library's package.json\r\n- The UMD module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The compiled dist is browser-only and should be the one served by CDNs.\r\n- The \"module\" field points to \"./index.js\" and should be the default entry point.\r\n\r\nIf you are using a module bundler to compile a module that depends on this library you might need to specify what is the correct entry point as some bundlers will assume \"browser\". In general, you should point to \"module\".\r\n\r\n### webpack example:\r\n```javascript\r\nmodule.exports = {\r\n  entry: './index.js',\r\n  resolve: {\r\n    // tells webpack to use 'module' or 'main'\r\n    // not 'browser'\r\n    mainFields: ['module', 'main']\r\n  },\r\n  ...\r\n};\r\n```\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"19f57fe6e9e98c1c3737870001766740917ccfdf","_id":"wavefile@7.0.0-alpha.12","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-d+GaqeXD0dG0GgWYVZcC+hFJkQi0leh8fXKsDd3YmMMz2E7Z/qKdUL/PTdK4nLfK3iRIlS3KRjpgnVkOKS9sLg==","shasum":"6deac6ed6f9091cf54f7fa18aba144aecd959b87","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.12.tgz","fileCount":9,"unpackedSize":361076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLt/MCRA9TVsSAnZWagAA77oP/jG3kUmpaoZxgTuuTsdp\nlNLZmedbHM+ra74BUgDFp8fZI2ESS3jcuFVyFzmCTba7FwMmxHqL6AOXABNK\nZIcR8y5noWa1MEcJbyPJfeSvd0LRdoj7gfq7/NuBafxfHFygm5NWSxI2jeMr\n6EQXxiHN2/HrrkUboMO4saMUzGQEECPBtIdBpMPDQvy1bzRkI3erhaFcDee1\nAOnpGaIDU6RutxaHSnJq9llSNRHtSlHQHxjuXgrA0XOttwEc8OEdB8g5YssZ\nlXAw/9K+Pgpmoy9UbieinrKQNDcMv+UIxGV3UUsssk2XceajEtdVqYb4E6yy\n0Nj5J5FpQZ8C+dXoSlIUuzWkwkgMvU0KNiRpyIS0Nocv5tZjD+TepCLGaUkw\nRQjj0plI1jT2bA4H6anjZdb4z03gMIe4ugwQ2FbqVE7672HRtmz1VXWt3mm7\n9f0sqvFgi4HEWbwvg2CnooZgjLfyyToA6Ose72QQonb8KPtVebcLcmoMTLJS\nIEf8QdegkNRWk/kWjU7jpZp1WhEJ6ETDf1P7IXx8+oXrSt0F8j644qxxqpjz\nUj5iWw4Bec/nXBxO4f2IDTaLCQ45+FQtA7uEkwNcDq5raHxJ00S+ScL1jbHM\n+mxptNDiL+d2T6WTiBHWaiHoAb4xDd0LWoLT1sQHfcv23vOmEUR2pq2hUGWu\nLoLB\r\n=H+Ee\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHNf8aAwxVGqpW4WkhhWoZuMG/ZBFuB0pr+JfYSRTeZsAiA5H+coYDgvazqt0RFwjC534BJeY0KBadizwIicZBveUg=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.12_1529798604596_0.710965430556282"},"_hasShrinkwrap":false},"7.0.0-alpha.13":{"name":"wavefile","version":"7.0.0-alpha.13","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test-large":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/large-file.js --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R min","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R min","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R min","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R min","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd","pack":"webpack && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"4.0.0","base64-arraybuffer":"0.1.5","bitdepth":"5.0.0","byte-data":"^11.0.1-alpha.1","imaadpcm":"3.0.0","riff-chunks":"^7.0.1-alpha.1"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is implemented as a ES6 module and also distributed as a CommonJS module, UMD module and a compiled script for browsers. If your system does not pick one automatically for you, you can pick one in the **dist/** folder.\r\n- The CommonJS is the one used by Node. It is served in the \"main\" field of this library's package.json\r\n- The UMD module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The compiled dist is browser-only and should be the one served by CDNs.\r\n- The \"module\" field points to \"./index.js\" and should be the default entry point.\r\n\r\nIf you are using a module bundler to compile a module that depends on this library you might need to specify what is the correct entry point as some bundlers will assume \"browser\". In general, you should point to \"module\".\r\n\r\n### webpack example:\r\n```javascript\r\nmodule.exports = {\r\n  entry: './index.js',\r\n  resolve: {\r\n    // tells webpack to use 'module' or 'main'\r\n    // not 'browser'\r\n    mainFields: ['module', 'main']\r\n  },\r\n  ...\r\n};\r\n```\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"19f57fe6e9e98c1c3737870001766740917ccfdf","_id":"wavefile@7.0.0-alpha.13","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-SHVf7qBQ6j0h0jOn06w2Ik2Q0eC7GKaYuSK/p3RPymN7aheHK+WtZsrxPKDGRrSgBY+qTdZ894OV1/usmBUsIw==","shasum":"adf1b8afec2a71cb6298ea3b1112e9e2ade076ab","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.13.tgz","fileCount":9,"unpackedSize":360821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLvFeCRA9TVsSAnZWagAAFVwP/j0XcoQc+Y/RDHw30kSE\nVUJ/XYOQtvPTAlDO5yWD8Z8/VF1ik4G2kL9oCnwdxFHI4+qQkvx76i99hBvM\nOFY6xXiNNSSr4uPMGsJmI5/8TGRkwP+Zhpok/j9GdMe0NAZVsm0YA5tn6ltn\nn+7I5bC+NkvvTQU8/+m0MD9MsjfoFVG8GVg4TITAjQ79dccl4WYvaUro5LzW\nTQo3lnsAYgcMF7VhLkC4vqDoDpS2b3i/LY426Yp9L4udXqKyGHzST/vY2ZQ0\n/ZlIs4LNF3uweNJXyD7wsatIA+j8Fmh/xJwLtlHIB51hjoCrL5m8nvXlVo15\nmIt7apTPySK0v52i7KSsziNHltBnwuJtRY6XTTyo2tCMQxTx2TRJKJcrlySv\npRpOFWit33H1OUDNZMhiRf8+ehLxpyvc5rcdWkVWMJU6HZEuYmT3uBaek6bt\n5yJknC4AYS1UJelM6I3EDSSpqd6i1qxah6On7iNZrHw0IIdO7Ypi4KckzHTq\nW9Bf8VlXvSu4sA3ZmFt0MuvL1jz/2pKgq5UY0jX4dPoOPpUoGUpXhWSsXjPb\nFgLM89RkMe2ScnucjaKWG60XOrZ/GChsUOLZ4YD2R/5uiph9ksciSEAbVtOQ\nOlVV/Ozdx/Yl0arBn20eYZa9xua7WiN4mUwH4rrb38Ovw0PZ30vtpECef2zd\nJOJC\r\n=F9oz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDm9jKyPXf8Hflf3HiIm/v4gyQXmu41Fa+mSpIZ4k9eJgIgKAPGfU7Ilr0JggZHXqg4xQxegSYa9/IA2a5yxExArsc="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.13_1529803102443_0.9084021471538828"},"_hasShrinkwrap":false},"7.0.0-alpha.14":{"name":"wavefile","version":"7.0.0-alpha.14","description":"Read & write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test-large":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/large-file.js --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R min","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R min","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R min","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R min","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd","pack":"webpack && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"^4.0.0","base64-arraybuffer":"^0.1.5","bitdepth":"^5.0.0","byte-data":"^11.0.1","imaadpcm":"^3.0.0","riff-chunks":"^7.0.1"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is implemented as a ES6 module and also distributed as a CommonJS module, UMD module and a compiled script for browsers. If your system does not pick one automatically for you, you can pick one in the **dist/** folder.\r\n- The CommonJS is the one used by Node. It is served in the \"main\" field of this library's package.json\r\n- The UMD module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The compiled dist is browser-only and should be the one served by CDNs.\r\n- The \"module\" field points to \"./index.js\" and should be the default entry point.\r\n\r\nIf you are using a module bundler to compile a module that depends on this library you might need to specify what is the correct entry point as some bundlers will assume \"browser\". In general, you should point to \"module\".\r\n\r\n### webpack example:\r\n```javascript\r\nmodule.exports = {\r\n  entry: './index.js',\r\n  resolve: {\r\n    // tells webpack to use 'module' or 'main'\r\n    // not 'browser'\r\n    mainFields: ['module', 'main']\r\n  },\r\n  ...\r\n};\r\n```\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"19f57fe6e9e98c1c3737870001766740917ccfdf","_id":"wavefile@7.0.0-alpha.14","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-e305ZongH2/BPNBo/VYc5CuVuKihURRl3erTAy2Wald8KFuVisgt68nEhD0CTmuaYJpjIFRr6acIfmRFfzfjeQ==","shasum":"e41a9e8e9010ebd65c324e501008b7c29adaf8e9","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.14.tgz","fileCount":9,"unpackedSize":360060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLzPPCRA9TVsSAnZWagAAdNAP/jwfdA8tPb6UOph3k/FJ\n1Q+wp3QA1Dc7gPkgoXWIOz1rixLEG0VF11Jqo2OvYSqBk2ZGEt9SAiHZq6a/\n2cGJCv8ZLlJ89tqSS+m/Z+wdOyuUWnB2cAYcqAfHfXMprwaf4M+iZ5+2GlB5\nk+VYZ7e/6TLhkvza4t5bpHwzj3nkCn+Q8yTjq6GDslKCUIJdLdMpNH7Nmw32\nBGt+SSKPVwNUYBvxE6TAcNVeatag4sBGQa9PxYmeWsxd3ObZK7WOo2u6w16G\nhOIFWh57kx9ITHEThAfPnLDT3A2zSUmYiKOkV9yrmhJbRuUTdch9aq/I8vPk\nHrgWyAAG2kOEvG/VCb6wi2SkVp0hmuK+AX1k95spdrmwZrODGrHzZ7h60+k4\nyN1bOm9omZLjYvKPowqM7KajxQDuT3bazkNTOdhjp//tas2PiXeqT2aXZNUf\n6JAVXcwoWxOfcXZuaYQ0hfv199c8OHCDIawUx3Ug9Ou+4R2bPRUcxXG2YXjm\nvY9FDVgHTfausXXpXfyaLHP7REnFwy2upqSnx573g0TbCum6xfz/rx2sFG5/\nEeCdo1ZfcRU5oK3G/0tTh1YxBgVR6912Od87YE4EFE0xdfimqwZsVpXtqJ++\nvKzdYfhNbFZlMb+/XeocdcEfWmo08UxhjOP/h4V99KBzReh6Ay/Pzd1hMI1q\nTwmx\r\n=2z7M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICm/8TDIIY3p20ZyqcZrnX2lfx59M5LlWnFgWYVeRiKkAiEArUcf8TEDN2XA5oM6lUp2+z9UFI/gGFJCvzhOm0GYEUg="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.14_1529820111388_0.6024915364450727"},"_hasShrinkwrap":false},"7.0.0-alpha.15":{"name":"wavefile","version":"7.0.0-alpha.15","description":"Read and write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test-large":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/large-file.js --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R min","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R min","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R min","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R min","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd","pack":"webpack && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"^4.0.0","base64-arraybuffer":"^0.1.5","bitdepth":"^5.0.0","byte-data":"^11.0.1","imaadpcm":"^3.0.0","riff-chunks":"^7.0.1"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is implemented as a ES6 module and also distributed as a CommonJS module, UMD module and a compiled script for browsers. If your system does not pick one automatically for you, you can pick one in the **dist/** folder.\r\n- The CommonJS is the one used by Node. It is served in the \"main\" field of this library's package.json\r\n- The UMD module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The compiled dist is browser-only and should be the one served by CDNs.\r\n- The \"module\" field points to \"./index.js\" and should be the default entry point.\r\n\r\nIf you are using a module bundler to compile a module that depends on this library you might need to specify what is the correct entry point as some bundlers will assume \"browser\". In general, you should point to \"module\".\r\n\r\n### webpack example:\r\n```javascript\r\nmodule.exports = {\r\n  entry: './index.js',\r\n  resolve: {\r\n    // tells webpack to use 'module' or 'main'\r\n    // not 'browser'\r\n    mainFields: ['module', 'main']\r\n  },\r\n  ...\r\n};\r\n```\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"19f57fe6e9e98c1c3737870001766740917ccfdf","_id":"wavefile@7.0.0-alpha.15","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-TnnSGk40EIUYl+fu0fBDSPkPTVMDjfE7oiL42SbIJsA5hiNBhNYo3WplzhBWTKZczZjDJXM8uRQLeJokgArN0A==","shasum":"bc19a657cc70def4db3c308e103c7be16adbeb9d","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.15.tgz","fileCount":9,"unpackedSize":360019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLzcvCRA9TVsSAnZWagAAqzoP/i2irGW2wi8vsjLI6ZHX\nRoOUAH4JFug0hCaD/u8Bf9NQ/9a6P4eNgxU8+Cpt+PS+ENJNDkcUB0F/7V31\nO/q237MI3EiXPJcKO9exHil+nH38O3biczQ9szT1WW1pb8N8UPEanQSnsruM\n6pk1aGXOmzK1l/F34JxLHgkoYa8zmWljqymI5q6zshphWlyUalGgF60ESucS\nDgi62w3z6zI1lOYSTyAT4cnxM7V2ZvpoLGqHN7h1da6Mm9z9ygaoLUboUG8h\nB+YOMGUFYxTnE4L6M1lNZV4TwiDs6nnrXSfuY5sdPE9ixqfZa1El3MULT6f3\nV9FzvO0Ixvvsl584ghPZ/Jy+7hD6nTiFf2y9ve9mH5QyYzTMx2KZeeBjGOip\n6iwAa5jrGI7zVi2r03nQJU0BuGr/I9A3+hk+r92uBLeDNfzTNpvPewfiiK2m\ncLV58bmTlikngXTmJjWSuuNfq9XBAL/1KW943uBClZ8cFqtPJfPKTSI1ubyQ\nLKKZicFibS9JvoVGKaVal2rGqjEBtuB49SBfoYzkPfkkVqW10xzZcBVefgfU\nG9A1PRneHlwbMOd/XQtTT+hB52r24POYvTNC67tj5ZE3DHDnxvIZh50qhXxB\nbMbt3d8ihDDH5DNdN3a+vjDph0LpUJ1ke7AZkXdK2ZGSNeek/SyP1F00YAuc\n9fXN\r\n=+JLw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvkXQGJuTZkBJXvN1uW9IkZKc3ocWnNFvHlfMGqjaWhgIhANt6SqAFA230uLDCXFhOvMDMfe7p6ehdSSMnL4LretWI"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.15_1529820975412_0.6125051077346917"},"_hasShrinkwrap":false},"7.0.0-alpha.16":{"name":"wavefile","version":"7.0.0-alpha.16","description":"Read and write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R min","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R min","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R min","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R min","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd","pack":"webpack && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","webpack":"^3.12.0"},"dependencies":{"alawmulaw":"^4.0.0","base64-arraybuffer":"^0.1.5","bitdepth":"^5.0.0","byte-data":"^11.0.1","imaadpcm":"^3.0.0","riff-chunks":"^7.0.1"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n## About\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Use\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is implemented as a ES6 module and also distributed as a CommonJS module, UMD module and a compiled script for browsers.\r\n\r\n- The CommonJS is the one used by Node. It is served in the \"main\" field of this library's package.json\r\n- The UMD module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The compiled dist is browser-only and should be the one served by CDNs.\r\n- The \"module\" field points to \"./index.js\" and should be the default entry point for ES6.\r\n\r\nIf you are using a module bundler to compile a module that depends on this library you might need to specify what is the correct entry point as some bundlers will assume \"browser\". In general, you should point to \"module\".\r\n\r\n### webpack example:\r\n```javascript\r\nmodule.exports = {\r\n  entry: './index.js',\r\n  resolve: {\r\n    // tells webpack to use 'module' or 'main'\r\n    // not 'browser'\r\n    mainFields: ['module', 'main']\r\n  },\r\n  ...\r\n};\r\n```\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"4820d809c79b2bb217f0ff8b7a9dd111107149df","_id":"wavefile@7.0.0-alpha.16","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-mHdnt6DmBRdVAFIWccgx6XZUXGVWsd+p0dYgJSZ5iQPg0S01hXQQJpVIxUSOAol0oStmVzQGavbK4kr6Iy9HBg==","shasum":"c2c7bae54a1136107f54d53f1f84fca93a698897","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.16.tgz","fileCount":10,"unpackedSize":361003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbL2LDCRA9TVsSAnZWagAAuT8P/0vNQvBdkn5UgvZXqWiI\nHj3M7RQJYzWp6gogTWrPcXY90hUY5Za9RTbnPsdft0/Rzryd+9pg1HPDPvI6\nKc9QtzvwSaNjupH/hWpAc0FoNeMuMKyocaaAE6aDA2qNV/wy4UjrJqZCb40E\n+sKpBelWcP8vKm3Eu5x8oQIcpPNCDUg9mB/b3NDXFh9GebeoFBjWAMTzSwfX\nY4p1aaJ8c25RiSEzz/skVRLkxcCPDWWqGLIeCGASz3R7n9Mk0Lzeh6bO+ttm\n9aEeNbrq2Ae1pQUQlnE4jzpxQax1hZykDKv9YSH2fPA2zAYwdrvQgiDyTuyr\nXWfrhRrUgufH8/jJLI2Ze/uHKB+6rkmNvnZG+zv3Dksxm+oItjBYBaEN5eSP\nyQN5KRfh5H5x+Pq10yqj7giPbq6l478oGPDQOICUJqh1UCoDSajWzurMkk8n\nrRImlclBT7zH66RgCGwXLLOOBTA7CBY4ACZQu5LSF+tamRkpg8WZvQIjGnOa\nT6nvR8/H1Ofzj9t2hWLVkWxdi4t0Hkhsl4vi2bswXDhFM/OLinslZTJNgRyM\nZrgJP+FpVapq39GvVqOiySaKsqOm5S9LVX9P+hVmXA7kKVryjL7Mi9dPQefk\nEOtfrbL58KqsdgcJyP5qIAAfSqKbAgrlec4QCEfAbVknWmc2TRp7Pybu0XKy\nLv9A\r\n=/Ppu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCU5YsCcuvMMeoVegmlwMgKghLH0Uzw8kkjX6nsoYnZ/AIhAPCKTSWNJ4hwMjZShwsXBzFcFFoaTscXp1cxfhkgstHh"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.16_1529832130857_0.9251566090699301"},"_hasShrinkwrap":false},"7.0.0-alpha.18":{"name":"wavefile","version":"7.0.0-alpha.18","description":"Read and write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-esm && npm run test-min && npm run test-cjs && npm run test-umd","pack":"rollup --config && webpack && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0","webpack":"^4.12.1","webpack-cli":"^3.0.8"},"dependencies":{"alawmulaw":"^4.0.1-alpha.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^5.0.0","byte-data":"^11.0.3-alpha.4","imaadpcm":"^3.0.0","riff-chunks":"^7.0.4-alpha.5"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\nOr as a ES6 module in modern browsers from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  // ...\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n## RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD and a compiled script for browsers.\r\n\r\n- The **CommonJS** is the one used by Node. It is served in the \"main\" field of package.json\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The **compiled dist** is browser-only and should be the one served by CDNs.\r\n- The **ES6** dist is **wavefile.js**, served as \"module\" in package.json\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"4820d809c79b2bb217f0ff8b7a9dd111107149df","_id":"wavefile@7.0.0-alpha.18","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-N3hNDU0Xnch4EsWc4fw8Dmixr69sgYT+/SURRIso20CAcxTjLZ4qyt7AQs/TpTXdxEYA3nlfCAdVUMBD2oUatA==","shasum":"c3c416ec179765d035b4c80852ba4281026814ff","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.18.tgz","fileCount":13,"unpackedSize":600406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMKK6CRA9TVsSAnZWagAAbKkP/2q6KRHpZR/0lOv3VwMS\n5E6Hgp6EtP/1AQrn9/Ltz3Y71COideVlo17uppyzLie++cJVefHqnHE8V2B3\nVROJ9N/KmDIW0FPVHIKyli1y6u26jtp9xwEUrS1s7LVr0fO852Ici067rKa2\nsLUJZ8LkFKs3GkGz/WRVUEjSwqN0ZAuEbWzARiOjOlSSWJ8xx2vNk3/nEuKJ\nupuwMaSrCLarPmEW1dhSoXvJZOTZAUD/bC/y/LsZ2iD6HEvbjaYwJU2yh0u/\nTyqnPiN3r1S3lEx/l9J41dc5d+uJMIihlbZwm+NyN9j/L2uSZX3Q4AUDQkBY\nRrenOH0MZu9MavVLEx7KTYTRaUiBnQdrotxtATHuWlLsUePI4nMsDYZ5Frip\nchFMHoWmgpQzgYkwS9Qf5ZqjYzY9/OhEJ8pHvQusjL2cyWCk19EfemnMcNks\ngRWw9uPh9dpLUCTFMP5WAM1KQyaaDK7k0GX3UIITI5Fn11qrjYpYOk1sY+H+\n0EIMBZbwS8ZoP5iJeQ5ZALw0OuK0eQo8ZFAkgWtBEsYu6Tj1rbqOyaZCCUtJ\nLTLVd0u4+RavOWfRZWVAwbTjCQvMMt4G7E1Qn+auM0ZtShGI7UDSbbWikitP\nSF+dlNM5MoTMNIA1fADPynO9aS8rw/9za944dDJtDd3tWyM2lsvbRdP5YSI7\n4lvj\r\n=cDgM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC34Jur8vuIyt0SY5DK53c/RiRLA9R+JtMocxBZuWGobgIhAJq67/VSOHnEQNrDY7tBt5SHM3WMAsyG8GLTyEwzFJy+"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.18_1529914042688_0.3114299527142723"},"_hasShrinkwrap":false},"7.0.0-alpha.20":{"name":"wavefile","version":"7.0.0-alpha.20","description":"Read and write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-esm && npm run test-min && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","google-closure-compiler-js":"^20180610.0.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.0","imaadpcm":"^3.1.0","riff-chunks":"^8.0.1"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\nOr as a ES6 module in modern browsers from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  // ...\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD and a compiled script for browsers.\r\n\r\n- The **CommonJS** is the one used by Node. It is served in the \"main\" field of package.json\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The **compiled dist** is browser-only and should be the one served by CDNs.\r\n- The **ES6** dist is **wavefile.js**, served as \"module\" in package.json\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"3df96f6c117770c8b4c9d343761e82c3839f0e69","_id":"wavefile@7.0.0-alpha.20","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-x//CmLpYrAbX7119R9aTs9wC+s9jSyBSWQ9xD8a7+0+zYbf+dpODMEdYmSf6x/MKLXOM7Vbw9lNcRHhnNRy0Ig==","shasum":"9572d719ed14255d98b66eaccede6496f9178df6","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.20.tgz","fileCount":11,"unpackedSize":442412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMyN/CRA9TVsSAnZWagAAnuEP/0JfrME8FhMf62U/CWVM\np+DpiZ7cJzw4aiTGexC/682QrSoqydhMkpGbAJtUsvzZ4HtUXvU8ICHGsiCu\n4WlLBSu9xrPgBr948z/DRrxvH3sY/UQo4hg/fAqAQzdeOPkkvrAVclWhvvnn\ni2dWLGlhOsb6u6flxFfxU80TFJ86g+J18G9sqTqBwYsDRk0yT4JX6n5CX37t\nZF1A0l/lp8C615ZoOFu6+Co153j2c2X4yl94TEQRTpDNIRHC9j4eSlMNkOhW\nBOZdq6bn633pclGZ1LIKYJdvgVoLHgYM7N39IY+ho/JKHiYBgJJdy4d9JJIk\nYJae5UVYFnrpWBARe5hy1przBvidLaUcrJ2pYkbpfugWJOc6Knu2iVA25HA6\nHcTl8oxGdGDmpiqG7cjAqxYMLwOWtjLSdUnr2xFeaQn4BtSNzVDsVHYNKxJG\n+O4yzrrNdSnsj87qRmjo5SXHh6DWgst4ZwWnq0S38Op1nUP6l7J2hJ9j1uix\nxQihdGJxxGbCKkQUg+KLRMoI1dOakBkCQ7vS3pamNVW8D2wahpxNSNBCKbju\nbguvluXA1S0vQ7WhGwsUvpGrhL9LfICboJJKoNgZvXiqfQhQZhUeXFeqLEWT\nZenMAqNOVgJ4pi1Lhu7uSz8HydkXENaroiqfXeeH/PVhoYaomu76jkaFuQCd\nzI2R\r\n=mjt8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT2Op7SrsqBZE3chJiSydo2GuzNAq+oN/O5aQ5nAYSrQIhANidexzdZqgmGFIhy2KOWw4AvTM2vhganjZqicAFngHt"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.20_1530078079615_0.4014035192383165"},"_hasShrinkwrap":false},"7.0.0-alpha.21":{"name":"wavefile","version":"7.0.0-alpha.21","description":"Read and write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","google-closure-compiler-js":"^20180610.0.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.1","imaadpcm":"^3.1.0","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\nOr as a ES6 module in modern browsers from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  // ...\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new wavefile.WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new wavefile.WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Interleave and de-interleave stereo samples\r\nSamples in WaveFile objects are interleaved by default, even when you create a WaveFile object using de-interleaved samples.\r\n\r\nYou can de-interleave them:\r\n```javascript\r\n// De-interleave the samples into multiple channels\r\nwav.deInterleave();\r\n```\r\n\r\nTo interleave them:\r\n```javascript\r\n// Interleave stereo samples\r\nwav.interleave();\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new wavefile.WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods:\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Interleave multi-channel samples.\r\n */\r\nWaveFile.interleave() {}\r\n\r\n/**\r\n * De-interleave samples into multiple channels.\r\n */\r\nWaveFile.deInterleave() {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * If the data in data.samples is interleaved or not.\r\n * @type {boolean}\r\n */\r\nWaveFile.isInterleaved = true;\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD and a compiled script for browsers.\r\n\r\n- The **CommonJS** is the one used by Node. It is served in the \"main\" field of package.json\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field.\r\n- The **compiled dist** is browser-only and should be the one served by CDNs.\r\n- The **ES6** dist is **wavefile.js**, served as \"module\" in package.json\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project embraces the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html as its code of conduct.\r\n\r\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting rocha.rafaelsilva@gmail.com.\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"3df96f6c117770c8b4c9d343761e82c3839f0e69","_id":"wavefile@7.0.0-alpha.21","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-hat8XvxH6seKBHNiODiNpNikQylm61CNRTpgzTONM6R7ZQVhbvWIkTF3SX5GoQz5TB0sB0AI/ejwSssLpxseRg==","shasum":"b277b42aa3f37f8eff16e8b19c33d5f783f78ada","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0-alpha.21.tgz","fileCount":11,"unpackedSize":448522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbM0e9CRA9TVsSAnZWagAAQQoQAJ7pimGr5Sx6toP03CHQ\nwXZ6lvZMTasRn4oiTJYFqu7j04nAr1HC5I1JzUGbv2dKj3tlmO+KOqhvKTdw\nN5boxGHZxnGexDoCJ1/gv8Uc/2B+EoGJV2CYsVGSlgelYa70cTqqehn4vJ1a\nHT2kerP8gSIJ1BcNAyUeAdie5xpEJcBq14QuCWKgN+s5DvousxvY5nF341WL\nqlOOmr3fVzWt6TPGSl9zZ5ze28RYhZJDpQqYNSOG4vEwYrdUcGBisUK+q9vK\n3aTPIf6r3kuFGHJZFmd8mcSdIUsHSDY46gASTftbWOx1ibae3C1GIjfRG1NO\nEq5UA8+woOJYkPJti/sQe+orCwIHPTtaT4GaZrjiLjnlgF6B6dYmPN3q1W1g\npSVjY81lsNllHJlxBBYsVdSPlmrdO/u65rkjJHJeTWwWyWBT/ZqeL/2ThIHD\nV9xIXIOsB+Fn35TsZY4X/HVQSySbd7bVBA7w7L1JFVHTudD1EQpGXsMhO2ww\ncLfWidLKmm2bYBMOY89vsgaOSokZsn/43esctN529PjnQkwQTG7JbWJ5eseT\nj0C9oUeUegqyBhce37slTS+irl1J721IkrxswcXu7WPHDn7Rd9lDHDug08aL\nJ76zOtxPU3VDb/NBsjzmTdUhKpXAaSKVA5LBVaraCKYpziloSUjJZfHSo7kq\n70NV\r\n=Sp+J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCexbWOasABjK8Gk4LCqjt8FeJTLtaH/UiQ70B/ysVcfwIhANb8n46zRjje+ybyjMfk8eVNQRipw1RkGsoTVCxafTmP"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0-alpha.21_1530087356989_0.5116666976965638"},"_hasShrinkwrap":false},"7.0.0":{"name":"wavefile","version":"7.0.0","description":"Read and write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","google-closure-compiler-js":"^20180610.0.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.1","imaadpcm":"^3.1.0","riff-chunks":"^8.0.2"},"gitHead":"0fe2c5f5a1fea53275c4562a6daed53144784a4d","_id":"wavefile@7.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-fzzSpT6ZSxHURMgzuxBudZ3hftHdNlXXwFBweEloJHT0iFXeuBhbIlEMhroqtXzWCKshOEkRVwmeLPDJalixbg==","shasum":"8cbd2cc93bd83a8d69084367c78f927e3f895d53","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.0.tgz","fileCount":11,"unpackedSize":448590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbM721CRA9TVsSAnZWagAA3q0P/12KroX2ogfbiQ3D9Uml\nClIyBVGRgfJ/9DE6ppUYSbqKgsYLSmKT4rk5EqzoNcBEWBSms7mIJVfkYo8Z\nS5kLWOMT7YR2Zst/2qzK1jErOo3iq1BUqpDlGPrMHcvqXZ9st/DOByC/Yw1R\nU1ku8T2N/73ay7KvI4R9HPtpq4h6ITjrBj/OWA9SyNvuHfnAHzwu7Hp5HA6b\nbDx/e3CV+Oeci80v6dgNryPCu796c3ExLB0FZMVlTENP+DbhlKg0MFAA/RoD\nDOU9CPVKGB6Xzl+luY5QEHqUrZxSOWJ7KZLMUBfUZCJMR61rlLAvrM8bgUjF\n43/n6HrTJugqGjeusgGp0LPEoCluiLKtBIgATQsgEH1R8+SIyTy3JWqVw8UE\neYnRu+xgYUfY0XbWJ9IPcPtkI/g/BLlx5a7mDJFad7+MADC+5kg5oAYEvi3w\nEij7uuaIN6uwSv0BoAq+yb/LDN77XMWOwZwq6zN7JjluBRSAqgiicE9UESP0\n3/QZNzb3eLNFKTNQl6fxufZ+tsRyUs6yfYtAP7MSLrvJ4bFOfBfqG8AXZb8i\nOJ8bZR+dQUHYSNGzebK3xv0dppTKeOvYt7V6SaIDWz4gx8vuepgNXKCVlg9j\na543HHXVS00vz7zSBIX6Wa4Dyr9dznwB3s7ZAmyOnzaQKjfzboW9KibJo1d9\nOfJl\r\n=40aO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1Wfc3ujsyyXv3ZM7wQZqKdLCelBpuaH3u9uQG5yU+EgIgXUmoecMZ8xBvPM5Vtf6lzOSiB1xtkqGoE8ZvtcxagGk="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.0_1530117556964_0.0732526134145457"},"_hasShrinkwrap":false},"7.0.1":{"name":"wavefile","version":"7.0.1","description":"Read and write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test-rf64":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read/read-rf64.js --recursive -R min","test-bext":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/bext --recursive -R min","test-codecs":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/codecs --recursive -R min","test-cue":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/cue --recursive -R min","test-list":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/list --recursive -R min","test-from-scratch":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/from-scratch --recursive -R min","test-read":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/read --recursive -R min","test-rifx":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/rifx --recursive -R min","test-smpl":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/smpl --recursive -R min","test-to-bit-depth":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/to-bit-depth --recursive -R min","test-write":"nyc --require=esm ./node_modules/mocha/bin/_mocha test/write --recursive -R min","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","google-closure-compiler-js":"^20180610.0.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.1","imaadpcm":"^3.1.0","riff-chunks":"^8.0.2"},"gitHead":"979a72706c7128f4ae90b43f5091fff3ad273c6b","_id":"wavefile@7.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-/DApN+cBgioqWED2Da1itJlUUr39O1hfi7Wjq9nCjeMBxBOqLAmJnSOlH5ObeyaEwa6/Srkn96/tMQR4GTI1IQ==","shasum":"6f72e42eaa9579206ecbb15776132489d7b97f28","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-7.0.1.tgz","fileCount":12,"unpackedSize":450014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNC1zCRA9TVsSAnZWagAA4CoP/1KMib42bkfq5S3PZpWZ\nxFPoWNgdmbR2TwRNxDjPFQGlEeA5GgQK9BUBnFaXDdTjwd4tq8ZaJlGpJ9w1\nXR2U8JLwcIxC4akYVLNGFV4BwOAb3tDoDHLgR7cj0sJSBwyN1RUBFw7bPHnh\nqSJ4+LRmoZ/Jt4KsvOdVmnb7/r/Jnc70xjnyLmLgrvlGbs7QhGhF+JUnGZi4\nRylKtK6l66+gFx/mebFjEs1wcS7R2gSsdaqkyCXuQwDSG1KjEoBO1LSRnyaC\n1Q2m8y4MNd/oJcfdcGxTt5XoBRL97FfV3FA4te++lxwLTwh8ax/Ldwz9w7hU\nYpDinhAfMxqToUVYjBN1944D6tpn3MLo9NQC8t06tsfBXeSrYzy+XHKUshkP\noCbWdrrej71+lfi73PnPNjbM4zkEj7pkN15LhPZf7K2meU6nix2hqs+0JNra\nNNS33I//HqH5Py4SHZwfBc1cNak81RufVOjltBlHmGHrayI2DqTT7NP5Pf1V\nUoo1lqQt/+6kqpra1HBgnxxsVNNcrYjAYH70rOUItWx/ic/ihAXgqQkb8Tf/\nHN8qxNUQvrUMh89tyF+oDzl3CXUQxonxlQOD4VQUum7fK5SBtJ8KYci6pf/i\n33Ju/kv0CJ8mha8Ohn24YWUh9+C2+ZEKs3PEJXty3tkgf5KpTHop8WDHSJVX\nmCHm\r\n=Wjbx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFNTJhCkYKxIISNTu52oyM/+ZtAzRRs1VBgPx3LTf7k0AiBB3qCYwA4Iy1iLp3lHBkAQUmhpbylwVXgWhK8DskIwLg=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_7.0.1_1530146163682_0.30730479916219444"},"_hasShrinkwrap":false},"8.0.0-alpha.0":{"name":"wavefile","version":"8.0.0-alpha.0","description":"Read and write wave files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.1","imaadpcm":"^3.1.0","riff-chunks":"^8.0.2"},"gitHead":"84f809bee9f2f86b489a111c6b3bfdb0f2394a97","readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\nWith **wavefile** you can:\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Table of Contents\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed via NPM.\r\n\r\n### If you are using **wavefile** in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. It is also available via https://unpkg.com and https://www.jsdelivr.com/ CDNs.\r\n\r\n### If you are using **wavefile** as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the source but no dependencies. Dependencies will be imported from your node_modules folder.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field. It includes all dependencies. This file is not compiled as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies.\r\n\r\n- **./index.js** is served as \"module\". Its should be used by systems that support ES6 and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","_id":"wavefile@8.0.0-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-1oiCOl2NaJXFT+WsVLCJT24XOVCKEXI9fqnakFJiKbPYoFNdcsIK4rxFJIN6EnN+5LHMUsXzTBjMrUEhBH0i4A==","shasum":"f982dba2d86686db7ad199e5b370f7cca34232f7","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.0.0-alpha.0.tgz","fileCount":13,"unpackedSize":582702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNYGBCRA9TVsSAnZWagAA0AYP/1rXKO18epX3uYwtBFbJ\ng4bPtz0H3s9f2TijULoj4GUIsRltuxcLEZycsomEg/xor+sx98TXPCaxg5TQ\nzmwQTKrawdWmXEol6bn3/iq3b5tR7FGb59frDXWTCY0hVIoa/QXx17AH15cb\ndulHk4UsnQ4/dz/CiM6xHCBK59UBZ1ZPl3YUYlc2+ON0BcAZNU91k4p333MA\n9KKC9b4zOiIX9TX7mCSDZT4PHelRaj6IW3QyvKe1YjsNv1dREM5+vuT/fuTR\n8i8KGy3v8wC3jMZY6BjhimSgCWtE1pLgUIe/2JaVtju8n8AdyfXuTFM+GQvc\nacUvADZBVawpSozZWacBEz0mKzUXiWc5b3mVymb2lG3gvR4EwRMeLSh3OyAx\nVXd7k6EU8i6LK/k7BA910UwrCjilScjYWIuHKxm+wBiSGBIGe2GIb5gHRuqG\nd/hyctm3HiWRUUIZIrX1ONYzE3m1ep7UkIHSX87zBn8FgNC6Vc+onJ5Tfcbm\nk5PWnWaMoBzpt6JXil9gxPToKiMnjK4SRbkKqx8vdGVNUHTZafYx23fuv8iC\nt18PFGwUSNmSUGlMBhG+CDGqcYSh2LCBrk3v4AJ7hXZpaQybPYtovRuHRhEs\nPRjWMoYQfw9YSQv/l2XvEhiuh/SOLkDECX1cADmelk9R7TiSEYzo1/2sE/ow\npO4F\r\n=9kk4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUP4qHFBX0Oa6mnIGIUlBKlhM0UDaFzo4LkvYEcYA3dwIhAOvSEMS6SfVI4cWm9Xiui7Skz38t+/lOj+EVxE123Thj"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.0.0-alpha.0_1530233217202_0.19291089067570133"},"_hasShrinkwrap":false},"8.0.0-alpha.1":{"name":"wavefile","version":"8.0.0-alpha.1","description":"Read and write huge wav files, fast. Small ones too.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.1","imaadpcm":"^3.1.0","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works with huge wave files**\r\n- Create wave files from scratch\r\n- Read existing .wav files\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- Just 7 dependencies, and they are **all MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 30kb minified\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile@7\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile@7\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed via NPM.\r\n\r\n### If you are using **wavefile** in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. It is also available via https://unpkg.com and https://www.jsdelivr.com/ CDNs.\r\n\r\n### If you are using **wavefile** as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the source but no dependencies. Dependencies will be imported from your node_modules folder.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field. It includes all dependencies. This file is not compiled as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies.\r\n\r\n- **./index.js** is served as \"module\". Its should be used by systems that support ES6 and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"940e076a8c4b6e5f343a55a1eec7632a128765d2","_id":"wavefile@8.0.0-alpha.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-AQnzu32Qmh6L+6UTXsa3zaxgwOSvgpUsL8nG5Nyqby+ZjXf09j4SFjVGfEZxJxcCuRnhgbohqYz5HOx/I38j8A==","shasum":"4d5b6d62077765f57f694e4d376121772bc93acd","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.0.0-alpha.1.tgz","fileCount":13,"unpackedSize":575879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNakUCRA9TVsSAnZWagAACbYP/2rrwMwKSFTPHncJOfHq\ntwVlNjx1i3aZXezkY7vIBSHiO5uIn0Mh6uwZ4RPiIvgPnae4bpYj6Vaun1RH\n9eTI+DBLHa07jWSX81HdywahLrOUaXqZ1cuRlBsmaGPS3jHYPaQ5N+YF5oI9\nElR7bPrNmAg6VyWGu0pa13CWYZ0pkyt9Yo6DN4bVfIOnt3H4ZU+OGgYIJ0xT\nchM1VVq31rsvDCF2xX+BcJyKhscOc8YuLMCn0t6ljEP48HXLQ4pjszMw9CA4\np4FTTzffw4Rbs6fnPPKMIWlL1P9u5joL9MpafLYkgrGCxhfr6Bln8lm5TLgB\n5Y51R1zDv+2ikm1gJgEWNpVoMIozLCJ6UU2hLtzzKDN+1+7V/ckNdr3A+pyj\nQBnJjRrCsnyzDHh0q27kH+Lj0B66imspVY4eKcPwhQClxrBj0CBmRAXMi007\ntwDOrKHHTlO9oMy4ZhPntSq8TEDPi5qEQAqX8BrgxgTADkN8bW/XUj8Jrrj8\nJM8q+rBtPKHMaK46fOMXGPO+9wWsRFI2aB/C9ziZxoD+sUFITyD5zFI+T6Yt\nAkpp/zz36l6yRFWkVs1kQa1pgBccV9CTZWEDRxfcVv4uPGjBbvzsTzr/WHwH\nGHur5BEatQBlD9d6on+xmjo8cQ8g/e7vRSic7t+4KVjMgKu1q4WD6JDYtK7X\nO07l\r\n=jhpw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwQA2a4fW+F245b+k+isO9KhDbwGJfnGW1DlyFHKULuAiBtg4DTm4MT09YSGm69viaaZWlO1wtx4ok7XIMZyjpMMw=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.0.0-alpha.1_1530243347888_0.23678239898043318"},"_hasShrinkwrap":false},"8.0.0":{"name":"wavefile","version":"8.0.0","description":"Read and write huge wav files. Small ones too.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.1","imaadpcm":"^3.1.0","riff-chunks":"^8.0.2"},"gitHead":"071d6ed03d1c183671af7dec0dfa6e315f16a2fb","_id":"wavefile@8.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-mD1XXIVeTnvsVSeC711zvLHNgU2DWmwJiUk4Ea7UlObfWPEwpcocpNshIChYqWGeNww/DF4hejysnYL0JFCzUw==","shasum":"928fd89e85a36867e2d2115760b2825421c4a2c7","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.0.0.tgz","fileCount":12,"unpackedSize":450325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNbxVCRA9TVsSAnZWagAAa4YP+QBf/JJB9E50prERt7i/\nmQiCgzdDKZA1zhQi00Y99nNDoXQM8cIXEpvYd9R9zt/sJChQz0ggKVyEwvml\n60vVBjsGTdwM2REnnjUqdA+VBVaRbfOLq0YIeQycsnGQk5mdKvh1SAR7AQIk\nN4bqT4mBcjWXz3BmXxMF1bzDIGIvcVbmH7I21EDqdpNp4BdeU0cSuQg5gvGI\nfiu8Vk6CJPrYdb7gRXxPfhJ12Tjjdh4souZW+ce9pFWUwrMx6U0gSwcg2Bi3\nMA0uBrrZwGXsZ1G/ULVoC9ZT2h08qlqLc/QXH+9GePzPFiObbLkMWyT7BiKa\nF+U9GXSYua+pX8VCHtfuAgr5vw0HScvU7uj9TD5AjBGABrB2UGloy0imIlnf\n/AEaSk+o9+xkrsT7N950oFqevkgexnSEO5dLymrEaosp6y2ThRaoEFYRRlI9\nKD44hjzvVcJD6zH3hSOPVYgvztag8+JRtT7YMXFX4+sN+4uwthNv7Tkg7oXT\ntv1T7+p00rJRowBZtiWB3PxIPouCZQT3Gpmen+1lZlOyRapR9xWVzMjXLrAB\n2g0KfpqN1bPQm35wI+rWaupUtY3KCGpcoqqJi2j4bMpqYttJUGCNS9JG+e/E\nHkPIsNeM8axKPrNV+qAIoM8rZaMrJW1FYoEKjEYq4WyKGnUgJ//aftHcyt5s\nxnkQ\r\n=q4N8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv3snJxOVdjeLc+oK/gimOUnLWQecO6BHGH3zOkL2wlQIgaWGqf75rxQvQHhy23jnkA6mBnEl6VPvDX4HZsEfJc2s="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.0.0_1530248277525_0.9150970735348236"},"_hasShrinkwrap":false},"8.0.1-alpha.0":{"name":"wavefile","version":"8.0.1-alpha.0","description":"Read and write huge wav files. Small ones too.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.1","imaadpcm":"^3.1.0","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- Just 7 dependencies, **all MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 30kb minified\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"samples\": []\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"57a4bf876f3ea948cca8850f4e90f42ad9a486d4","_id":"wavefile@8.0.1-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-o0fI/PZgeDTx/HJ1GsA1IaHqHXZWJSjBnfEA3cZAoGUKrgXzgC1DhKmgpKF1D4TyW7kffiq8Np2YXRhwU+TwWg==","shasum":"650784c2e0f25e1c178357b44aeb385ed196fea6","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.0.1-alpha.0.tgz","fileCount":13,"unpackedSize":457201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNc9mCRA9TVsSAnZWagAARisP/RAlVsvnDKVzeGoLT9iS\nRTNDGdR6cfuKwdk1cqEjCb50wnsM7Hw1vI6IsRMyCg+Rg5lcXkmu0JwHTh0W\nyGxYjTZ9ILKK0CdlYGwbjIT343pIMeZkOwn+2lyjFCowBQlV9thcNBFH8nFm\nnuc5ZP6GN9jahsOFEG3S6NuSu77nHE9qnXuxr2udyfM9a5EwQZfkHFQWppba\nAnzBc59vCY6jIwl1h1jRojkHpv/Q1oMkY55NrnbsK19XgnjnIY/a17nVCm1e\nbsdNB7JgVmnhnQ1RCQSZY5DDhuuu2g1vmDvJgtmel53+eEq4Tkf3OkqH8mql\ny9oBIUKVBYSWgTlDNPtrbRarKC5szUanG46J96yBnext+cNgfmUC8bM7sD/v\ndKl51Q2yXlJCB/O8RwSDMBbZ/s0SbqsM/aicjS+4lNuRwGuuciyCpZ5sqJUL\nmJ1QzUpwe440MSEhCHjfUrOlZAc5YNkHAfUicD/gJ+V6A0/tUc96Xevh6W9Y\n7pjD8vqpcHl2ZsneM/cCg01PP2yssB4l4toA80mKoxrEWnI9mEUIxAkffjoQ\n75+cAlQwvSwctVbwwvA7fn679YS4pk4LHI/SnRdqyR7STR4Lt8Rspr0E1vrw\nChedi16Dub20oXrE5hoR+PRT0gJRyekibf37eD5DNLLDmGPHjZxqemZLVNs8\n+EPu\r\n=cq/C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAWYI13i2m+LCvGJUabaJVI1wZL6+XVz6oSGpbEfWSVrAiEA3CG4fYynXOd6x0xWsZC/HJOECb5hZMAq5/IeUXA/LA8="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.0.1-alpha.0_1530253158581_0.000551389141586478"},"_hasShrinkwrap":false},"8.0.1":{"name":"wavefile","version":"8.0.1","description":"Read and write huge wav files. Small ones too.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.1","imaadpcm":"^3.1.0","riff-chunks":"^8.0.2"},"gitHead":"533996368de98f67d8111e2a03deb390a46d8bd0","_id":"wavefile@8.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-ng8Ety9u31nfJU6Hr2AMVURXckDh9uzkRq2WdpTOvZ0YFkNlv5PIa1rBPQ/wnSIzr4nmDsYQB0n6l8h9EEFLLQ==","shasum":"f423092bbcab368310a291d3e6726942c2a16ff5","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.0.1.tgz","fileCount":13,"unpackedSize":457029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNdUQCRA9TVsSAnZWagAArrcP/RZ+P+w2xlVBBodK9E5n\nE++wKAItRbuONOv6dDiS/Mx+WvkyR3PUbgDf8wa0r9Spmn0Jt2y79UsSO0RR\n827hqRhCFsonF4HZWfEXEpxvXcj7QBMsj6e5eL41upC9rUZ73L96wyIAWU4I\ni4NQg9Rky1ukbYcNm0AuJXkQMYXtBa/jlO7pfGryibHu9apn4vbQBpAYidEu\nmrdXfSKxEGG19P+LArX+fxYlUULrrmzPNwQYQaqojIZH8Vrk0uL7Crz8jJyt\nqYRrl1pFVLk62JQkpZqkaC8gA815ye7CwzThL86C3jYNZg+Z0rIn16kL6h+r\nXHVYR68fe9Apzc3/FzeJWCkyJwkdxU2BwJLj9Pe8s71+eMrZfK195DihV+yN\nJvDR2JggSDnhN3OlKJG+uEu3EKb/3PjqANxObmYP23QujgILmmq5iGUb9IHI\nMh3sSvuI0BAYI3jWtP4OZMm9pkGTJMpBMAKEVvI/pGDxrhU4O0+3qCuE2soU\nvH2ScR42UdmyAyih6lxotcfHg5DfI+h/pbSVbkYs64IhMs0PVMqi6v2FeXpa\nqRWiIAddcDriR+/NkyePezAzIVdFZG+Rm/plmINtmjOV4AU4UmKC1bFiapge\nRk3SqQlfIXFVe5ZuGaSkK10Hya476xsqmeWneTMOkJzq1H7j5Z54Uy5Bpwag\nNyBL\r\n=TZZL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCITAjN0g6WvGX8Nk2y6REsd2yCZ+EAt5smmGUDju3fTAIhAOzaUUCMS0kdaPdvgyArdGx+HuC03/Agtvxm2sF0jE2x"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.0.1_1530254608534_0.5038558087020655"},"_hasShrinkwrap":false},"8.0.2":{"name":"wavefile","version":"8.0.2","description":"Read and write huge wav files. Small ones too.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js && jshint test","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","pack":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run pack && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^4.1.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^6.0.0","byte-data":"^13.0.1","imaadpcm":"^3.1.0","riff-chunks":"^8.0.2"},"gitHead":"4cb80e250a74f205001aac73a876c7dae9ebfab9","_id":"wavefile@8.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-1R/omHA0gJ5RmlN+6opxjOZpimov4ZXHAoZ2hmufam1ASKeqPSsmCc3FgWBj9trxrpy3QW7OpQEpRMMnwG2u5w==","shasum":"8051ceaa93da81225758ee450f16498092c2f92e","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.0.2.tgz","fileCount":13,"unpackedSize":460384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNlEzCRA9TVsSAnZWagAAr9UP/Awhm9OfaI/zvg9HlT5f\nk9J0EyNf3+DYBP/A/KjvKbCcuI8lAXmcWAbZzNn/UZ85bw7Uo2Zib32v9i2Q\nQq/jC/BUDFSG+dti4VlH+JJCg43igztKzCrUKYFOK40jkN/Do2lCemKWyi0/\nsDiWVIwFrMeXz7wmrjRjXVWF9dssds5fzMwxoKKRKEDVyXgqlzuh43pcjCCW\ndnP30VRPnEPMbdIHvMx9LnC8GXxx0Z2ljbMulSYpYnedhUUp5G+81p237225\n6GKrdffyg3tkzJ+7acBHXlM4T54y+5Thc+AEUrVgvefea6Vat90M7pckXzwz\n4gQTJzDGYWW2mOlqnbr3KcQ8DA5XD6iIrb/9qh2WFWx68W37QogGYsYWeRSM\nwiYbYBDQV8OSJv6BC9srjmwO2qrE0okUpmpkZIbarhxNmnLC63RqCRKrtihg\nPxpkn2MpOMyhx4vlLOdXm+tBdTmbicNi2HTgZ+/mliIwKluZoM4GgOwb0MBq\nhR+t22/2YkDV20i6EzZPr3zpgMCUz4vWV9SR4V8yrnBKi7bH6mtDTrnx22qx\nIue3/TUxQFbbTF7Y1bDKqsHHYRSjTO7skKkjw8gV1DfIWiD1iQa1/IsQ+zbJ\n4OTbES+j7PIZlMtNCAES+3eA3zder/10iqrwOc5SZWhkLEdkL+pFBBDLYYCA\ncg6O\r\n=0plB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFhkb8QcVlNoN5Np/lU4XSezwux/02ut0rOgORenjSijAiAx5/SnjS3zZlqwVCeZ3yj/rEozI4mzg7AOcEbwTqV07w=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.0.2_1530286387603_0.20387644605751531"},"_hasShrinkwrap":false},"8.0.3-alpha.0":{"name":"wavefile","version":"8.0.3-alpha.0","description":"Read and write huge wav files. Small ones too.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- **All MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 32kb minified\r\n- Made with Closure Compiler in mind (works great with others, too)\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Uint8Array} */\r\n    \"samples\": new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"d4668e3022c7f86523e87d0d8ff861ba93e8586a","_id":"wavefile@8.0.3-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-DchMT7yBBlqV5cILYBhDoYZ8WbvILlpM6jqLjjb48NaFsuiSOxUFPtXLx/5rYzdl1GaGXYltA1vuwVaXxjzooQ==","shasum":"7f1c0b1b24ce4bef7401a3a0bfd3c4e3ae2baa4b","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.0.3-alpha.0.tgz","fileCount":13,"unpackedSize":460981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbOuxgCRA9TVsSAnZWagAAy70QAKJSrP13MVU3TlAxm2Kz\n6lwWpyUpUXhvV+0ORedbR9U1khtf/NIUhQVz7qIffdLm8ON4s6q2f7H7m8sC\nGQTUxTJZPppL8rdBZIJFGNamGAc73N1BHcam0/hngkk3jOcIQ6JcpoaUxCji\n8uZavLAObw/pjbd0IJNZe9OPOuHn1RzLZlwU3Ae1A8xkoFgjnuijL1xt9VfK\nczwwQbltpy0guiMwePgfLG71peAHv1cBEqrJF6f+ngBwCzKSS7d27WYMDiRl\nXhxpU8N4XEhSXI5gcoWRz9q2jdW7vBEibbshzOIR8OfBvk5fJ78cG9MHhKfz\n8263bQ+aNKUdI15Te9H42wyq6mcoVW1MYA9Ei7ZtcRiRNLRE0QvNbROVpNbc\nlyE2HgC9dyiCtxo5JfO2bplViRdD/4txhnaHW4Nbp7jvsueWi8Z52K0Ty0DL\nr7UynpivRC3tjkcGuW+/LeQc3JOwrfxj9HiDQ8YswUjWUYVdcaNpcW8gyhxk\nZblnwi98+sNFcBLAaYFAl5NW6Ny1R05yQd4Zqd5dxDRZPlZ5wGpyRyqQzjxX\nbYoNP7cTbNirncQQ11BinA9bxMu4czoMkeklo4DQLdzkyw+zhBR4N21EZllY\nYPE4NAMioMXbttfHdiZU073JceUo1oBez9fQQ7pY9Z3HdLDqfkRnxbBFFfAc\nXlDj\r\n=8Xi6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChsy2fhXuhnF8hWI2jdF3K4ett4TiO8soZDjQLJ2c4aAIhAIdlAdhd6KKBHY2J7Z+i+7qi5c41bL9akAgj6vxX59W1"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.0.3-alpha.0_1530588255885_0.6408939314590651"},"_hasShrinkwrap":false},"8.0.3":{"name":"wavefile","version":"8.0.3","description":"Read and write huge wav files. Small ones too.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"gitHead":"57607e50a856f19cd963401783d5e5a8d280ca43","_id":"wavefile@8.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-7wiDQDypax/JXYMAaFJw/988tvfyIIjLIWfR3+YBX9d7L7UP+FGUkeG6PVw+fk3hCJF64VMUhxNYjs9gFSR30w==","shasum":"5b7f50adf51e46b4c5591678054069bc1db44926","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.0.3.tgz","fileCount":13,"unpackedSize":460973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbOvrWCRA9TVsSAnZWagAAEZcP/AtCg+ya/+FdahD0CLxi\nKNffILVJwnfyq5D/hAQssGn89n2QTlnkueYvs8Hurw9bsBcgPxdJlcE2vNTd\n7AvZsBckJCZbVtGlaToBVnM0DuBByizQR33/A405UFnS4I8p3R2DFfkAAopu\nLXEf/WnrFftqTvEwuntrsfw5X6z2j1sESbV6ehHnLM2xErEhTtJl+2mdKu3E\nxAIMDIKNxyitfpvL1zOzYiuS/BC/Z7akAEpjYYV3h7o1QpAMX77DpEuZ687a\nqsMGgluHf5vv+Swo25FkkGENblT6GOHOcZl3Hq+uPYNt8E1/uaeyOG3UJG09\nIIYlZ4uQtKOGSyv6r5ErvzA15fotXA/FDuysf1RThiwriD6MJOObHD+1isb9\nIc2WBWeIRzJ92UdT15QPLAK9mJJlTqsP7jEkImGuHUtNPq4rvPQQAXUzJQd3\nAtm3xLHDssWBBELapvYcUC1QS+NvWI5ckaNgC5N5I/nlW+Ba8L8DZWnSTdvD\nB3eGp1MSx3INRKcDXx15aEhgiLhfEnkz1GzcDibjWTSVK4A4zTvhGb99jrfJ\n73VCqEV63Odv7A0aO0vLV2MGbrdan4O8y8YdQZ+ky2ZHmAG6kcP3BrE24Hy2\nw0I0+qV01O+tX8iFb3R7t+sriu+yegesMBUTcEo2I22fKNcMXpnb13GZ8855\nZxdT\r\n=CliY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqfi3BoM6Hxc+g8ZDXJsAVZL8J+MH/SwTIh5010oR6xgIhAJYReBvVQAJ8AXOlVjH5jEPRQhzOO+b+6LTQklvUB93V"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.0.3_1530591958438_0.3788706776625623"},"_hasShrinkwrap":false},"8.1.0-alpha.0":{"name":"wavefile","version":"8.1.0-alpha.0","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- **Works as a command line tool**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- **All MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 32kb minified\r\n- Made with Closure Compiler in mind (works great with others, too)\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nAnd then to see the available options:\r\n```\r\nwavefile --help\r\n```\r\nRead more about the [command line interface](#cli-usage) below.\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Uint8Array} */\r\n    \"samples\": new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"88713158014ba61ad57328a4f60b30f9cf032483","_id":"wavefile@8.1.0-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-UmujKQWkHY4LUuRC9c8tKpz0wYziOjqP/2HNx+VMgg5VZMP0OZTcUHj6XA/NNQ1tNHKHvcQ1hgjW0Qtol265Eg==","shasum":"9ced195f2a10697fc3c59f0c7d93de392a6a34f5","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.0-alpha.0.tgz","fileCount":14,"unpackedSize":464806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPFNkCRA9TVsSAnZWagAA3DgP/1Zsg7ZfOBYnmVvXv6Ae\nNA738/veeg/DXIfS6KZiSfg5SUU5Iq5PZ+rjaAjGGOxPiRWKjVmJKRgkGQcZ\nFjaowITXXMLbs0+C9s9FK7c7jhBvsAdN7270gKu47tEAiYEX+g5xr17K+WTA\nDCm5GUNwhGuoUMZ2BlC2+7KSTh7UUrP5FONy4W5HeqWn+AfLE9L8Sb9AH3JP\nxSbNClwXkjsqY980W1xSzJnVHwhieE3biyJP1xP+ygQrY4+dGREboOKNPS5C\nUTLBX0SvRz/M1Prv29DBw/xjVKWOUE75JqBf0rXVYaJ258oJ2UKcCH4t+C4k\ntcBSIx0i8ccg1Sc2IAQYdShyKyHKV1ee1voEnMDDN9QIYRQYlVOUZYI75lcL\nFxcVDdQ04hdWMezJG0jU/p76SuJOC4rCEhOoW4Und2DRsn46S64xkcHPJNvk\nqBJTuIM88rbr2Y0RYk9xu/wpqSF1IUsCREvMCm59f/kQlZmH4zrt4tgF5ton\nzpWIKBujwMOFGu7R0KG+Fft1BdWcvnd5gRCut9iIAeKHgOrzctcFDatGxXRd\nzXvl4C+7J+RHYQKfMd83W3Jue1IigVsa4Yc64lMSL2Y+9enafp+LH1uy4sVS\nTBATU8LocU1MWq5/NJyjoeedc6qRbmbm93EXKjyo3K+EHNwlIkDRx4eIK5HJ\ngR+Z\r\n=UJjt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGuehfQDAi6qDKuQaF6E4vOMoKQC0W0IGBe7W7z8sQZQAiEAwIMXbfybSEYM8uf1oi1jGT+P7PtEnV3VMYuMujTFD8U="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.0-alpha.0_1530680164273_0.5649510026036049"},"_hasShrinkwrap":false},"8.1.0-alpha.1":{"name":"wavefile","version":"8.1.0-alpha.1","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- **Works as a command line tool**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- **All MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 32kb minified\r\n- Made with Closure Compiler in mind (works great with others, too)\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nAnd then to see the available options:\r\n```\r\nwavefile --help\r\n```\r\nRead more about the [command line interface](#cli-usage) below.\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Uint8Array} */\r\n    \"samples\": new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"88713158014ba61ad57328a4f60b30f9cf032483","_id":"wavefile@8.1.0-alpha.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-fbYnpyR1eXQoOU3tnOafs5Hf7mQD2VkC6/XZSiNiTaov4R5u3TXoIT8JOHWVr8FyQTtOGe4d/QnX2hpGxIEfRQ==","shasum":"883f8735f2c08e02db02a7643de69a45c68d64ff","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.0-alpha.1.tgz","fileCount":14,"unpackedSize":464784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPFiUCRA9TVsSAnZWagAAXlEQAI2O7YjyegHogteEf9P8\nD6eugmpfWLeHrERw1OzhxKJ89HdQjAvoAtQobPWNMXhURr1vPem/Uc6yn420\nlNY6a4yCozBfkve5hcP4bC2e+LBOqheGYiWhB1xZEeqQICAjeZ7y6fOnWhAv\nujeuVolDm2LlRrSzsy97T6VoS/LCOdmsyqdLiD7TYK1Xw04lAA57dHH36cU2\nUO7cpxLqO3xZrRiU+XuZsrZ1apA7ip+XBGFFzCwe/FO2RdlsfobTQ0qfPkZh\nD7q8K2T3OGY1HpyA9XVeQAVYRFwxJfc6X8nNtqlsj9Mt/vx+wftLLpRSnM0x\nLsHPRe/cY1tkYgf/JAK3Bw6CN7S58rtg1odLG5P2RI92DFH8Rr+SYfcVSZMS\nSrJgI3iEdIG7ROgiw7zuAiPjR+mDKg/mZdaJtEDdETqxmXOzl/767clJQiq3\nO//otIwzXbfrSUkeuxofIO/yElanZzp3LV98Y/WHEAVWbKEhPLFNWa+iqWE8\nyKJe41xmKOHHndiQrVh8lereX97hqwdQWJIFsRAgktfIhbkFVDuJSb0hA5uh\nSI27qEna0lfoIcVq0XB7O4dElpjAqbJb7XsbfFmpxOhrltCVbhfSgmS+lsyp\nhYwV0Pga2Kd+g4elf90t+mgm32tjnDUzxwE91Woia4LuUDliIBv3jwwWrRgQ\nE4xE\r\n=1dUw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFI2lTXhzvDeQt6xq//GKkEx0tFFgyPXrumwsEBlGd5DAiEA1+SmKe4zufHO9IQVafCWwys/CPRZb+TrxNQ5YZ/++dw="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.0-alpha.1_1530681492010_0.7001893511793524"},"_hasShrinkwrap":false},"8.1.0-alpha.2":{"name":"wavefile","version":"8.1.0-alpha.2","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.umd.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- **Works as a command line tool**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- **All MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 32kb minified\r\n- Made with Closure Compiler in mind (works great with others, too)\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nAnd then to see the available options:\r\n```\r\nwavefile --help\r\n```\r\nRead more about the [command line interface](#cli-usage) below.\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Uint8Array} */\r\n    \"samples\": new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"88713158014ba61ad57328a4f60b30f9cf032483","_id":"wavefile@8.1.0-alpha.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-FCUMv0G/xVvo6GDF9C0HE8ybm7EqdWdqWUBFJbzJbNtmTgiJpkZtBjUuSHzmEOaM19X1U5erWI2Sq4feOqK0pw==","shasum":"60687ad202af9e9c117e4a4515fafc124919f319","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.0-alpha.2.tgz","fileCount":13,"unpackedSize":398733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPFnbCRA9TVsSAnZWagAAdWQP/1GkcU/OaKdEWOUnbIz9\nmV4zMT0r6TIpuD9IyrE8p9HZ5WxP4wSRaFz4qhPTH8OJRMRr3zBzt53QjidD\n9OABc5d5wa+R5evo9LLTPbqdUAOYYKlS0Gqob2fmYietv5dBFpSTUlGak8aP\nQywRKXGzqu/vI407vhKztSdjaWP35oQqj/xUsChSr0qzQDJGKdpPXWrLtT8L\n/XVtcOwBUMTUwOe/BnoF8HpBb0PZ/bH5Ww35pd1k8l3B+SFwO/NQ3aEbpjcZ\n0Gf4V5sqbKSeUCVUP7Ytokky6vH2PrqobaumANGmrHpGNwSpTzx1ueG6/iRt\nfixLY0jzxMqOelUPOdHbIxjJ2LHicb4Nsv/tIOmop6rS4ZR88Ko36OPGb7IR\nDjkEwVLv9a5bXbdySZscf94f3DKB8TTnXv478mxrEmdAZXnxdp7V16gmBi4Y\nnAPoLGeLfGzBG22rjaKURytRLd6bJwX3wFS4Pd3XifMccq+m7Mrvn6H4b3mT\n26oKFkQiUSzEN+AQFMYMyL9cjQFqeGNkrJ53zPfDUS9iBSLhb5v71YCsNK/1\npS0eiUgDjstSP2gI8Yc5PA0hEPU9aufmtAFdt5RFS/Tywg8Amc+/JLlajRNd\npZ4HMURDobMyo4KS+yxM41jGmUzfBuKV3GVgzdevCDFXTIPMMYnpz0SseHLe\n6NNC\r\n=hlyx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2UfmcjCAMKCGO/mnLPIBukgOGzA66sceSvdC2rG6LgQIhAI2CuSaW3nDpB9jZYpbK+PD3vHImKlBPa9quyD+/1uoM"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.0-alpha.2_1530681819829_0.733792661777227"},"_hasShrinkwrap":false},"8.1.0-alpha.3":{"name":"wavefile","version":"8.1.0-alpha.3","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.umd.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- **Works as a command line tool**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- **All MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 32kb minified\r\n- Made with Closure Compiler in mind (works great with others, too)\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nAnd then to see the available options:\r\n```\r\nwavefile --help\r\n```\r\nRead more about the [command line interface](#cli-usage) below.\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Uint8Array} */\r\n    \"samples\": new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"49b49af8e94a143eb8a1166cfe46fa833408b26f","_id":"wavefile@8.1.0-alpha.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-nTOaaxEUN+KqGjaBEvLhvKu8zza8w2oouTn6mV/7A8AdWu9OLkwve72O+WKD4hYIuMq/5mcWDIiPZPES4BECNg==","shasum":"1fc8f79134e16054444f70f355568ca8d7db8ce7","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.0-alpha.3.tgz","fileCount":14,"unpackedSize":517163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPF5+CRA9TVsSAnZWagAA0UwP/3S/vEq9QLeZsEY3xfWJ\nynPxkB8bTp+x61W+l+uO8Itpq/kWRtA+DJb75mFlemqFgukV4LSfaNgFSVjv\nAze0TPUzqTYsCbJr4zghpfzYzPDKoj5TAUrYKjoF+gVPxgrfZcgSemmXFqax\n5WQZkDeQNBj5eqk85LH4vhXAHLT+r//XAfrXnAzmq6QfgWpUjHhh0EjeBs2i\n5QU2YTQEB01PrjA6Gnk+IJPtr7Iz8mknNv5Pic9C7yYkVfnkzw6eguzoTPWN\ntPBQyF4ZwO7M2tJep+fPJMs9xCtTvnSyCQ1b79Dn6FMCzPEtXnyIF9nqLees\nw6pNSDOHdqDxaZlt7cfR54IF6/wTlir4g0M0VLyfWcV7TKUQqx4hU0nUc0uE\n1cXcDTBfyh7lH544YwWioe7EmSvpDlH3ibS6g0gtg8CG1KPUNjeQP7WA/AdC\ntVwOgs4V9K8t+b3K4GIbK8rQEQV/8rPmcfHfcQtRguPnjWrItH5BWKhD0iU/\ndbbOmL516bE8xjBZQGfJDkdHCHFIhjaUs9jHf1vzSf58uOeJAtgYBYmuauV/\n1Uz5oTLf6aR3JJ37s6MkObbCARDdksTELROuwMTr8PriRc/EDpAMwaZKX+OA\nKcvh545v6FTGkw71Eps6d+QakCKjMQCjSlKUcaJOncYM46inYD1ktGk4InHq\nJojD\r\n=ArGc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEo8E5JvpbIeVCEVKGIGALfmg/cPydr6uKARR5RRdvDuAiAKz+saIS9NKNuSUdj79TO33YdWsnccwwzAceDQf7cZ2w=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.0-alpha.3_1530683006669_0.9476003860194009"},"_hasShrinkwrap":false},"8.1.0-alpha.4":{"name":"wavefile","version":"8.1.0-alpha.4","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- **Works as a command line tool**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- **All MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 32kb minified\r\n- Made with Closure Compiler in mind (works great with others, too)\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nAnd then to see the available options:\r\n```\r\nwavefile --help\r\n```\r\nRead more about the [command line interface](#cli-usage) below.\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Uint8Array} */\r\n    \"samples\": new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"49b49af8e94a143eb8a1166cfe46fa833408b26f","_id":"wavefile@8.1.0-alpha.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-jjtc5ROdsJ36j32gx7tPKtkElDHS7k/yxUaXYDxgWGAwJ8j50NjcENUZyMgTJulZfLH4CaP+mSQOutcIGJCDNQ==","shasum":"bf9e737d5b660890a1ccb83be10b7a049e6a8c99","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.0-alpha.4.tgz","fileCount":14,"unpackedSize":517163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPF79CRA9TVsSAnZWagAAQg8P/0Lpouh4gjEa8vyRObZG\nExmVV/YnvEiDU4W2GwrGRsWFIKI1L9p9L6cXYVZbKtBxVv6zKOPeaWMMPLsA\nImqyTFfbHPIbficdp3ht0Kcy8HddLdU+7ZIc+k7qeHeBdcY6PlzWd1SUdCwe\nTVtb6Jj/8I0XHB1s96inmbt25013doJBphKxzLji420m89Bo2eU8X9ZkL0Ci\nakn1HCMYr0vRAPl3yTPzscFaxf3D5+UrHUDH8oJgUio6ZBBJlcKGyIeoB3Cp\nMXIFthdxziN5n5j4U6PIZ/SY32AGCDu/esQob0WVOk+csM/rwaaFld0ABlik\n5dt+m17q2egwvtvDt7bHwFsg4M4kLE+8IxysPiPZG8FFtbipbG3WzA8BWbG1\nhKIAALVnoy5FNSv5+sYN2MYU0ZWrdv2spcV86TVnBD786HqVIi2CmAQ3b8EY\nrnu5PBCCBZmR1fT6EjdNf7KMRtAMHjfjsUAOWr/RNMmmF8QLMScgXiuQ4To4\nJLJLc34hUhZR4BMiC23GSLVJvdlKPQV6AsUZzlrtUsK/570tffQuApPjJz4n\ndDzQXN6LD0eUXMmmt1UezUAQ14nv6Shk/hIwDSNW/CZRxwMYSo4YyuHzmXO7\ni7+St4rNOhERDlWOY184XgjpxHkaYgP+CvIWCC3+MwT9cSY+3/64E/gv/eWe\ncc9E\r\n=RP79\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDHK9ZHTL9yJodQ+jJFxyD5wGbA4bCWMhSrz1BzfO7tQIgVUtqtCI6CSksjxUVaq87H9qBx3M0JimS+wu7ER1F5jQ="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.0-alpha.4_1530683133703_0.6280131526243673"},"_hasShrinkwrap":false},"8.1.0-alpha.5":{"name":"wavefile","version":"8.1.0-alpha.5","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- **Works as a command line tool**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- **All MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 32kb minified\r\n- Made with Closure Compiler in mind (works great with others, too)\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nAnd then to see the available options:\r\n```\r\nwavefile --help\r\n```\r\nRead more about the [command line interface](#cli-usage) below.\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Uint8Array} */\r\n    \"samples\": new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"8ce10e4fafbcf3b579ee3197be4c0f401db5d918","_id":"wavefile@8.1.0-alpha.5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-NucSC0HwseuwOgaqPLEuXSPMMu8hbkDQrTrJbdYbTMOR8APRseBZOT9t/uXraxzGBV6ZUgn4eiI3ycHDK2rnOQ==","shasum":"edec9b34e9e6aeb8b884c7bedc2da7335beb45f3","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.0-alpha.5.tgz","fileCount":14,"unpackedSize":517163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPGOdCRA9TVsSAnZWagAABfkP/1zrsRC4tUQEaL9I0AX3\neDhMn6HfMPSgP7EylwDvH2w3bBj572h08PUPH/qKzcGy/1YItl8qoVoa4tin\nQSSA3zOrmt8nAlf5zdATe745AEjpQFOsDgkJPLLgNsBQ1fwLHZW24SNUZr12\nfMeOi8kMKYUQ3nTxWlUcLz6GO98WcDjLvDJUcWBf5Xj9rRjZ98rQe7zIz6g1\nvTwFyAyntHQTB0mTP9tJG8qKTECfCSW63BJBYQmrt/Y3Mcu+FXj2BZz8A4F/\npffzY/IFc0b8/OozpcPBek5bDkKkS4BFz7But50EUFU0lsw+/iJNOO6dlJbF\nT8VKq5q5BEbAh8gAaCeeYX3y8sXb6q+hFqFF+8qh24lV3ha2QDsMtLEwmcml\n8hUZG9OIEo9hMr7S60gWzcIjilKgcDwM/f4H8ktArJghyi7pc0iBVKLTWVDJ\nwpq7gKX6uIwenhZbKa0CnBSKBE2eMlAkTGGC7H/iLLh+ocFT8vsE3Fp4IAdk\nKxV5ZB/1kXq0a6sjPQd8vu4CXgS0cUhSqZRYZDaLrWDP60OJuvbt6fs+Gx49\nrrUq5kyD/ft2Hxq2Yc98bPL2bV7gMAp35N0rhAQtdkbarFNm0V/3GF1iehRm\nF2pJLAJK5vUNIA4CUb9uaiIJDR6GZGcSeDKUaNiRRA7Dl/Z5Wr1JAyHjHods\nQBU0\r\n=GBEL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/qzj9kHSd04pJwLO+HM3W2wgdUrzycA51/f8AIbTlcAiEAzeGsWRjrN4CXqRMA7TcGiwUKX8i+k+IH9pSxGLky2zo="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.0-alpha.5_1530684316976_0.2811576663562727"},"_hasShrinkwrap":false},"8.1.0-alpha.6":{"name":"wavefile","version":"8.1.0-alpha.6","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- **Works as a command line tool**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- **All MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 32kb minified\r\n- Made with Closure Compiler in mind (works great with others, too)\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nAnd then to see the available options:\r\n```\r\nwavefile --help\r\n```\r\nRead more about the [command line interface](#cli-usage) below.\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Uint8Array} */\r\n    \"samples\": new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"8ce10e4fafbcf3b579ee3197be4c0f401db5d918","_id":"wavefile@8.1.0-alpha.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-Vta6sMG9UM+8i6tYzpp0ld7adHaf7/GVdJUpdQZTJWPwe8IkRG/U6yu9viiBqHRxuZpD7o1deGZbjh53arnUMg==","shasum":"b48529c151f44ed6f7f891cfe437b96fa84bf714","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.0-alpha.6.tgz","fileCount":10,"unpackedSize":123445,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPGnrCRA9TVsSAnZWagAAo2MP/0VorkAv+v8iOJVs9ppr\n1K8HHtItRn5PGudn63q1HJXYe9QYSvtEaaOdguRbLW3trVaYtHKCy2Zs02e3\n0QVvsEti9uODYYfolDVq8/FLkEsHnQxBGGZxIiiUI+4r6cyj5dTve1t9HB/o\nC5PN7k3sFFSmWUp5RetqEg3y6a6Z/pTCAsK8c9e7BdcqFyGNUFmSFBsjZPMv\n5OZYfXjAUv335Ms0Mej+JubmTTUj7XRHcSAhC/hzBtyHxsP3iX6SLnL6agXB\nbIXmqAoxNmnkrp5dxGnYM6Y5urJRlomYPzGUBiP+J727RbTMxKfQcNp1aZks\nGJyYBJZTZyzqeuhed7bcekhrOUynYMHyvE49M8th3BdBH62X7Na6mWag+f4l\nsEg3j1xV7m/miCQx24wOjnuPoIPm5Jl3kj3KQgm3Pp84cgfIpExsoPTA38T1\nCq05B5VyEyRKyGpFx/6zb/IYOAM04XnfeUFRShltieaxfujmQIToYUtvOVXR\nR/y4OjvKjjAsQnNJGUoSRcexEzFepQwtU1SdoJc+qW0tuZxir9P4j1rBAp4u\nMphWR9JFe2W1jbwfVp332YYCUTRRoVYh2vRmcrqUCJR6TXrbjQTCTN+RMWok\nmM4KnnvihG1wwSTRgCdoSownSGAgccL8b2SEBiuCnmk9Ke8RbK0+S2auheGk\n0U+C\r\n=2oOa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGfPJzpmFBjjwFpWrjtEix2O5XeQxb//7hTS+Bywy3EAiEA6gLxFaVPP/VsQld4Jsa9sxbMAZ2vGudHlNxmZUtOx9Q="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.0-alpha.6_1530685931741_0.26497904517794946"},"_hasShrinkwrap":false},"8.1.0-alpha.7":{"name":"wavefile","version":"8.1.0-alpha.7","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Example](https://img.shields.io/badge/example-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/example)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n**wavefile** is a JavaScript module to work with .wav files.\r\n\r\n- **Works out of the box in the browser**\r\n- **Works out of the box in Node**\r\n- **Works out of the box with TypeScript**\r\n- **Works with huge wave files**\r\n- **Works as a command line tool**\r\n- Create wave files from scratch\r\n- Read and write tags on .wav files\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX files to RIFF\r\n- **Create or edit BWF metadata** (\"bext\" chunk)\r\n- Change the bit depth of the audio\r\n- **All MIT-licensed**\r\n- Less than 10kb minified + compressed, less than 32kb minified\r\n- Made with Closure Compiler in mind (works great with others, too)\r\n\r\nAnd more.\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Install\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nAnd then to see the available options:\r\n```\r\nwavefile --help\r\n```\r\nRead more about the [command line interface](#cli-usage) below.\r\n\r\n## Use\r\n\r\n### ES6\r\nimport WaveFile from **wavefile.js**:\r\n```javascript\r\nimport WaveFile from 'wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Node\r\nRequire WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder:\r\n```html\r\n<script src=\"wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://www.jsdelivr.com) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** supports all browsers that are ES5-compliant (IE8 and below are not supported).\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth=\"16\") {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl=\"\") {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = \"\";\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always \"WAVE\".\r\n * @type {string}\r\n */\r\nWaveFile.format = \"\";\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"audioFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"numChannels\": 0,\r\n    /** @export @type {number} */\r\n    \"sampleRate\": 0,\r\n    /** @export @type {number} */\r\n    \"byteRate\": 0,\r\n    /** @export @type {number} */\r\n    \"blockAlign\": 0,\r\n    /** @export @type {number} */\r\n    \"bitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"cbSize\": 0,\r\n    /** @export @type {number} */\r\n    \"validBitsPerSample\": 0,\r\n    /** @export @type {number} */\r\n    \"dwChannelMask\": 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"subformat\": []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSampleLength\": 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwCuePoints\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"points\": [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"dwManufacturer\": 0,\r\n    /** @export @type {number} */\r\n    \"dwProduct\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplePeriod\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIUnityNote\": 0,\r\n    /** @export @type {number} */\r\n    \"dwMIDIPitchFraction\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEFormat\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSMPTEOffset\": 0,\r\n    /** @export @type {number} */\r\n    \"dwNumSampleLoops\": 0,\r\n    /** @export @type {number} */\r\n    \"dwSamplerData\": 0,\r\n    /** @export @type {!Array<!Object>} */\r\n    \"loops\": [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {string} */\r\n    \"description\": \"\", //256\r\n    /** @export @type {string} */\r\n    \"originator\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originatorReference\": \"\", //32\r\n    /** @export @type {string} */\r\n    \"originationDate\": \"\", //10\r\n    /** @export @type {string} */\r\n    \"originationTime\": \"\", //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @export @type {!Array<number>}\r\n     */\r\n    \"timeReference\": [0, 0],\r\n    /** @export @type {number} */\r\n    \"version\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"UMID\": \"\", // 64 chars\r\n    /** @export @type {number} */\r\n    \"loudnessValue\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"loudnessRange\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxTruePeakLevel\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxMomentaryLoudness\": 0, //WORD\r\n    /** @export @type {number} */\r\n    \"maxShortTermLoudness\": 0, //WORD\r\n    /** @export @type {string} */\r\n    \"reserved\": \"\", //180\r\n    /** @export @type {string} */\r\n    \"codingHistory\": \"\" // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {number} */\r\n    \"riffSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"riffSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"dataSizeLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"originationTime\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountHigh\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    \"sampleCountLow\": 0, // DWORD\r\n    /** @export @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @export @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Uint8Array} */\r\n    \"samples\": new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list must have this signature:\r\n *  {\r\n *      \"chunkId\": \"\",\r\n *      \"chunkSize\": 0,\r\n *      \"format\": \"\",\r\n *      \"subChunks\": []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @export @type {string} */\r\n    \"chunkId\": \"\",\r\n    /** @export @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @export @type {!Array<number>} */\r\n    \"chunkData\": []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  \"\";\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": 0, // a cue point ID\r\n    \"dwPosition\": 0,\r\n    \"fccChunk\": 0,\r\n    \"dwChunkStart\": 0,\r\n    \"dwBlockStart\": 0,\r\n    \"dwSampleOffset\": 0,\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    \"dwName\": \"\", // a cue point ID\r\n    \"dwType\": 0,\r\n    \"dwStart\": 0,\r\n    \"dwEnd\": 0,\r\n    \"dwFraction\": 0,\r\n    \"dwPlayCount\": 0,\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\n*WaveFile.LIST* is an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\", // always 'LIST'\r\n    /** @type {number} */\r\n    \"chunkSize\": 0,\r\n    /** @type {string} */\r\n    \"format\": \"\", // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    \"subChunks\": []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects with this signature:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    \"chunkId\": \"\" // some RIFF tag\r\n    /** @type {number} */\r\n    \"chunkSize\" 0,\r\n    /** @type {string} */\r\n    \"value\": \"\"\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **wavefile.umd.js** and **wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://www.unpkg.com):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://www.jsdelivr.com):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** is the dist file used by Node. It is served in the \"main\" field of package.json. It includes all the sources but no dependencies. Dependencies will be imported from the **node_modules** folder. This is the source you are running when you **npm install wavefile**.\r\n\r\n- The **UMD** module is compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json. It includes all dependencies. This file is not compiled/minified as it may be used by module bundlers. Compilation/minification should be up to the bundler consuming this file.\r\n\r\n- The **compiled dist** is browser-only and should be the one served by CDNs. It includes all the dependencies. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **wavefile.js**, served as \"es2015\" in package.json. It includes all the dependencies. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. It should be used by systems that support ES modules and are aware of Node's module path resolution (a module bundler, for instance). This should be the entry point for bundlers in most cases - this will avoid code duplication in the case of shared dependencies (as opposed to using \"browser\" as the entry point).\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"fac46208cfb47f7696e20e1cd816a21bf7af89a5","_id":"wavefile@8.1.0-alpha.7","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-SWBJVDl45iEqN3by5McojhrJHlwIAugb5xglmW2GCDxatZHZNmEvAKExf9AQRKS0Zfa04Jsr59icDgouesxWfg==","shasum":"b17d7a3ec0dd67f9946c983de89c48879cf64150","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.0-alpha.7.tgz","fileCount":14,"unpackedSize":517534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPGuYCRA9TVsSAnZWagAArxIP/1umw90h/cvNNGkJPx02\nm3iOEfNoA55WlpyiLkdiMepmE+1DnKMBihkg/mfKyny3w8q8flgeRJ2UDaOl\nSWarfFgRf4mUcyQVZdXxvq+I4rLlswLutFjEx42v35ZhDXKL9q285mV+xCPK\neDdr8UfS75BwBe2SBUNnDAhU0GzrhUagZFJ4jmHFJa1ipDGMDjS+Ni5DNPGF\nJ021hAtochjOR4J5kLersr6+aYnIeVJltz2HWE9RirOJVyKYNKNugQoobQqI\n/RQFLeEIqASERN+FE7yJiA59VGeR6MV9NV9LWizDR8iJHPV2SGl8Gk6RBc8W\nO2P513VjOSW+V+SLfod6RP7n/QQBDtVBuWQ6cCwCN+09KcYTiis+Z3QeY3Y8\nDCMU320IaVW8BVtHa1nIj37IRBdSrB/DRIz4OTMzVLmZL0vT6FuEmqbeLsTz\n5XLsL7wk+J2Si3I/ZtklSlgPC23mM4U3E1Zxberx2SuthkAqrrDspDq8Q80Y\nOY33ez0IJTVAGFgGW/Eq2gWcz5LCDTeipr4/LD+beyZdHRnOnZLlygXpwksu\nac/kXmwJxdPCrfsBCoF+PIuPbNHL5qe4+v65dkbCUDHx9G7aFqmbEfIGK39A\nfWyak1O+0uxmvwOGOuzPyy73Kf8qM/DCgiaZ+Ba/UWVBFFDGB4uYbDCysrnx\nx6GN\r\n=Xz4O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvzUh29XueiGbColZo8qyU8gsXVQfkVJL96nnaf8SDlAIgdN0anSgfRN6XmK4qVLlrEtr4waGen3FgBK4aotba/aQ="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.0-alpha.7_1530686359884_0.29380508961375895"},"_hasShrinkwrap":false},"8.1.0":{"name":"wavefile","version":"8.1.0","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","read","write","create","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","compander","A-Law","mu-Law","cue","smpl","ltxt","bext","LIST","INFO"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"gitHead":"754c95a270c477a3f98508c80a6a196fdafc9cf2","_id":"wavefile@8.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-2ELR10YUljUMIzzwEw84aHshVJvsVR+s0LpXrQIEAmwYqcnq40kWov9LKC6a04o8gVm+xB6nT734unQlSseTjw==","shasum":"e2994178138d19bd53ec2ad21a82b061dff1e13a","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.0.tgz","fileCount":14,"unpackedSize":518035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPG6vCRA9TVsSAnZWagAAgFUP/0oH205MreROBR7UbGYv\nSACcLZBaLV2l3FqJQg2wliJmgGGOsMSgeyrZVrspntSn0YduUigMKbHQh1TO\nE8q/vuz9D436mjQ2HJWaQTvb9N8HwvS0/N3BeY3ajqCjg5LV40HWyvThASue\nkTVxpwqYOpaU9s5RXsZOhybWmOlbzM51ND1eQsiJslC9J0K1LQEBt6vzHdlf\nlsXL/RFYhVIoQzKZFC3C2fDkWbnBOgCBr8oH0eg6K/cTjpTrjocBnwrLO/1t\nr1FsbtIR6aICOFrVBVb3BhB9CqZpnBzQft83KOYPg//3WeDP5Zj4kPddFosc\nrOGCfnAinhdWmnrKIIML3H0SJXIEHiWEcYdvoz3ynErv/4MK0p2xodQ4JfXp\n2ovR9O09Mink8y7sd8MqVM6mJ8jzPUAKRykRibx75WXH1kM36W5lvJ2vjmjm\nZHR4gFdhaMqCXMmp5vWygs7bFVJlruNLkzBO+kuCprxfjMkVcUTbFH7TQvAS\nqahl2AjczJUqU0NDIcIH5mEvCbDjtRRP8WZuP1iFgPke6mAY8Nc8VYHhlG/c\nQUJ5ybbZ/n3P+3iXJknd7e2nsKBCiwOmz3Lp9lTJ33JkrzysKDejE3gzD1ud\nso/XPHgUCmrhVF76gSWXCuic4+eqlBzNMN2InH1HXAwbnbxTlQxRUopq/rLR\naN5k\r\n=4+T6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0el2Ib6yu9vQdQRvO4wh1VsjYYWX3GHXGtWs/FN9A5AiEAiB3Xo08PmFNmLcL09THrSdHt3K9Z0fMUPmm/web9XP4="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.0_1530687151382_0.8815459797444276"},"_hasShrinkwrap":false},"8.1.1":{"name":"wavefile","version":"8.1.1","description":"Read and write huge .wav files.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.1.0","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"gitHead":"8c39a26a87367756535ac8c82ff1f004e0ce0e90","_id":"wavefile@8.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-1zL3+rLpoc/JRWOvW/H4Hj6oZhSFdCjQxJAanyL1NH1HDXXChJxcayCC8wnvnoVXU+MPnM+9d22eUGaJG7SUaQ==","shasum":"5ee1e9ad36eed1850d6aea2e4cd5569127fa1461","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.1.tgz","fileCount":14,"unpackedSize":517762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPRwUCRA9TVsSAnZWagAA5O8P/iHNNKxae5jQpa3Brg84\n6xxXu8+EMS1EW1nyuYqdyGINf5ZhTbl0IzV/g6wbB1LQ1mGw2tBbNkPQ7zDQ\nI/W82yDH6re72BSvulGZ1RNTLF0KiGVPTJlhAGTGbRs8pXMg+BfLmrAE7FIW\nDRMDev5vRVNx7fQMDx1V/MtBwlGEvP/swQzBicuEtbQHNd/SuJcTFPQho+aQ\nhiOgmmRcviOu6vs+dnbA7mgFAXhr4h5jCmqEQkPypjT9dKHF2sd5OhrExcnn\njLySa/9Nfal9gzuqmNH76oewayIEfOEAYks56/KBJZCyOY1mOqxDI4hEPq7H\nXWgoMlDEFAAxzfD6jl/j01HxBlO0iYbZSNF4mEeoB9wA4yr/7pqQKFC0ZV7a\nbFgaP8LyfTdE8172Zx/mBddLTQVEiLYylDWEErEbuFb+IyrVRfVClq9Ko2s8\n+5Fyp/1BZH1E/geF+DBkBfnHnv6aXtZsdcuNRO3z8WVbov610osrZVt6rOKD\nCZ/BwOLoR/apfnrFiWfgThB/J8GqbCn5fuL8eG9iz3y00i+1JDqWgV0cLsn1\nad2ZZAl7X/KMfTmEsUKmpwI3NifGzXQ95q24sb4+W+khpyqI8QPuh6pZcKBi\nO3Empfms6svtLpz9p/vQH9qBjND3hfKutpbrizOpoh5s9TLLdxqvlei1EfvR\nIUVR\r\n=yvhM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6fhTuVJUTCiUXD1nmR3mPnjSfbjVQN92lkRCaq8mG+AIhALTe/U7mLbtRiNP46zjWyrK2rXFDtADIeSEUYwMkr9Vh"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.1_1530731540629_0.12691140279404367"},"_hasShrinkwrap":false},"8.1.2":{"name":"wavefile","version":"8.1.2","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test/dist --esm --require=esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.0","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.0","byte-data":"^13.2.1","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"gitHead":"cd393d81342510932d736adaca12c65bd3a2835d","_id":"wavefile@8.1.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-o42i2bPEbqr96gWyz3X6Ls6dr6V3EdDtxtY877rlNeyQ2u3bzIpxb/AQEW4pNk+m5gCCKiVREVOhi4+D4Qx6kA==","shasum":"f660c70a7aae2416d03736f47d3eacd7fc710b17","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.2.tgz","fileCount":14,"unpackedSize":523406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbP0ECCRA9TVsSAnZWagAALaIP/R0bwTJ/yDYlJTtTPOM2\nzBLFzamz9ZSKr88kQhXFkMO5/N2//efBDp9crOpBs0PIYSOZ4gIu5/Xc7qdK\n+QPSGe9Y6ZapRpaBEtyNtgIEtqHybrTdbVamAxqJ2rslgHrArs1HOn+bjN7v\nYo+GdAdFIjviB0Kw3FoQfsPo2t8ZYtpOdDOwQCUo/Oy6ZpvRMo840LkAkPid\nqY878cQKRvZp0wurNA5i27wqgDI0TIkVbKoYIUlw+wj6kstoCHSTT4KTgYZ6\nFirrNmT9T86YUhy0oho4iCRTaXasbT2UEJD0PejJPXnFzedZtiwZ/uoXMVHS\n5CuBcMrcIHf2khN8yw1FirB0m8yS0R8pzQO+3plbvC2nCFbpRNBHrQifvg5h\nE/MQ9ha/85DBpKqcKWdNDqVvNPvz5uirjKoD2t8K7eMlcGueYiOqDx+fJykS\nO0LSbnmhKuviPaW+/6z/dUg77OS6uzvjuz8/rg2ImvMmtQyS1EEYQDL24+Z2\n74HlXjThPKxSjbRy/wHCpBas7owfOYgREmt4cQVdnZN50k2EJE0MzQXeH/co\njUbGCji+LWlrske5T7ZVGIIfuThcMxKwMbsgSEAP5wm9yMxISlN0Vkpx/In+\n/LVyYoaNJGUn0BJmpwsf/PmCTGg0tDb9sjFHeHCTyvaNjA0GInp9MG9iWrOO\nbcWO\r\n=yNZN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJUxJ6zroZ9tBgIkDOBpZUsbXZdrQ72QJpRNLEN9ow1AiEA6oBOv95BcM9Qd1dC4mJDlr66/4Ui0stZ8rliXBnlQy0="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.2_1530872066414_0.1536856783334195"},"_hasShrinkwrap":false},"8.1.3":{"name":"wavefile","version":"8.1.3","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test/dist --esm --require=esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"browser-env":"^3.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.1","byte-data":"^13.2.3","imaadpcm":"^4.0.1","riff-chunks":"^8.0.2"},"gitHead":"4a50f5c7e7859f57a026340a169f17c8cc127638","_id":"wavefile@8.1.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-JG8CKwjtYCiQJclYsX7hxJL8PdlyPoGePIGmn3jk7gHilkhRiGC8qQZBJSDaOJUPtfplsTpuiIrLSE3UsG7bRw==","shasum":"c531eb252bf4e25864d71fcf2165d40c8f86d398","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.3.tgz","fileCount":14,"unpackedSize":466446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbQq6/CRA9TVsSAnZWagAAnt8QAIxzRtyNoj3aY8+RGE0K\nSO6Zuu2aHwhbCU/BqduKYLLI6HnRfJwqgiqoTywMbiQfDgq1QSO3BobAO/Jb\nPxAB7aA3HDTOzSY8m3+mlW+P+tB1SqwYf5gsLCVZBrVukkEljZ70eOCq8OtE\nvEJWTySHdgeGMCRaDYUymtse16SgHZk8IdcD4lS9dMsvWA9a5suuT32NvRPt\nqIKyuZcZ7Qxc/UdZNiWUyz8trqOnpFQwTM1kTdqNZyT+UQBxwjaSbZweusSH\niWsNgwVEcLitYJo23+mNoeVQhqe6v3g3vyPl/hfiDrY9pFgNNOdC0Dg5Lveb\niBB+KKiET8bfIk/CTTcz7oNYcU+PnUJ4CaBJUjGbbLutREZeCYQPIyNPSczc\nth3uDGMUOVSdTi5DYP7k1hvV5bj/CWBoTKzrVCQcwhfxgHhTKGPdtGS78d+Q\nJlEcZcFaXpUexCWWTSEyAK8OXMiezSbAW6D1mOh/dMlrZeBcTitWZXpwDs7f\nbGs465wKo91yhL+PyKh6b9E+WrBSPx5Oz1OWPFjmw7IjfHIzLDUI6iwSPMw2\nQhi6nWWtFMgsFK82HpgeXFe2b9iN30bD1d6aaxysyTp0Z4KWY0fQP+Xe9LUH\nGat4AYFUgQ7JbMy4BB0KBx56BlRjhp85hQTmYkX/FmfXjnak8y2yvlwMEdP4\niiuT\r\n=0ePr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+IDCYdq8rdh0ffus0d01VM1akGd2Wppr8SLVcJ99zqAiBOMv6qAitSQjysODt//Ovl+teywx2tB+PuRmJ69ChfEA=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.3_1531096766943_0.08046411337185644"},"_hasShrinkwrap":false},"8.1.4":{"name":"wavefile","version":"8.1.4","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael S. Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist","lib":"./lib","vendor":"./vendor"},"scripts":{"lint":"jshint index.js externs.js cli.js","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test/dist --esm --require=esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli","bundle":"rollup --config && npm run test-dist && npm run test","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","browser-env":"^3.2.5","byte-data":"^13.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{},"gitHead":"b7cf3e17cf3590c7df523ca4a1a01cf0380db964","_id":"wavefile@8.1.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-YxLukpaWMV57x7UE4eZeg7tp3dIryzoSe0svA9euetxn3A0UlZWDizQEH7sFBFsLBowetEY8sMCp6iv6C1XQGw==","shasum":"704002bb49a0138d918d64a20cd6d861b08a41a5","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.4.tgz","fileCount":23,"unpackedSize":611033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRDJKCRA9TVsSAnZWagAAfiUP/3Su7ZKi/RGNDctDXkeF\nwU5YIR/HeF9sPiJz8atFpJHEnE+9ThuKae14y1uRUO53qALb6z/oha3l79gi\npZne3jPNRiB0rlm7fP8r3YJnRVAVVXFxve/R9X5u0R3tYSsRDtd76zVqGLAh\nqGzHqwwlFPjGMUPRTKb+vHCi+WgCtZ+BQrJMoNb6Yp4UnLyDzvXdF+/ZKMyH\nS04yuWW/MqUSCS3fEjm0ENZrhWFG/pYvS8jpUbkTEQ8+12QZa+DoWP7zIxed\nvnAWDaqsW3fxZbuSd8zcwqGFeh+BqsfwyaR8FXF3F5aLysk/Az7sQ8p697zT\n2GAJFWhUHMR1VS3nftUsY0i3rwONG4sGMBbP6VFD1H87cWmgneQ7DNG0t1Wi\nrRNn00ypw+2bkcS/6i7ar5tKrLiZBsPa3db2WtPUrFY29H80x4HV4ZQKQ+YR\nRMe+IwqgX0adycHxGC0zaq2jw/YEhVMGWefq4l3kdlCAHyR4ZyQhsKLAWLn4\n2HjxD1GDx+V0KwD/4k/dk7M+D102WngGtKZvZaoQYTvn/KCQiwdaTCNgUZVg\nnoDcV+HO/CxbVv74xhaA6sFCVEDVUmiPoC2IPFOExtgyeJZlTK0mKgZIgIUz\nPVbf+DsIizpc4deKFrjBbh/DOfHLgpEVon4xAaCLYASezQivzc5eLG5uLp88\nFv/n\r\n=Dlrw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICqhsgMlyqbgRYslximGJZ2Azp6gK/U+xAYDkhoKiSC0AiEAtz9qZJv0Qpb71COt4NC7WhYwtfJqEDSP9LPFBxtTLlE="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.4_1531195978056_0.27639739514225936"},"_hasShrinkwrap":false},"8.1.5-alpha.0":{"name":"wavefile","version":"8.1.5-alpha.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"./dist","lib":"./lib","vendor":"./vendor"},"files":["./index.js","./cli.js","./externs.js","./index.d.ts","./LICENSE","./README.md","./AUTHORS.md","./CHANGELOG.md"],"scripts":{"lint":"jshint index.js externs.js cli.js lib","test":"nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"nyc ./node_modules/mocha/bin/_mocha test/dist --esm --require=esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd && npm run test-esm && npm run test-cli","bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Tests](https://img.shields.io/badge/tests-online-blue.svg?style=for-the-badge)](https://rawgit.com/rochars/wavefile/master/test/browser.html)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\nCreate, read and write wav files according to the specs.\r\n\r\n- **Zero dependencies**\r\n- **MIT-licensed**\r\n- **Use it out of the box in the browser**\r\n- **Use it out of the box in Node**\r\n- **Use it out of the box with TypeScript**\r\n- **Handle files up to 2GB**\r\n- **Use it as a command line tool**\r\n- **Less than 10kb minified + compressed, less than 34kb minified**\r\n- Made with [Closure Compiler](https://github.com/google/closure-compiler) in mind (works great with others, too)\r\n\r\nWith **wavefile** you can:\r\n\r\n- Create wav files\r\n- Read wav files\r\n- Change the bit depth of the audio\r\n- Read and write RIFF tags\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n\r\nAnd more.\r\n\r\n## Install\r\n\r\n### NPM\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the [command line](#cli-usage), install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\n### Yarn\r\nTo use it in your programs:\r\n```\r\nyarn add wavefile\r\n```\r\n\r\nTo use it from the [command line](#cli-usage), install it globally:\r\n```\r\nyarn global add wavefile\r\n```\r\n\r\n### GitHub\r\nThis is not recommended as it will also include test and build assets in your installation. If this is what you want, you can:\r\n```\r\ngit clone https://github.com/rochars/wavefile\r\n```\r\n\r\nAnd then import/require what you want from the *wavefile* folder:\r\n```\r\nconst WaveFile = require('./wavefile/dist/wavefile.umd.js');\r\n```\r\n\r\nYou can also download one of the files in the *./dist* folder:  \r\nhttps://github.com/rochars/wavefile/tree/master/dist\r\n\r\n## Use\r\n\r\n### Node\r\nIf you installed via [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com), require WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### ES module\r\nImport WaveFile from **wavefile.js** in the *./dist* folder of this package:\r\n```javascript\r\nimport WaveFile from './dist/wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder of this package:\r\n```html\r\n<script src=\"./dist/wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://cdn.jsdelivr.net/npm/wavefile) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://unpkg.com/wavefile):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** need IE10+ to run. All moderns browsers should work fine. Cross-browser tests are on the [ROADMAP](ROADMAP.md).\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth='16') {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth='16') {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth='16') {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl='') {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = '';\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always 'WAVE'.\r\n * @type {string}\r\n */\r\nWaveFile.format = '';\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    audioFormat: 0,\r\n    /** @type {number} */\r\n    numChannels: 0,\r\n    /** @type {number} */\r\n    sampleRate: 0,\r\n    /** @type {number} */\r\n    byteRate: 0,\r\n    /** @type {number} */\r\n    blockAlign: 0,\r\n    /** @type {number} */\r\n    bitsPerSample: 0,\r\n    /** @type {number} */\r\n    cbSize: 0,\r\n    /** @type {number} */\r\n    validBitsPerSample: 0,\r\n    /** @type {number} */\r\n    dwChannelMask: 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @type {!Array<number>}\r\n     */\r\n    subformat: []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwSampleLength: 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwCuePoints: 0,\r\n    /** @type {!Array<!Object>} */\r\n    points: [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwManufacturer: 0,\r\n    /** @type {number} */\r\n    dwProduct: 0,\r\n    /** @type {number} */\r\n    dwSamplePeriod: 0,\r\n    /** @type {number} */\r\n    dwMIDIUnityNote: 0,\r\n    /** @type {number} */\r\n    dwMIDIPitchFraction: 0,\r\n    /** @type {number} */\r\n    dwSMPTEFormat: 0,\r\n    /** @type {number} */\r\n    dwSMPTEOffset: 0,\r\n    /** @type {number} */\r\n    dwNumSampleLoops: 0,\r\n    /** @type {number} */\r\n    dwSamplerData: 0,\r\n    /** @type {!Array<!Object>} */\r\n    loops: [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {string} */\r\n    description: '', //256\r\n    /** @type {string} */\r\n    originator: '', //32\r\n    /** @type {string} */\r\n    originatorReference: '', //32\r\n    /** @type {string} */\r\n    originationDate: '', //10\r\n    /** @type {string} */\r\n    originationTime: '', //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @type {!Array<number>}\r\n     */\r\n    timeReference: [0, 0],\r\n    /** @type {number} */\r\n    version: 0, //WORD\r\n    /** @type {string} */\r\n    UMID: '', // 64 chars\r\n    /** @type {number} */\r\n    loudnessValue: 0, //WORD\r\n    /** @type {number} */\r\n    loudnessRange: 0, //WORD\r\n    /** @type {number} */\r\n    maxTruePeakLevel: 0, //WORD\r\n    /** @type {number} */\r\n    maxMomentaryLoudness: 0, //WORD\r\n    /** @type {number} */\r\n    maxShortTermLoudness: 0, //WORD\r\n    /** @type {string} */\r\n    reserved: '', //180\r\n    /** @type {string} */\r\n    codingHistory: '' // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    riffSizeHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    riffSizeLow: 0, // DWORD\r\n    /** @type {number} */\r\n    dataSizeHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    dataSizeLow: 0, // DWORD\r\n    /** @type {number} */\r\n    originationTime: 0, // DWORD\r\n    /** @type {number} */\r\n    sampleCountHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    sampleCountLow: 0, // DWORD\r\n    /** @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {!Uint8Array} */\r\n    samples: new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list look like this:\r\n *  {\r\n *      chunkId: '',\r\n *      chunkSize: 0,\r\n *      format: '',\r\n *      subChunks: []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {!Array<number>} */\r\n    chunkData: []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  '';\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    /** @type {number} */\r\n    dwName: 0, // a cue point ID\r\n    /** @type {number} */\r\n    dwPosition: 0,\r\n    /** @type {number} */\r\n    fccChunk: 0,\r\n    /** @type {number} */\r\n    dwChunkStart: 0,\r\n    /** @type {number} */\r\n    dwBlockStart: 0,\r\n    /** @type {number} */\r\n    dwSampleOffset: 0\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    dwName: '', // a cue point ID\r\n    /** @type {number} */\r\n    dwType: 0,\r\n    /** @type {number} */\r\n    dwStart: 0,\r\n    /** @type {number} */\r\n    dwEnd: 0,\r\n    /** @type {number} */\r\n    dwFraction: 0,\r\n    /** @type {number} */\r\n    dwPlayCount: 0\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\nItems in *WaveFile.LIST* are objects that look like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    chunkId: '', // always 'LIST'\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {string} */\r\n    format: '', // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    subChunks: []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    chunkId: '', // some RIFF tag\r\n    /** @type {number} */\r\n    chunkSize 0,\r\n    /** @type {string} */\r\n    value: ''\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```. It includes a TypeScript definition file.\r\n\r\nIf you use the [Closure Compiler](https://github.com/google/closure-compiler), this package includes a externs file: **./externs.js**.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **./dist/wavefile.umd.js** and **./dist/wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://unpkg.com/wavefile):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://cdn.jsdelivr.net/npm/wavefile):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** dist is **./dist/wavefile.cjs.js**. It is the dist file used by Node. It is served in the \"main\" field of package.json and is the source you are running when you **npm install wavefile**. It is not compiled or minified.\r\n\r\n- The **UMD** module is **./dist/wavefile.umd.js**. It is transpiled to ES5 and compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json.\r\n\r\n- The **browser-only** dist is **./dist/wavefile.min.js**. It is transpiled to ES5 and compiled. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **./dist/wavefile.js**, served as \"es2015\" in package.json. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. This should be the entry point for bundlers.\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"a9c55b88583fab3ab914e5f7705f93f30251c3f6","_id":"wavefile@8.1.5-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-Rr4l6dtCZQp4G8b/d1AXRMUij12/67p8UTWfD7MvXkGfbbWaXBYatr9rS3uZH5GNJjZg0Bz1jco0VAYg44PHeA==","shasum":"334472e8e81282a39733cdaa1cbffec41815d852","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.5-alpha.0.tgz","fileCount":4,"unpackedSize":39490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRLaxCRA9TVsSAnZWagAAVgAP+wcFSYz4wn0gBTn0cVkG\nCv8c4W1fRD2O4kPZimliB55yCzU06/htT8SdPDVy4QzTpHv2fGiYaYDG1eFV\nuzJjUAMC1hHzDL768w5MMtX0Gj7orGQsv0v2F5excL7etOBkiH7R5q2ojbW2\nx7dLqyIWcxP1iyMpRg40Uufsk7BogVSGDGSI/SeY/mjmfIa8Hy3J+qZ4q1DB\nXHoajH9UHJBDAXpa9y6eXAe9NRIXt1JqIWaaQEBa5RJLU4TU7QwsHdjz8Q3y\n8uDdhwvjhPEWacOYqHItLZ6fzX1bh1cqzLh30cYuDBnp18/4m3lSuj7WlnwO\nVuyh4q+4R+bi+ejYAxpy3Jy8uGFDkVdUexBBvJQjzZaHQXwO2J3s9O9RF8KN\nr/XVph+X+FNNVoywTnBDBaOBZ6VhajwKq3sHsyo2QuvID5JW1+FdXSD33wMT\nw7bFhW21VrJ2GVSkLRMJHR9WzWZl2HazZsIkhQP9IdGGFUZKdtqh9UvEe+K/\nR0dwSbOgve4o+ED7jgK4tFwVSET+UECjdwL7bl9e8TBcVXeoYt8Ec9MwVyIN\n3DNwIBpuSuQi2cFSPNT4Al0Q1GYSYMJCbgTJzBXf7rzUhcIgIvbblrmP5rQW\nhcDjmBSjONbY2vObv9LYRp6TZIIHlgF9owQsTVe0a0Zzi+c9xNZhrwYhTp+F\nEyqL\r\n=wAJw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHzc8Isx5NrkON0IA31yxZ/vZ9SSL5G0nyjmj9sh0lEkAiEAgNQUCSXjKQCa5Xkl0U1N4ADYeD5kK1dr29by88RpxCs="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.5-alpha.0_1531229873625_0.4922158575949378"},"_hasShrinkwrap":false},"8.1.5-alpha.3":{"name":"wavefile","version":"8.1.5-alpha.3","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"dist/","lib":"lib/","vendor":"vendor/"},"files":["dist/","lib/","vendor/","index.js","cli.js","externs.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js externs.js cli.js lib","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist --esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd && npm run test-esm && npm run test-cli","bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"byte-data":"^13.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6"},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Tests](https://img.shields.io/badge/tests-online-blue.svg?style=for-the-badge)](https://rawgit.com/rochars/wavefile/master/test/browser.html)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\nCreate, read and write wav files according to the specs.\r\n\r\n- **Zero dependencies**\r\n- **MIT-licensed**\r\n- **Use it out of the box in the browser**\r\n- **Use it out of the box in Node**\r\n- **Use it out of the box with TypeScript**\r\n- **Handle files up to 2GB**\r\n- **Use it as a command line tool**\r\n- **Less than 10kb minified + compressed, less than 30kb minified**\r\n- Made with [Closure Compiler](https://github.com/google/closure-compiler) in mind (works great with others, too)\r\n\r\nWith **wavefile** you can:\r\n\r\n- Create wav files\r\n- Read wav files\r\n- Change the bit depth of the audio\r\n- Read and write RIFF tags\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n\r\nAnd more.\r\n\r\n## Install\r\n\r\n### NPM\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the [command line](#cli-usage), install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\n### Yarn\r\nTo use it in your programs:\r\n```\r\nyarn add wavefile\r\n```\r\n\r\nTo use it from the [command line](#cli-usage), install it globally:\r\n```\r\nyarn global add wavefile\r\n```\r\n\r\n### GitHub\r\nThis is not recommended as it will also include test and build assets in your installation. If this is what you want, you can:\r\n```\r\ngit clone https://github.com/rochars/wavefile\r\n```\r\n\r\nAnd then import/require what you want from the *wavefile* folder:\r\n```\r\nconst WaveFile = require('./wavefile/dist/wavefile.umd.js');\r\n```\r\n\r\nYou can also download one of the files in the *./dist* folder:  \r\nhttps://github.com/rochars/wavefile/tree/master/dist\r\n\r\n## Use\r\n\r\n### Node\r\nIf you installed via [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com), require WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### ES module\r\nImport WaveFile from **wavefile.js** in the *./dist* folder of this package:\r\n```javascript\r\nimport WaveFile from './dist/wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder of this package:\r\n```html\r\n<script src=\"./dist/wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://cdn.jsdelivr.net/npm/wavefile) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://unpkg.com/wavefile):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** need IE10+ to run. All moderns browsers should work fine. Cross-browser tests are on the [ROADMAP](ROADMAP.md).\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [See it in action](#see-it-in-action)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [Command line interface](#cli-usage)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## See it in action\r\n\r\nWith **wavefile** you can change the bit depth and compression type of wav files on the fly before loading them in a browser player. This example uses **wavefile** and **wavesurfer** to create a browser player that supports mu-Law, A-Law, IMA ADPCM and all other formats supported by **wavefile**:\r\n\r\nhttps://rochars.github.io/wavefile/example\r\n\r\n```javascript\r\n// Load a wav file that is encoded as 4-bit IMA ADPCM:\r\nvar wav = new WaveFile(ADPCMFileBuffer);\r\n\r\n// Decode the file as 16-bit PCM, supported by most browsers:\r\nwav.fromIMAADPCM();\r\n\r\n// Get the DataURI of your new, browser-friendly wav file:\r\nvar wavDataURI = wav.toDataURI();\r\n\r\n// Load your new wav file into your player\r\n// ...\r\n```\r\n\r\nCheck out wavesurfer:  \r\nhttps://github.com/katspaugh/wavesurfer.js\r\n\r\n## Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### CLI Usage\r\n**wavefile** can run as a command line tool. To use **wavefile** from the command line, install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>} samples Array of samples to be written.\r\n *      The samples must be in the correct range according to the\r\n *      bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth='16') {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth='16') {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth='16') {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl='') {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n```\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = '';\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always 'WAVE'.\r\n * @type {string}\r\n */\r\nWaveFile.format = '';\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    audioFormat: 0,\r\n    /** @type {number} */\r\n    numChannels: 0,\r\n    /** @type {number} */\r\n    sampleRate: 0,\r\n    /** @type {number} */\r\n    byteRate: 0,\r\n    /** @type {number} */\r\n    blockAlign: 0,\r\n    /** @type {number} */\r\n    bitsPerSample: 0,\r\n    /** @type {number} */\r\n    cbSize: 0,\r\n    /** @type {number} */\r\n    validBitsPerSample: 0,\r\n    /** @type {number} */\r\n    dwChannelMask: 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @type {!Array<number>}\r\n     */\r\n    subformat: []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwSampleLength: 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwCuePoints: 0,\r\n    /** @type {!Array<!Object>} */\r\n    points: [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwManufacturer: 0,\r\n    /** @type {number} */\r\n    dwProduct: 0,\r\n    /** @type {number} */\r\n    dwSamplePeriod: 0,\r\n    /** @type {number} */\r\n    dwMIDIUnityNote: 0,\r\n    /** @type {number} */\r\n    dwMIDIPitchFraction: 0,\r\n    /** @type {number} */\r\n    dwSMPTEFormat: 0,\r\n    /** @type {number} */\r\n    dwSMPTEOffset: 0,\r\n    /** @type {number} */\r\n    dwNumSampleLoops: 0,\r\n    /** @type {number} */\r\n    dwSamplerData: 0,\r\n    /** @type {!Array<!Object>} */\r\n    loops: [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {string} */\r\n    description: '', //256\r\n    /** @type {string} */\r\n    originator: '', //32\r\n    /** @type {string} */\r\n    originatorReference: '', //32\r\n    /** @type {string} */\r\n    originationDate: '', //10\r\n    /** @type {string} */\r\n    originationTime: '', //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @type {!Array<number>}\r\n     */\r\n    timeReference: [0, 0],\r\n    /** @type {number} */\r\n    version: 0, //WORD\r\n    /** @type {string} */\r\n    UMID: '', // 64 chars\r\n    /** @type {number} */\r\n    loudnessValue: 0, //WORD\r\n    /** @type {number} */\r\n    loudnessRange: 0, //WORD\r\n    /** @type {number} */\r\n    maxTruePeakLevel: 0, //WORD\r\n    /** @type {number} */\r\n    maxMomentaryLoudness: 0, //WORD\r\n    /** @type {number} */\r\n    maxShortTermLoudness: 0, //WORD\r\n    /** @type {string} */\r\n    reserved: '', //180\r\n    /** @type {string} */\r\n    codingHistory: '' // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    riffSizeHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    riffSizeLow: 0, // DWORD\r\n    /** @type {number} */\r\n    dataSizeHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    dataSizeLow: 0, // DWORD\r\n    /** @type {number} */\r\n    originationTime: 0, // DWORD\r\n    /** @type {number} */\r\n    sampleCountHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    sampleCountLow: 0, // DWORD\r\n    /** @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {!Uint8Array} */\r\n    samples: new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list look like this:\r\n *  {\r\n *      chunkId: '',\r\n *      chunkSize: 0,\r\n *      format: '',\r\n *      subChunks: []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {!Array<number>} */\r\n    chunkData: []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  '';\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    /** @type {number} */\r\n    dwName: 0, // a cue point ID\r\n    /** @type {number} */\r\n    dwPosition: 0,\r\n    /** @type {number} */\r\n    fccChunk: 0,\r\n    /** @type {number} */\r\n    dwChunkStart: 0,\r\n    /** @type {number} */\r\n    dwBlockStart: 0,\r\n    /** @type {number} */\r\n    dwSampleOffset: 0\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    dwName: '', // a cue point ID\r\n    /** @type {number} */\r\n    dwType: 0,\r\n    /** @type {number} */\r\n    dwStart: 0,\r\n    /** @type {number} */\r\n    dwEnd: 0,\r\n    /** @type {number} */\r\n    dwFraction: 0,\r\n    /** @type {number} */\r\n    dwPlayCount: 0\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\nItems in *WaveFile.LIST* are objects that look like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    chunkId: '', // always 'LIST'\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {string} */\r\n    format: '', // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    subChunks: []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    chunkId: '', // some RIFF tag\r\n    /** @type {number} */\r\n    chunkSize 0,\r\n    /** @type {string} */\r\n    value: ''\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array.\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Distribution\r\nThis library is a ES module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```. It includes a TypeScript definition file.\r\n\r\nIf you use the [Closure Compiler](https://github.com/google/closure-compiler), this package includes a externs file: **./externs.js**.\r\n\r\n### If you are using this lib in a browser:\r\n\r\nYou may load both **./dist/wavefile.umd.js** and **./dist/wavefile.min.js** in the browser with ```<script>``` tags. Ideally you should use **wavefile.min.js**. You can load it via the https://unpkg.com and https://www.jsdelivr.com/ CDNs:\r\n\r\n[unpkg](https://unpkg.com/wavefile):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n[jsDelivr](https://cdn.jsdelivr.net/npm/wavefile):\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\n### If you are using this lib as a dependency:\r\n\r\n- The **CommonJS** dist is **./dist/wavefile.cjs.js**. It is the dist file used by Node. It is served in the \"main\" field of package.json and is the source you are running when you **npm install wavefile**. It is not compiled or minified.\r\n\r\n- The **UMD** module is **./dist/wavefile.umd.js**. It is transpiled to ES5 and compatible with Node, AMD and browsers. It is served in the \"browser\" field of package.json.\r\n\r\n- The **browser-only** dist is **./dist/wavefile.min.js**. It is transpiled to ES5 and compiled. It is used in the \"unpkg\" and \"jsdelivr\" fields of package.json.\r\n\r\n- The **ES6 dist** is **./dist/wavefile.js**, served as \"es2015\" in package.json. It is not compiled/minified.\r\n\r\n- **./index.js** is served as \"module\" in package.json. This should be the entry point for bundlers.\r\n\r\nIf your module bundler is using \"browser\" as the entry point **your dist should work the same** but will be a larger file.\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"4763f61f2ea77167afffa80c753f8621de31a950","_id":"wavefile@8.1.5-alpha.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-K5BRq2zkfh+lpj9ZKEB2pdDqSkYvEyR7T9Gu/uDzq/wNCqoxSaEH5FPU0dbyZJNek6cNFX2KY8T8BNgJxgXM4A==","shasum":"7abfff0d129f279084b0bd95b9c6aee16c1196a8","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.5-alpha.3.tgz","fileCount":24,"unpackedSize":533988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRVxmCRA9TVsSAnZWagAAHrQP/0/ljqPgc5bHg3HWEyU6\n5WJK7O+DQ5bvmKEvT6Tnof3M/wvL381osXM9MXoR04UQIGlFZEvWLRNv6sCZ\nlpO5XncQP6aiPytlEZntrOwbyVAw+4g7l+p2NdX6RG73DrEMNSH3wDeYPP0f\n+NnsITd6tDUokKWXh30oias7LLqZOkDFUWHjaYpg7WlmRHy0nrM7Rn2MB3EZ\npdDMezfSQ8ENZPB0df7C0N78Wv025kyFe1HWx5oL7lWz+dI+kmofEnzymKH9\nvWP3CmGvZo6cLnTQfHTvdNFUhg9sKyl72s0sCYEoBxXjOzXN5i0zn9EKOXRm\nPM0OV0jwyPWJb2K+InaPcGoPu6pLwlTte+8dz5l8owSOOsiKOL/BtM3Gotsl\nKin9HU71tPOnGelB3RtIFmsIEbETetCOkMBtuVLk9ots3wt3hSq+YhFPJkt8\nQK3yvkMhSEhMqcZRB7lS++VJgUxZ+ymwQZjsz/ToFcZrKDKjw/mkUEt8FoRp\nPHcu+2uN+OCTI9goIMUGY1G00tm59Xvs6pajZdoIEtTozUaaGVqf0uBlV1CO\nzWrgemXCpP+G76YhTtEbhuC4todm/XKdsS4hLAq+xdcZey+E7oAqAMdWmpL7\n20KzhSnV0yd4i9jlufdHds/isehiS7hfqGUzJTAw5PR1PiwoJwk9n4orzwok\nUZDE\r\n=L6gr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBOrjWAQz4JNOtISidheAX3U8bw+qvkjHOemVzLTtxI5AiEA/mcy+Bu4alo3+LqhIG1bTDoQsZpFDWC9dGh5HY1S5/E="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.5-alpha.3_1531272293954_0.5891122138306304"},"_hasShrinkwrap":false},"8.1.5":{"name":"wavefile","version":"8.1.5","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./cli.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"dist":"dist/","lib":"lib/","vendor":"vendor/"},"files":["dist/","lib/","vendor/","index.js","cli.js","externs.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js externs.js cli.js lib","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist --esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd && npm run test-esm && npm run test-cli","bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"byte-data":"^13.2.5","chai":"^4.1.2","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6"},"gitHead":"4763f61f2ea77167afffa80c753f8621de31a950","_id":"wavefile@8.1.5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-T6Dxji5DMQa6l7pmstyP53jtHDouFHhejoJOwHDgZgPjk9PMtpo5TTX7AfNfh1OitodWl1dhgQj5y8/eCsOnHQ==","shasum":"7340303c069492bff0fb74c51b6e0d55ae8420a0","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.5.tgz","fileCount":24,"unpackedSize":533980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRV6FCRA9TVsSAnZWagAALPYP/i9JBdHW1o1ygiZz+AFe\naBR4f91N+FiffGn4ZroGEnTOR6wmXBcOPnBMwtTvX9RV1fHTtqJgcHAPoHQI\ns7lbbnW2GvPH/btxXx2yayWtZ2qMrhLnSWRJwYIuX6v/s6P//PCdbiYcaPAz\nGGhMS8POtiWzZJdZU0UPUrywMFeU8pv+edYzsVrin69AjhEnbkMltWYUN27F\nkQvt9lwnD78eQ4wpgFlWIOhfp6ePWtwMkSXGqP6QYkIPT7bm9q06MvTavOGv\nwWf00Go+X5yZjlHOpQzl1VTpcYETc/dudKg+pi0ZgLnhbcvLDz9QtfezEXsA\nIZNydZSsBsdCQZb6r9oIBImPMIXkM4Ab2qzDTXtzEDP8+HCc24oLIss3QRDc\nSziEMvrAnM/NLWQh03lf0qaqsE+dISKTq+8qtepP+2yF03gZRfEMEh9tbC5/\nBfDiEFVIYq3sVU720X9ruZk3X6993EymEfnUO78jsgvg4pXzxu2L+rL139x7\nlEA3vn9THwLkCOe81UE7nje0HYpmASOyf8dQknsPltcdZF+QBoac7mXUS4k3\ncKadjyr06IvTrKxPbw7Gd7KGzzuIBfhzVoFl30IkqT6ky53s09g0iIy11mQq\nENuNS0VH2y7r3Tgo7aaY7PQ0H1xzTL5KithzNizSSYNAIn7H06YTXe4S7ZyI\nvcZP\r\n=F6m1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDl0w6k/11/U8SAvVeBFgUSbqKbo9rPSuuhnY6YTQO7dAiBFb4yaVH6mgkYK7LOCVQekycuCXKz4S8bvQzj2KFBfqw=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.5_1531272837121_0.8537318042886657"},"_hasShrinkwrap":false},"8.1.6-alpha.0":{"name":"wavefile","version":"8.1.6-alpha.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","vendor":"vendor"},"files":["bin","dist/wavefile.cjs.js","dist/wavefile.js","dist/wavefile.min.js","dist/wavefile.umd.js","externs","lib","vendor","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist --esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd && npm run test-esm && npm run test-cli","rollup-bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs/api","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"codecov":"^3.0.2","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6"},"dependencies":{},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/api/) [![Tests](https://img.shields.io/badge/tests-online-blue.svg?style=for-the-badge)](https://rawgit.com/rochars/wavefile/master/test/browser.html)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\nCreate, read and write wav files according to the specs.\r\n\r\n- **Zero dependencies**\r\n- **MIT-licensed**\r\n- **Use it out of the box in the browser**\r\n- **Use it out of the box in Node**\r\n- **Use it out of the box with TypeScript**\r\n- **Handle files up to 2GB**\r\n- **Use it as a command line tool**\r\n- **Less than 10kb minified + compressed, less than 30kb minified**\r\n- Made with [Closure Compiler](https://github.com/google/closure-compiler) in mind (works great with others, too)\r\n\r\nWith **wavefile** you can:\r\n\r\n- Create wav files\r\n- Read wav files\r\n- Change the bit depth of the audio\r\n- Read and write RIFF tags\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n\r\nAnd more.\r\n\r\n## Install\r\n\r\n### NPM\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the [command line](#cli-usage), install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\n### Yarn\r\nTo use it in your programs:\r\n```\r\nyarn add wavefile\r\n```\r\n\r\nTo use it from the [command line](#cli-usage), install it globally:\r\n```\r\nyarn global add wavefile\r\n```\r\n\r\n### GitHub\r\nThis is not recommended as it will also include test and build assets in your installation. If this is what you want, you can:\r\n```\r\ngit clone https://github.com/rochars/wavefile\r\n```\r\n\r\nAnd then import/require what you want from the *wavefile* folder:\r\n```\r\nconst WaveFile = require('./wavefile/dist/wavefile.umd.js');\r\n```\r\n\r\nYou can also download one of the files in the *./dist* folder:  \r\nhttps://github.com/rochars/wavefile/tree/master/dist\r\n\r\n## Use\r\n\r\n### Node\r\nIf you installed via [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com), require WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\nThis also works:\r\n```javascript\r\nconst WaveFile = require('wavefile').default;\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### ES module\r\nImport WaveFile from **wavefile.js** in the *./dist* folder of this package:\r\n```javascript\r\nimport WaveFile from './dist/wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder of this package:\r\n```html\r\n<script src=\"./dist/wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://cdn.jsdelivr.net/npm/wavefile) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://unpkg.com/wavefile):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr as a module from [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** need IE10+ to run. All moderns browsers should work fine. Cross-browser tests are on the [ROADMAP](https://github.com/rochars/wavefile/blob/master/docs/ROADMAP.md).\r\n\r\n## Manual\r\nLearn how to use **[wavefile](https://github.com/rochars/wavefile/blob/master/docs/README.md)**\r\n\r\n## API\r\nRead the **[wavefile API docs](https://github.com/rochars/wavefile/blob/master/docs/api/index.html)**\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"044ca62e1d45b8729b08e5ce60eb859606d6495f","_id":"wavefile@8.1.6-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-A+8XVmwcy9/ePNe5lQe6yGZul5XRci1px6ol0gBUZp95p0LjCO/CEijAT1+1nGVAfzXMPboj/fudTy3N2x+IHg==","shasum":"3b14e8e2ae8b3ee66e0472651244a19ff300d70e","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.1.6-alpha.0.tgz","fileCount":24,"unpackedSize":508155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRblYCRA9TVsSAnZWagAAjdQP/2Dl8+vNf3xc5EbIx+KG\nAJ8DUlifRcs18IVYPg6Wd+hrz++mJOj74RdKdtLdy+9kPyDso7gvtPaxs1AI\nW4Mcxwte9cSazDbPg8jqENxXhAj0ThMP02Ria+fUJ70i0j5gONcib/68im06\nzjlvPFYIlkRC2fFkigYy5mmMTrS83IKdFGd3wneF/Pr7tsbo/4pzwWSE1Ykc\nvXKnN79YZYrFasrPxuSyW0MyH76qB0HPxeiYvg9Bd9ctm5cx3p15NGSCY9ux\n5IXWYf77hY9Hp9drHo2yCjXZHlzouepenVz6GDmUAZQ6rzfgtxSP+f+SXP0U\nG8CRbPuzeimahxhuOwm3V0MgfVCt6emERC/YhwIEd1qhCbh7n6UVlV2KaM8V\nKzcgUjzrKC6Ia+3Xark3CWRiANKn23nbGvZHKiWEGU1yl20IlT+e6iAbJyft\nisRHSzBOnRvtGPpgMbfUTKl/kNWrZmJ7C6ak4b0LbneGPL474Exp3cfOnfEG\nlv++lN8TU8/iUZfI+1nFLIUxh4mefYtsI0ola791orRjKmTgQbjrVtBlR2hp\nft4x9PSlTHT6PKuXggBilvrdsQ7dRG1v0iIPdTDSwwjiiKT1bSOFuFJl7crP\n+9sjwkqW88IoRhA3m9YAClAib9kUdH87fwKL+TZYb+x8zRy+YbSme6VUZ7zk\nN02g\r\n=8wFJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAkef4h2SUJBAZqIsVeHkKNpw5M0SsWdvdiIZCi2h+pAIgCmWqgx+WZ/5OhfQ619j/dngaKVCC4Zce+m3aHjT0bn8="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.1.6-alpha.0_1531296088615_0.8522347798093324"},"_hasShrinkwrap":false},"8.2.0-alpha.0":{"name":"wavefile","version":"8.2.0-alpha.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","vendor":"vendor"},"files":["bin","dist","externs","lib","vendor","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test --esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd && npm run test-esm && npm run test-cli","rollup-bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs/api -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6"},"dependencies":{},"readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/api/) [![Manual](https://img.shields.io/badge/manual-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Tests](https://img.shields.io/badge/tests-online-blue.svg?style=for-the-badge)](https://rawgit.com/rochars/wavefile/master/test/browser.html)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\nCreate, read and write wav files according to the specs.\r\n\r\n- **Zero dependencies**\r\n- **MIT-licensed**\r\n- **Use it out of the box in the browser**\r\n- **Use it out of the box in Node**\r\n- **Use it out of the box with [TypeScript](https://www.typescriptlang.org/)**\r\n- **Handle files up to 2GB**\r\n- **Use it as a command line tool**\r\n- **Less than 10kb minified + compressed, less than 35kb minified**\r\n- Made with **[Closure Compiler](https://github.com/google/closure-compiler)** in mind (works great with others, too)\r\n\r\nWith **wavefile** you can:\r\n\r\n- Create wav files\r\n- Read wav files\r\n- Change the bit depth of the audio\r\n- Read and write RIFF tags\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n\r\nAnd more.\r\n\r\n## Install\r\n\r\n### NPM\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the [command line](https://github.com/rochars/wavefile/blob/master/docs/README.md#cli-usage), install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\n### Yarn\r\nTo use it in your programs:\r\n```\r\nyarn add wavefile\r\n```\r\n\r\nTo use it from the [command line](https://github.com/rochars/wavefile/blob/master/docs/README.md#cli-usage), install it globally:\r\n```\r\nyarn global add wavefile\r\n```\r\n\r\n### GitHub\r\nThis is not recommended as it will also include test and build assets in your installation. If this is what you want, you can:\r\n```\r\ngit clone https://github.com/rochars/wavefile\r\n```\r\n\r\nAnd then import/require what you want from the *wavefile* folder:\r\n```\r\nconst WaveFile = require('./wavefile/dist/wavefile.umd.js');\r\n```\r\n\r\nYou can also download one of the files in the *./dist* folder:  \r\nhttps://github.com/rochars/wavefile/tree/master/dist\r\n\r\n## Use\r\n\r\n### Node\r\nIf you installed via [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com), require WaveFile from **wavefile**:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### ES module\r\nImport WaveFile from **wavefile.js** in the *./dist* folder of this package:\r\n```javascript\r\nimport WaveFile from './dist/wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the compiled file in the */dist* folder of this package:\r\n```html\r\n<script src=\"./dist/wavefile.min.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr get it from the [jsDelivr](https://cdn.jsdelivr.net/npm/wavefile) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr get it from [unpkg](https://unpkg.com/wavefile):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr load it as a module using [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\n**wavefile** need IE10+ to run. All moderns browsers should work fine. Cross-browser tests are on the [ROADMAP](https://github.com/rochars/wavefile/blob/master/docs/ROADMAP.md).\r\n\r\n## Manual\r\nLearn how to use **[wavefile](https://github.com/rochars/wavefile/blob/master/docs/README.md)**\r\n\r\n## API\r\nRead the **[wavefile API docs](https://rochars.github.io/wavefile/api/)**\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","gitHead":"34794ca376b99e9d84ec2d35104e13434faf0a7c","_id":"wavefile@8.2.0-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-unYhRPDt2JGn9Z+j/PkMJEFcwWXWu3P58dVgNI2BwK+3omr+VDprB0YAPEmbY8OaSYaGvn4cSuGzpeRmD/jBIg==","shasum":"003a398a795e7d0b67392fdbfbe9063284921134","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.2.0-alpha.0.tgz","fileCount":27,"unpackedSize":612925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRv4oCRA9TVsSAnZWagAASecP/RT9Htcpn5sw06+UTvT7\nxv3kNjkZ//5RCmdQmS8iJNDOpfFITAaoGaXLKBldYYZ8ek9H+7v6xfcvkYYR\nPsk5tqxKxuTbjRtXVuGqDHmTFr4h8YK4H83RE5xyj9AdwoKA9duRr717CT1f\n0GoLfzEd0umcazZy27GR7TUII3+PwfsYxi6pJBASRwd1IogHS6gyJfbXcjQv\nplH/xRQtCPvn1fo1oCxadTTGQieujvkwr0sjyNLJXLoAbbYDa1UvRHsjVoZs\nmpmT27Mq7N9VHoNj85LfmCTL5BJUvoY+mpJzaEdAvCN4+ApbL54dmFSPr+dg\nfg+7SzCwymVm5kGUj+5LsaOQftbV9bBdndAC6EMhikVgFy8YfQX04WHFHqXl\nI01XWM/EkIiVjweKKUcpNLYTor2TtUA1pHv6Xo4oLGf1PdzHa7cbs4rRX8Fq\nOtk+Rm4dxWN6jC9PInaFKUEHJ8pnyDx0qKx6kCTjUv22ZgBfVepjf3Ie7MRa\nX6w6gxGiennoQspPa1nZQdWsZSylSt6LnW3wDaPoPuNOGgsFee9GcDNJBPxf\ngVdXZ0yGpob5SXTuGCw3gbn5ITxsix+7BXWiiBUMFNAKcpPJxil3Vhv+iWSC\nhzyha97qC5ryebQKY9bSqBbiK2rOCiZtIQKnnI5pZC9vmN7q6/T6OwFUQmjW\n1t3y\r\n=ET+c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF+XxbHzE4fA3QnCdbMfQIdAAv3IYNBi//N2W7jIewcQIhAOJmy4sFsaXGqPe7Dloa9N0shD0JBhJRWbGgiEYtviMS"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.2.0-alpha.0_1531379240609_0.6458038139189015"},"_hasShrinkwrap":false},"8.2.0":{"name":"wavefile","version":"8.2.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","vendor":"vendor"},"files":["bin","dist","externs","lib","vendor","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test --esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd && npm run test-esm && npm run test-cli","rollup-bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs/api -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6"},"dependencies":{},"gitHead":"419e187e8318364f73346d575f502a7101a1c82a","_id":"wavefile@8.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-tcTbWoparOmWAs14DjW1ZMIBQXd4MP3pBafkOxBmK1+N5nq0rvKsUYReG9LB3IaU+4xyWBC7xvhIY27FBgzAIg==","shasum":"e05242b8ce52b718571af5e95cbc01db9bacea4b","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.2.0.tgz","fileCount":27,"unpackedSize":612922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRwEACRA9TVsSAnZWagAAnqoP/1d9pSFZjxnvkUpEyb/D\n+nQAl9jieBHPGXQb2BLzM1Lioc7D6jBdAhCWEmzrbcH88v4MZ1e+zXCxAydn\nhG/CjWb3/Wa9zKEcKrkX5TsxU1ZYfx3+jQBGtog9KcNmhPJWtR6uiIJEh2ps\nr5dUeZI2JtGvqZEFhGUjhSHs6MT1Lx8wJe77JSXcu0NZ/LAnpCCguHa2kHdj\nNkXOWnfOapwqVB049V8jE6s/fTQQmZ9+g4KOakojfWwxexkj+ap2tnWqTwO3\nNmV60xcLMgywrDkuSo9PMzAbwUfMFTVp0SmuBsOJgw8GU97Ie/7wLbJp8NkH\nr/5f3T0kfFHiNd2iFQGkGZlKBOYZdWBj/oWWkXXKZBwCfxtNJ3LbEERIZ+vB\n+cML7SfTc0v0NpRxHDrY0XcnCdzmR6UiRsmsJGwgMHe1xBhYOQsbEF+EtGjg\nuLgQlVWaSiWkbeMzxA74gpeM+aH23Ap5BOyQiTE+d4nY0STFqr5COhW9X+pL\n8q/i0J1dIjTBdXP/dZ6prWFvRukkmZUf5HDTNu8zjYEitrvIHthSF2j9Kc/Q\n3x1bQoOi5GYugwMWPkFqlA33mfaOgCFaK4QxDO1Zv3h1Gvnm6X9T+EsfF/fr\nqxQQtohWWij58p5Tf51/tjm2sMVxFGCDNoljO50XX9YY62Aeb9oxYYKWR6D3\nPVE2\r\n=bCPd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyfyDxZJzyA1iqZjsq/FwcuJbVbNS20PKaGKTFrHpzeQIgXYR3aV+CbRsFo1+WVSBsIK+MnzD8y7G4ZRpUamUiE8g="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.2.0_1531379968257_0.831028366722671"},"_hasShrinkwrap":false},"8.3.0":{"name":"wavefile","version":"8.3.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","20-bit","16-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","vendor":"vendor"},"files":["bin","dist","externs","lib","vendor","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test --esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd && npm run test-esm && npm run test-cli","rollup-bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs/api -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6"},"dependencies":{},"gitHead":"acbb55eeab7cb1c9a8c55448e6db9848f3fc228b","_id":"wavefile@8.3.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-mImykYECFRug3QplHcefOqAaDLDkGlITUKrXrxBXhveAyXWHDpT6hOQ60Li/GUhj3aRLtOQ3YDmAFsLJfikwTw==","shasum":"c9a0a15c3538b93f92aee6d1859f566ad0ccb31d","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.3.0.tgz","fileCount":27,"unpackedSize":616036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbSDdACRA9TVsSAnZWagAA3ewP/jtjMmiH5wufhdbg4Kmd\n5Gq61vRJfpPK81tJoUt+asV50WP46oY67WOm6/rEix2rCtirae9PQj0r0tZ4\nUbUuy93RDxlJ9yviEY+kryUEezMXdft3PW0CY1ZWxifL0zBRLqSxFosKivjf\nGYfqmnrcGZkmoVaM8dIIdMncvMrv1Q1Czm22RxgIvvuckzXjkiQ7mtZmF53l\nKn6woTwGvYj3X/VWlUYJK7+tYSr4mttCci71WVlTNW1HaUdO+9q1/p9X99Bg\n+8+xMzKX/fBvF0IeW4YUZ5r7T2yDGxpTUnhBCi4gn3UiOOM3JiQ9cPjkI0NX\naT8sk5Kjhp9TPgG8Zug8UWLybse+m7kurgZbTAt+ZXEHR9cesIitlG6cj67R\ndeMuqJUnnO8t1HZdrYJigHgUQuPC7tzZv2HBe786Zrk8WDz61duBlb7LOvE/\n10dg/QXrnhalFzyLzezKleAzxgJ/VM7e+frm1K62eYE0WvYrmGNM9neCn02v\n+m+mTaFfmXWd4PhlVMs5g5xQvomU5iluXmI+EwS+0P4N770QJcdp2ovih75T\nnsg1tenf8VOFB+SIB4LgGHs2kc0S+wdsH5pJVHaboPTqo8NyR8tVODOwrl3Z\nbZA3ROlDXm+LJfqzTaI8v7tMQwzYa4w1amPjvzDPK8KAizsdw/pGJ6718MGk\nK1ei\r\n=n3ZU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXJNEDMFZvWdgo5lsLwasSqXa65ptUia4WWzXFgS56YAiA3s1Ca1WlZffBr/Aa1s8HaxcFJLJkEEFWtgv8fddtB+g=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.3.0_1531459392103_0.14422784555125223"},"_hasShrinkwrap":false},"8.3.1":{"name":"wavefile","version":"8.3.1","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib"},"files":["bin","dist","externs","lib","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test --esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd && npm run test-esm && npm run test-cli","rollup-bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs/api -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^13.2.5","imaadpcm":"^4.0.1","riff-chunks":"^9.0.0"},"gitHead":"b5250b6a057bf24ab7afa000332f2440bb3dde07","_id":"wavefile@8.3.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-0LSqTgBbaKycDWgDVc2wYxoiADf4GCIs503zi3/Vvp2jcUTmH+FDzKCcFSHRW4jCua5pNuzjvIzC4vmNDPyblA==","shasum":"e4526bd19f72e9f663da442e5c4e18537110eb24","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.3.1.tgz","fileCount":21,"unpackedSize":559352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbSFeFCRA9TVsSAnZWagAAJdoP/Rdvm0oVDmEdO6uSX+TT\nxCg3N+UK1JQ1FXNJU5VfsXZXAIqloruF5+cmUCDG5VJVAqQfTNZXoMbQYrTL\nzYLG8dAlAD09oPLtEE0ZwGBZfHfZOgs8RqBRG0C32KKUANk0mipTDm+99z3W\nFUoFEWFcFq33JXdLwFHkD41S+cUHnPcucr5x/2p16HQ3/jROBz5O9y9eK2jK\ngJc1jmOvkypP5A0p7QuNSSEbh0riYsTl11FiAHblcTKSRowZx2w1YGjnt8TU\nHtKdvu0z6h9TsOV1IEPYq4iJlIXS2YkQ2pEsqIkJO3s1lrLGuFzDcYi/YIzM\nZc9CxQI8c7P9ZsutUYh+KAs2bgZd3J0434lCNuTR44xtrQpVPa5HI4ByesPC\nkRGICK3XakTlUfWCHc0KGj6nDuVRUyDb6Yog4rU1ObdNK/DlMLhjXW9Kn0NM\nQwrZweJrbkrGrgAvRGSEHI9V7W+LB9w5UE8NUkIPHmmN9pDyGKJXqfJI1OUH\nl9nbAKsQEgWnqgR4+0a95nm9dT6QtMw8oOrntLkC/Da/Rz8TwDHMMwtZrX96\nmwUYAdE4a16YCtzeCrcQh4hO0McK6z5ZxXfxB2eELkgeOdmF++Z2MVjqZoKj\nDPX627THCMDOkopuVWTXBviCog1IEY6PPYn4yxlL9GFfeP056lO4jtzm+Cy0\nrE/Q\r\n=a40D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEeUKxAxob3FBNLqVGD3DDRCRR6lxsNmLtdxsCBrubbuAiEAlA6QaTTQA0vdEqk/GuK/iv7J3mReF+R2eXzqhzQXQh8="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.3.1_1531467653895_0.9137179232878574"},"_hasShrinkwrap":false},"8.3.2":{"name":"wavefile","version":"8.3.2","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.cjs.js","module":"./index.js","es2015":"./dist/wavefile.js","browser":"./dist/wavefile.umd.js","jsdelivr":"./dist/wavefile.min.js","unpkg":"./dist/wavefile.min.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib"},"files":["bin","dist","externs","lib","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib","test":"nyc ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test --esm --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=240000","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-min && npm run test-cjs && npm run test-umd && npm run test-esm && npm run test-cli","rollup-bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs/api -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^13.2.5","imaadpcm":"^4.0.1","riff-chunks":"^9.0.0"},"gitHead":"cc7be3b3496f01c53a98aacb6f413824a854d8eb","_id":"wavefile@8.3.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-7ZNZgGitod8PJWZF6fRXTwyc+EcsveRpNZv+1LoefercS+wT3sABVMmQ41lD78dXuOC69aD7UfeRmEbZOno+vw==","shasum":"596922febeb97309566e1e1646e977a730aef222","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.3.2.tgz","fileCount":21,"unpackedSize":560456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbSQGtCRA9TVsSAnZWagAAWfEQAJ6EKZa5ps43XQUeanpe\ngKeD/qTuArEBNb6ytuf1G59T7RLjZA2TNqBK1IyUqDu3/j57RIjAE8B2hQgX\nVUD27JijKgpvL0Imm3I13qgOzcUBpbHz2ilXoyGAItLu4jnOHE2GA9+bipG4\nhlI62K8uaZFIchwgF7Lbc8PSZNLHINxLl4xFfZRxfRT6waoN3YE8obVCUBa6\nYeRag0HYBpeZJcIQ0jbRtGOB4aLLTaw4LIc7BnD9cFqMO3Q9I8BH1dIKXF0w\n8wU6YBsqJpa+EQyAHZEFJgFAGPz0wev2zTOc/VjpMepX/ZZy0RpJv5vll4QB\nzvEvjfUCYE6z9qihSixi6eKuVW538KcxBQMvw3YKCVrLsfXBCkjjfCC1Ttfy\nAmWsA8Hy0Dl9uWQrvXMU4ZqPrS6T3ATkUVYmAeAqFjP/t2JyziYiHLcq26Jz\n8ALBG9dzHNe664VnAmMnGzbcetTUsj6AD4rZi262H/ZT/GnPZjPADM4aiKNz\nIgYGV4OxDrpJgHl3OKRQpGKgMpGFM7BT5OYcTSPDWu9QrQqKQ7rBeOeKSiSL\nJ+VjeNmCiz4RW4PE2Eh2DGTcYAGXqDYkHCPmY5MJh2LzUXLUIGaGPLwFczEV\n3MnAibfhGyPCN6DKqo8BO9jld68MqGCsIlXsuldJVnZpD2c6HIzt53JzpTBK\nQnQD\r\n=PrAD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD21/NRwrdO74JZ4k9WSP0gD+AztqearTD6Wh/s236GNAIhAMa9yRGoWjq0Zw5F9Nz8m6HYury3Y0vcCbCyGjezV2RJ"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.3.2_1531511213708_0.8777685956453705"},"_hasShrinkwrap":false},"9.0.0-alpha.0":{"name":"wavefile","version":"9.0.0-alpha.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.umd.js","module":"./index.js","es2015":"./dist/wavefile.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib"},"files":["bin","dist","externs","lib","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist test/src --esm --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-esm && npm run test-tsc && npm run test-cli","rollup-bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","google-closure-compiler-js":"^20180610.0.0","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0","typescript":"^2.9.2"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^15.0.0-alpha.0","imaadpcm":"^4.0.1"},"gitHead":"69ec302049f74ed75bc0b09f7e6f503fa9c0f1b2","readme":"# wavefile\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/) [![Tests](https://img.shields.io/badge/tests-online-blue.svg?style=for-the-badge)](https://rawgit.com/rochars/wavefile/master/test/browser.html)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\nCreate, read and write wav files according to the specs.\r\n\r\n- **MIT licensed**\r\n- **Use it in the browser**\r\n- **Use it in Node.js**\r\n- **Use it as a command line tool**\r\n- **Use it with [TypeScript](https://www.typescriptlang.org/)**\r\n- **Handle files up to 2GB**\r\n- **Less than 10kb minified + compressed, less than 32kb minified**\r\n- **Made with [Closure Compiler](https://github.com/google/closure-compiler) in mind** (works great with others, too)\r\n\r\nWith **wavefile** you can:\r\n\r\n- Create wav files\r\n- Read wav files\r\n- Change the bit depth of the audio\r\n- Read and write RIFF tags\r\n- Set and delete cue points and their labels\r\n- Encode/decode files as ADPCM, A-Law and μ-Law\r\n- Turn RIFF files to RIFX and RIFX to RIFF\r\n- Create or edit BWF metadata (\"bext\" chunk)\r\n\r\nAnd more.\r\n\r\n## Install\r\nTo use it in your programs:\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the [command line](#command-line), install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\nYou can also download one of the files in the *./dist* folder:  \r\nhttps://github.com/rochars/wavefile/tree/master/dist\r\n\r\n## Use\r\n\r\n### Node\r\nIf you installed via [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com), **import WaveFile from wavefile**:\r\n```javascript\r\nimport WaveFile from 'wavefile';\r\nlet wav = new WaveFile();\r\n```\r\n\r\nOr:\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nLoad **wavefile.umd.js** with ```<script>``` tags:\r\n```html\r\n<script src=\"./dist/wavefile.umd.js\"></script>\r\n<script>\r\n  var WaveFile = new WaveFile();\r\n</script>\r\n```\r\n\r\nOr load it from the [jsDelivr](https://cdn.jsdelivr.net/npm/wavefile) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr load it from [unpkg](https://unpkg.com/wavefile):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\nOr load WaveFile a module using [jspm](https://jspm.io):\r\n```html\r\n<script type=\"module\">\r\n  import WaveFile from 'https://dev.jspm.io/wavefile';\r\n  console.log(new WaveFile());\r\n</script>\r\n```\r\n\r\n#### Browser Compatibility\r\nAll modern browsers should work fine. Cross-browser tests are on the [ROADMAP](https://github.com/rochars/wavefile/blob/master/ROADMAP.md).\r\n\r\n### ES bundle\r\nImport WaveFile from **wavefile.js** in the *./dist* folder of this package:\r\n```javascript\r\nimport WaveFile from './dist/wavefile.js';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Command line\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\nThe available options:\r\n```\r\n  --bitdepth   Ex: wavefile input.wav --bitdepth=32f output.wav\r\n               Change the bit depth.\r\n               The input file is not affected.\r\n               Possible values: 8, 16, 24, 32, 32f, 64\r\n\r\n  --compress   Ex: wavefile input.wav --compress=adpcm output.wav\r\n               Apply compression to the file.\r\n               The input file is not affected.\r\n               Possible values: adpcm, alaw, mulaw\r\n\r\n  --tag        Ex: wavefile input.wav --tag=ICRD\r\n               Print the value of tag if the tag exists.\r\n\r\n  --list-tags  Ex: wavefile input.wav --list-tags\r\n               Print all tags of the file.\r\n\r\n  --list-cue   Ex: wavefile input.wav --list-cue\r\n               Print all the cue points of the file.\r\n\r\n  --bits       Ex: wavefile input.wav --bits\r\n               Print the bit depth of the file.\r\n\r\n  --rate       Ex: wavefile input.wav --rate\r\n               Print the sample rate of the file.\r\n\r\n  --help       Ex: --help\r\n               Show this help page.\r\n```\r\n\r\n## Node.js Example\r\n```javascript\r\nconst WaveFile = require('wavefile');\r\n\r\n// Load a wav file from disk into a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [Example](#example)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [The samples](#the-samples)\r\n- [Distribution](#distribution)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nYou must inform the number of channels, the sample rate, the bit depth and the samples (in this order).\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, -2, 4, 3],\r\n    [0, -1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes time in milliseconds, a text label and creates a cue point in the corresponding position of the file:\r\n```javascript\r\nwav.setCuePoint(1750, \"some label for the cue point\");\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -32768, 32767], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n/**\r\n * @param {?Uint8Array} bytes A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(bytes=null);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFile object based on the arguments passed.\r\n * @param {number} numChannels The number of channels\r\n *      (Integer numbers: 1 for mono, 2 stereo and so on).\r\n * @param {number} sampleRate The sample rate.\r\n *      Integer numbers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepth The audio bit depth code.\r\n *      One of \"4\", \"8\", \"8a\", \"8m\", \"16\", \"24\", \"32\", \"32f\", \"64\"\r\n *      or any value between \"8\" and \"32\" (like \"12\").\r\n * @param {!Array<number>|!Array<!Array<number>>|!ArrayBufferView} samples\r\n *      The samples. Must be in the correct range according to the bit depth.\r\n * @param {?Object} options Optional. Used to force the container\r\n *      as RIFX with {\"container\": \"RIFX\"}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options={}) {}\r\n\r\n/**\r\n * Set up the WaveFile object from a byte buffer.\r\n * @param {!Uint8Array} bytes The buffer.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats)\r\n * @param {boolean} changeResolution A boolean indicating if the\r\n *      resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth='16') {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromALaw(bitDepth='16') {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string} bitDepth The new bit depth of the samples.\r\n *      One of \"8\" ... \"32\" (integers), \"32f\" or \"64\" (floats).\r\n *      Optional. Default is 16.\r\n */\r\nWaveFile.fromMuLaw(bitDepth='16') {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Return a Object<tag, value> with the RIFF tags in the file.\r\n * @return {!Object<string, string>} The file tags.\r\n */\r\nWaveFile.listTags() {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {number} position The cue point position in milliseconds.\r\n * @param {string} labl The LIST adtl labl text of the marker. Optional.\r\n */\r\nWaveFile.setCuePoint(position, labl='') {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Return an array with all cue points in the file, in the order they appear\r\n * in the file.\r\n * The difference between this method and using the list in WaveFile.cue\r\n * is that the return value of this method includes the position in\r\n * milliseconds of each cue point (WaveFile.cue only have the sample offset)\r\n * @return {!Array<!Object>}\r\n * @private\r\n */\r\nlistCuePoints() {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n\r\n/**\r\n * Return the sample at a given index.\r\n * @param {number} index The sample index.\r\n * @return {number} The sample.\r\n * @throws {Error} If the sample index is off range.\r\n */\r\nWaveFile.getSample(index) {};\r\n\r\n/**\r\n * Set the sample at a given index.\r\n * @param {number} index The sample index.\r\n * @param {number} sample The sample.\r\n * @throws {Error} If the sample index is off range.\r\n */\r\nWaveFile.setSample(index, sample) {};\r\n```\r\n\r\n#### WaveFile.listCuePoints()\r\nThis method returns a list like this:\r\n```javascript\r\n[\r\n  {\r\n    milliseconds: 1000, // the position in milliseconds\r\n    dwPosition: 8000, // the sample offset of the point\r\n    label: \"cue marker 2\" // the label of the point\r\n  },\r\n]\r\n```\r\nThe list order reflects the order of the points in the file.\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = '';\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always 'WAVE'.\r\n * @type {string}\r\n */\r\nWaveFile.format = '';\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    audioFormat: 0,\r\n    /** @type {number} */\r\n    numChannels: 0,\r\n    /** @type {number} */\r\n    sampleRate: 0,\r\n    /** @type {number} */\r\n    byteRate: 0,\r\n    /** @type {number} */\r\n    blockAlign: 0,\r\n    /** @type {number} */\r\n    bitsPerSample: 0,\r\n    /** @type {number} */\r\n    cbSize: 0,\r\n    /** @type {number} */\r\n    validBitsPerSample: 0,\r\n    /** @type {number} */\r\n    dwChannelMask: 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @type {!Array<number>}\r\n     */\r\n    subformat: []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwSampleLength: 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwCuePoints: 0,\r\n    /** @type {!Array<!Object>} */\r\n    points: [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwManufacturer: 0,\r\n    /** @type {number} */\r\n    dwProduct: 0,\r\n    /** @type {number} */\r\n    dwSamplePeriod: 0,\r\n    /** @type {number} */\r\n    dwMIDIUnityNote: 0,\r\n    /** @type {number} */\r\n    dwMIDIPitchFraction: 0,\r\n    /** @type {number} */\r\n    dwSMPTEFormat: 0,\r\n    /** @type {number} */\r\n    dwSMPTEOffset: 0,\r\n    /** @type {number} */\r\n    dwNumSampleLoops: 0,\r\n    /** @type {number} */\r\n    dwSamplerData: 0,\r\n    /** @type {!Array<!Object>} */\r\n    loops: [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {string} */\r\n    description: '', //256\r\n    /** @type {string} */\r\n    originator: '', //32\r\n    /** @type {string} */\r\n    originatorReference: '', //32\r\n    /** @type {string} */\r\n    originationDate: '', //10\r\n    /** @type {string} */\r\n    originationTime: '', //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @type {!Array<number>}\r\n     */\r\n    timeReference: [0, 0],\r\n    /** @type {number} */\r\n    version: 0, //WORD\r\n    /** @type {string} */\r\n    UMID: '', // 64 chars\r\n    /** @type {number} */\r\n    loudnessValue: 0, //WORD\r\n    /** @type {number} */\r\n    loudnessRange: 0, //WORD\r\n    /** @type {number} */\r\n    maxTruePeakLevel: 0, //WORD\r\n    /** @type {number} */\r\n    maxMomentaryLoudness: 0, //WORD\r\n    /** @type {number} */\r\n    maxShortTermLoudness: 0, //WORD\r\n    /** @type {string} */\r\n    reserved: '', //180\r\n    /** @type {string} */\r\n    codingHistory: '' // string, unlimited\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    riffSizeHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    riffSizeLow: 0, // DWORD\r\n    /** @type {number} */\r\n    dataSizeHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    dataSizeLow: 0, // DWORD\r\n    /** @type {number} */\r\n    originationTime: 0, // DWORD\r\n    /** @type {number} */\r\n    sampleCountHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    sampleCountLow: 0, // DWORD\r\n    /** @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {!Uint8Array} */\r\n    samples: new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list look like this:\r\n *  {\r\n *      chunkId: '',\r\n *      chunkSize: 0,\r\n *      format: '',\r\n *      subChunks: []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {!Array<number>} */\r\n    chunkData: []\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  '';\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects that look like this:\r\n```javascript\r\n{\r\n    /** @type {number} */\r\n    dwName: 0, // a cue point ID\r\n    /** @type {number} */\r\n    dwPosition: 0,\r\n    /** @type {number} */\r\n    fccChunk: 0,\r\n    /** @type {number} */\r\n    dwChunkStart: 0,\r\n    /** @type {number} */\r\n    dwBlockStart: 0,\r\n    /** @type {number} */\r\n    dwSampleOffset: 0\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects that look like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    dwName: '', // a cue point ID\r\n    /** @type {number} */\r\n    dwType: 0,\r\n    /** @type {number} */\r\n    dwStart: 0,\r\n    /** @type {number} */\r\n    dwEnd: 0,\r\n    /** @type {number} */\r\n    dwFraction: 0,\r\n    /** @type {number} */\r\n    dwPlayCount: 0\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\nItems in *WaveFile.LIST* are objects that look like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    chunkId: '', // always 'LIST'\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {string} */\r\n    format: '', // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    subChunks: []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    chunkId: '', // some RIFF tag\r\n    /** @type {number} */\r\n    chunkSize 0,\r\n    /** @type {string} */\r\n    value: ''\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## The samples\r\nSamples are stored in WaveFile.data.samples as a Uint8Array representing a byte buffer. Once you inform the samples with fromScratch() they are packed as bytes and stay that way.\r\n\r\nTo get and set samples in a WaveFile instance you should use WaveFile.getSample(index) and WaveFile.setSample(index, sample). The 'index' is the index of the sample in the sample array, not the index of the bytes in data.samples.\r\n\r\nExample:\r\n```javascript\r\nwav = new WaveFile();\r\n\r\n// some samples\r\nlet samples = [561, 1200, 423];\r\n\r\n// Create a WaveFile using the samples\r\nwav.fromScratch(1, 8000, \"16\", samples);\r\n\r\n// Getting and setting a sample in the WaveFile instance:\r\nwav.getSample(1); // return 1200, the value of the second sample\r\nwav.setSample(1, 10); // change the second sample to 10\r\nwav.getSample(1); // return 10, the new value of the second sample\r\n```\r\n\r\nRange:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://github.com/rochars/wavefile/blob/master/CODE_OF_CONDUCT.md), also available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2018 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","_id":"wavefile@9.0.0-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-HvFQANdglIfpGr6/YunLZY5qZXY8n7Y/k7Kw6bc/7VDBoAYbLbSkh8rOIxaOoBNuQve9Bsqe5xr23EtCIa99/A==","shasum":"0298bff55f0cc062ce02858fc694fac206325027","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-9.0.0-alpha.0.tgz","fileCount":20,"unpackedSize":309483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUk1/CRA9TVsSAnZWagAASHAP/1EZZ1+oqF4eFFpt4oUC\nWRsEXeeuHBJHB8PqGXe0qgGWZEBvEwkngs26Rzjt8LihVirZdTyPSXjriviG\n4wtagCQ2ASNoUimahLASQZwy+TbS5mvxN2YckoCl6KGIkLsGyq2ZjnzRD3Bi\n1HSQHgsYcXPA5G03KXxVVmoOrH2d/7fphJITbGKGleGSOW9pRni+/esDAXsQ\nlx/Hw5T4a+qofDNQ9OhyD6ggy4ax/17UVO2EhqHPlFnTFrGpoOI1xrohsJYt\ntFPQGxukyxJLbsQxEzB7sevIFc5t4/MoDrT7Kupr/fQA01pzQlndyFqpjwuy\nVs/hiWl35YgYSVbJpyKYHQ+/E3kOubcC5P7bQNwxyJ6ZHypT3frNh0gNK+6N\nhOO6jOxmH96RItJMQl6ys57idELTnyBsnaJAjCaFQQUBPUOC136gWcSJv73o\nQtgRjftqB25+J/fxo3B4ZK15uIbYWnk8y37A/Rjhfq+FJl/fl65RsoryMOeh\nm1jvXQxVdS+3BMilSTjaDxAzVMxj3viZOIPs+R9ywOAxbVvPsq3UZW8ajiQ+\n1Rtq3UTi5KLVUtuQVw/cs7bA/TrB4eDwaR+kCfcQNWVRo1uBaCKvrIsWFEmb\niEW9Quw81AskYiVwC0GfcytxFYzMLtjEJXwjIGou0W/1OzLs8MpGCe9zG1A9\nF4vM\r\n=ZcS+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGWZBS3e+r+9DQEpj8F96Cx426M8AdkHUe3qTbU2BNRAAiAhiwYFyy5ZimKdLl07+CGFGHbKYFSY0FOpUUSN8NW1hg=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_9.0.0-alpha.0_1532120447529_0.021171015814689387"},"_hasShrinkwrap":false},"8.4.0":{"name":"wavefile","version":"8.4.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","module":"./index.js","main":"./dist/wavefile.cjs.js","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"files":["bin","dist","externs","lib","scripts","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist test/src --esm --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist test/src --cjs --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist test/src --min --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-esm && npm run test-tsc && npm run test-cli && npm run test-cjs && npm run test-min","rollup-bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.51","jsdoc":"^3.5.5","jshint":"^2.9.5","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0","rollup-plugin-terser":"^1.0.1","terser":"^3.8.1","typescript":"^2.9.2"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^15.0.0","imaadpcm":"^4.0.1"},"gitHead":"2f7421c8b7c63d5a636b4e6a7855fcc908066c35","_id":"wavefile@8.4.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-twa7eEDeAyPaGwxyK5+Tu3hRkxkohmW6hrPPwZg3gEhVmkZhRE/8zEZqEIj7nPseIwjD8UV3iEjH/2Ygpr3OYQ==","shasum":"28d9beb4dcf134bf2a2cac0253111ed80c0c54c7","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.4.0.tgz","fileCount":22,"unpackedSize":530957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYo24CRA9TVsSAnZWagAAfc8P/jFmO0iGNwt9qbbQVgbm\n8JM7ZHdzc7db/deELicEVfHsghKNfwzYQKVJjj6DJ96WhnPtTk9fMOpUbPFl\n/l8iwPyMhlyDHy/3fnYsaBh0BUYAIrRDg8XsQVr9vbTs5dtJCj0DGBGoPfUk\nz60DdngSfJaZv0TT5zyYaDTGFrNSl2MvQbscjobyZYpaZNXXrgA3/+3N3ijN\nvCN9dnqHgFkV1QPew+a/fxOtGStu0pZGys4iRfCHRlEcQL7NmwlHZDpavBfV\nhY9+N24go368cIth797Jxf1jzyDuaLSebO000OVdyy9cN3j4S9wiP9eZCkp3\n/CMB6It6c1XoTl+Lko0MHWklnP3h9HFMxAkkAU/LfQGbnWU9PJvVhhojDxBJ\npinYhKEChN/xP2BuNo3BJ4GWR/SYpnEu2txIcdnwzREV3U3kKSbznQO5+EvB\nVYXLTvYNgHHq7d21j9nPVusi3W2Kj8ZzkJypaYNl1fDTG8IahQgtIsnl1htB\nYcLnwyQQCGv8vnRaaWK4lHqS0ltAi7sAyXC5ER+G9+qlpcMabBA5VoQ0uMrq\nP442ObdlL/8b4eLdZM2cZTZF23ZNZvNJ+pIbzspkwXriHdKPCla3lWL6QrPl\n5Xa7Vvckhmf9fKO1DzloezWhvJ++LrS40R29cXT54fljNJawdmoYDNFsjTSz\nxRip\r\n=aJIz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkzt2aocGHMdV0pqBS86+SSgR6QWCiXK6IWTdOopbYigIgNRMq9LF2cOKuVFwo0arxmHH+9FBEpQmoUwgkFYllioM="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.4.0_1533185464144_0.4515088325091119"},"_hasShrinkwrap":false},"8.4.1":{"name":"wavefile","version":"8.4.1","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","module":"./index.js","main":"./dist/wavefile.cjs.js","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"files":["bin","dist","externs","lib","scripts","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist test/src --esm --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist test/src --cjs --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist test/src --min --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-esm && npm run test-tsc && npm run test-cli && npm run test-cjs && npm run test-min","rollup-bundle":"rollup --config && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.74","jsdoc":"^3.5.5","jshint":"^2.9.6","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-commonjs":"^9.1.4","rollup-plugin-node-resolve":"^3.3.0","rollup-plugin-terser":"^1.0.1","terser":"^3.8.1","typescript":"^2.9.2"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^16.0.1","imaadpcm":"^4.0.1"},"gitHead":"f46385c9efda87cfd3c63c050d3ad78755ebaab7","_id":"wavefile@8.4.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-h01TVcLvJQ1tdlkT/nGlUBAVmYVNUSKvQ1DIR9tN+7ggiKo+1S++PBL5HcEim4MfzO/P4ZzQh6S5JUtfI75V9A==","shasum":"58a54fe0a44829466abbcf75f1bf5d6cf7f11083","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.4.1.tgz","fileCount":22,"unpackedSize":519999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaBfWCRA9TVsSAnZWagAAvgkQAJqPiTDcZGm7t8Bteeea\nOvt1FgXqEwFmM0lBPfaMS826IhWpW2Z43fpTFIchgqPbFcZLIxfgdq87obIh\nHIa4DJ8d3Tekw8zNidsRI0PH5tHQx5Yab5Gm2G1Haxre2B8Rljl8ZWlQ/Rdt\nEWcScye7qs/bVjuwStFBuiI/99qZsvLfi2mFo1jiexe2NcIwaRV+vK5AFS5n\n9pHktj0jtL0S/sej4nn8anTEUP2JUarh+JETKS3RrGr7SRLUqOHLAzrW62wz\nf9yQCMpQzOUY6W6ZQnTsCqemQ5I6mAUB0/AgHcinm2nCR9v7HHMXOCMhNZ4d\n+QCkD7IaZ36P2KaJWOUXIfunQHP0ZdfkTytyBVbUlHKeCG9fdj2Mmz2QjprS\nHR9MkydooRy7PQTBjFsD/39RajbkkQPWHxI3zFZ/UZhxUKjXa2zOrz2/GjmZ\nbQ0+2cBF0Y5yy8gOsAakrIjRPT6hZ5ALq6KzLTZdeFcc9sa+UA1GuaIw7Aak\nG5dgVwbsR3bCDUaznWpumTPVtN9l+2RrC4vHPphmy7EmucpFxAG6nJnzMnOc\nZ4AZ8rG8Ee2L1AKpfdTP3HAeha+Kb2Mxc+9mzN1iumxePUeABHbfQwBnPICM\nUWwvax37uLQsfgBGP9B9VJ/lOxu6veB5mOdMC818vWSX+NPdMg8bFwq7V6WG\nLkvf\r\n=Svp7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfsSlqB5EsZ+UU/cDyJWwtFrcqb1+nzUpilkqgGWCMGwIhAKxFSmerYGKcslETsIP2d3dyjWbEtdcGysQ19Z5KZD13"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.4.1_1533548501769_0.44219633749828446"},"_hasShrinkwrap":false},"8.4.2":{"name":"wavefile","version":"8.4.2","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","module":"./index.js","main":"./dist/wavefile.cjs.js","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"files":["bin","dist","externs","lib","scripts","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist test/src --esm --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist test/src --cjs --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist test/src --min --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-esm && npm run test-tsc && npm run test-cli && npm run test-cjs && npm run test-min","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.74","google-closure-compiler":"^20180716.0.1","jsdoc":"^3.5.5","jshint":"^2.9.6","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.4","rollup-plugin-node-resolve":"^3.3.0","rollup-plugin-terser":"^1.0.1","terser":"^3.8.1","typescript":"^2.9.2"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^16.0.2","imaadpcm":"^4.0.1"},"gitHead":"b9f2f48779f7282cf76a0be2d6b5d9a1bf8ccabf","_id":"wavefile@8.4.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-waCzNNq3+lTJrDNKp4K1VXu8NRMCQVy4A7F+X5pwsaNDX2Flx5oMmw2XWtslv36OPm1/a+8WtRSM1hiAzIrPBw==","shasum":"73452cceed88bfbc28ff242fa6e4cd3eb339e572","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.4.2.tgz","fileCount":22,"unpackedSize":521534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaP/kCRA9TVsSAnZWagAAPt0P/0dbGEUp8ZZHNEFbEfMI\ncZx/BqqR10yrzGkxKxrhYNKMfbiJtN2mxLkpq/782JPWDJaeWuTv9WK3mUeR\nkPnuNitoQfqlL0YoTZp6yrvLg2GBChHij+dtYwPiJLx2U+WujAjT9iqTU23c\nbbL1bJZZirE7g0sAHtlWSzc2nnCWyXzhJDxawmFhaDmrh4zROfd6XHGYvh//\nPOuyDtmHdw+8pXNAtcFlrPbihoVWbziPTC8+K5VdiDm9GVQTdRmJWkKyZr9f\n3Hx9CO0aQzDpsJSK+scvDe+lvLns8+Lr1KljIHZlQTbz6OASxwvfdtcys3lD\nA5LWctKT2Qpc/+Dxfy3RYDTPmoChtNDyCFQm1sOATNoOX1aIrgmXCUqSNnNY\nW5wASQxz4GlANN+oEES6VwYWOHxa96v4MsvcEtfVv3rpXQrn0Zygs7M9jEIX\nR2OB64TI/1dIJmLZHblMV+M+amOYxZjhLONXskeHBEMwM8GIsUl0e/iJiPyl\nOHufAA9tCvYd1vhC7/NUx1fiKJEzcD+nTmAof6c/iudeNoAeMeHK/3PCHG7d\nUQdyF9cr11og0emLbz/+KNjwS71tU5EbN/EJHiwSFb/uVufW+QWS0TjWlCFk\nFX962EZtSK1wpzEMhDWUo9twCTVgKEHCefqqzxQu/xA2w6oFgK8Gg9jozUMh\nMk1q\r\n=nSKV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJd7ap4EDiq1QBoBXq1GOPcqoPeVXbR5meQbN/EUFxDAiAKhgtoHalQcUVp6icb8o+KbkKO4IFw9avZ9xbsuA47pQ=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.4.2_1533607908107_0.10051965287712106"},"_hasShrinkwrap":false},"8.4.3":{"name":"wavefile","version":"8.4.3","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","module":"./index.js","main":"./dist/wavefile.cjs.js","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","scripts":"scripts"},"files":["bin","dist","externs","scripts","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist test/src --esm --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist test/src --cjs --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist test/src --min --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-esm && npm run test-tsc && npm run test-cli && npm run test-cjs && npm run test-min","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.74","google-closure-compiler":"^20180716.0.1","jsdoc":"^3.5.5","jshint":"^2.9.6","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.4","rollup-plugin-node-resolve":"^3.3.0","rollup-plugin-terser":"^1.0.1","terser":"^3.8.1","typescript":"^2.9.2"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^16.0.2","imaadpcm":"^4.0.1"},"gitHead":"a82e9212ac7414d06bcece4922fe615ab0cc75a0","_id":"wavefile@8.4.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-asoUo1Icp5+otLyPfu7kKrk1JBDD9ynp/PayMCKScbKZcJ4sDB42UPeZYjYhJ0EB502R98lykGwZlP/KevZ5+g==","shasum":"024eb32cda98090e12f7f11ed9acd4982ea813b0","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.4.3.tgz","fileCount":14,"unpackedSize":491277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbah7QCRA9TVsSAnZWagAABZYP/Ar7SCkgfHRmYBuRa5yY\nGX8ESb3ouhld4KjMjHahBsTYpKS+uIabz3W/+Q/b2klOIuHpcACdyi02jZ06\np8Oz0OhzAdP87f0IqIUU6WogKnHyHcaqrGcnOcGddPeua+5I+BQIbyltw4Xa\npR+VD0DKnmVYlMBgY31ZZaSBh/kH73kZJwLi6Th1XSUpr32euAy4fD4POhtf\nqhJR3Ijjl07vggejlaMAqaUXYrdcPPXsqJOC0eQ17mlnarpQ7ytxgsHyT6Sp\nf6OpqZcAEdfgh+FTqS+eMLMKe0bL1ehPCYC10h10VbLSE1xCBgDdybbmGK3p\nJA970Cw2NwGxwoT7pDU8Hp/kuwarP02XW/NdCAcLAfib6qMQZ7U+CK6iiejI\n1bQ2xYkA12Cuc37nY8P0HDk+1CG8+Wfjms0NkvIHe36c3NVvK3a6N3csQVuX\nOTb3JEEC3/xWmKvPGzIalFgWdR57zTLsgm84BaTNZNjb35T94+y8vrgzaMwS\nGhAzD75lACBFVIOjrIt3Q1xI7054fTKqSezvEhX0ORcx9hYU5BsGhq82w8W4\nLMZZ9QrHkcWYFNSr9z3Au08KHZeeHVpSD/W3BRxN1KQ+5nEXea0++U/oI5QO\nho5Vc4BXiAM7WkfAGjUs0NdvkLifnZoflQUIqheg2MBiYrd6aAFDv0gOSOwP\nhWon\r\n=xI8C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDb+03IsPLZbOzF9gJWi8EkxVUuX8WCkIHFaURi+4sBdQIhAMwt0cTUxydGeYdEN3wQlMSZT8mfWL3FEkLNuOQiIxsS"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.4.3_1533681359896_0.9333228220068845"},"_hasShrinkwrap":false},"8.4.4":{"name":"wavefile","version":"8.4.4","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","module":"./index.js","main":"./dist/wavefile.cjs.js","browser":"./dist/wavefile.min.js","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","scripts":"scripts"},"files":["bin","dist","externs","scripts","index.js","index.d.ts","LICENSE","README.md","AUTHORS.md","CHANGELOG.md"],"scripts":{"lint":"jshint index.js bin externs test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist test/src --esm --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist test/src --cjs --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist test/src --min --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-esm && npm run test-tsc && npm run test-cli && npm run test-cjs && npm run test-min","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.0.2","docdash":"^0.4.0","esm":"^3.0.74","google-closure-compiler":"^20180716.0.1","jsdoc":"^3.5.5","jshint":"^2.9.6","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.1.4","rollup-plugin-node-resolve":"^3.3.0","rollup-plugin-terser":"^1.0.1","terser":"^3.8.1","typescript":"^2.9.2"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^16.0.3","imaadpcm":"^4.0.1"},"gitHead":"846f66c0a95237c0cc25e6e6a73befba7bfcd928","_id":"wavefile@8.4.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-JF9Gc+LYlxhfEb/1sVIrwljbMOa8eGSNSmZEO53Nw2jZ92UMS/AuauTp1B/XsLo/cmkcoJTvp0A9393ju49kHQ==","shasum":"ac7edb271ec3cba4575ba5d934efd352f3ff3aad","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.4.4.tgz","fileCount":14,"unpackedSize":492620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbJmRCRA9TVsSAnZWagAAQvsP/jU9gxYUnoQ2ctC2x8id\nAknFFzdPizBKYTg6UJKQmrIknJbfg17gviiV1EVel4pGQH4IMRdwYmJJ3n+v\n2VZbZFWFhHtJyaeHdN9g17ewtBSOWzMXRDUcdRYAK0JQRl9248hQ7pM22B2d\nFFCi2AvqRSWOtuhqwUwnPLwqVsIQKz9Kng4+weAsT7BJ6xj+qgg500bElnDO\n8fdfpOVWakXLyo970+6lQ1Llzsm4XzbfiVKfFv69GqJnQOPA1UKdF+0/Xt2l\n91QhAn8q0NOa1A1C4ip39VAmWw8GY2+aIXUCUllW6tMSk4dO5rZ+nV7P3rAu\nLKoOexzLVnVJY3M2/GEnyOuOdmxCmPsO8jkWuslf/qN1HJsEOSTS5sePHMXp\nNN8v5scUqxp2Zuo9MKCvj+tmfxcoYZpLGdCujyjcrlUulLCgvpjSm+f6pBvD\nPMtzpsl1zd+bPM4yPWLEyDg8Rnz4dDR+XI8NJ9BswC4LLYVHIdQZTV8bINX2\nBvL32CRcHK+l48/yoXxFtaUF1HO18xbWy6Z1WAvmu4h3eZXxuWRxOeWJlKQa\nV5sK/OfjfrQmuID6lEZl/X122CyGb+NBYLFISrOD1rbotiAEobKn8SlmdXAL\n0vl4AF8673w35UgPjtJoAKxibYP7qY+DouTZgtLKAeEzt+GsQiTcxUPa7CiH\nds3+\r\n=REGK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIDoeescqrhRR2Yy8fDEiydDYj3an1z0JSN6oxgUVeq88Ah9u8WbiHJGB/anZkPy7qDbAmOJNLZHaW3BPAKHz9J9a"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.4.4_1533843856369_0.799681663381048"},"_hasShrinkwrap":false},"8.4.5":{"name":"wavefile","version":"8.4.5","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","module":"./index.js","main":"./dist/wavefile.cjs.js","browser":"./dist/wavefile.min.js","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src --recursive -R dot --timeout=240000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist test/src --esm --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist test/src --cjs --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist test/src --min --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-esm && npm run test-tsc && npm run test-cli && npm run test-cjs && npm run test-min","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc index.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.5.0","docdash":"^0.4.0","esm":"^3.2.25","google-closure-compiler":"^20180716.0.1","jsdoc":"^3.6.3","jshint":"^2.10.2","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.3.4","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-terser":"^1.0.1","terser":"^3.17.0","typescript":"^2.9.2"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^16.0.3","imaadpcm":"^4.0.1"},"gitHead":"52d242b1f58bcc2cee1a5215660b0e2f6c4135ce","_id":"wavefile@8.4.5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-65QXqxxbfVcXVwkhJI6eiOF960J5HgE+k2FjXZF8cSqABWYVAuxcmhdloCI774s1pVmAPsbexnpt1GGk5IMvmA==","shasum":"794d9d3c19f49ea7861ae98ce46912d5005f185e","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.4.5.tgz","fileCount":14,"unpackedSize":492407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOfUeCRA9TVsSAnZWagAA29gP/iLwY0hVUVU7zoLPFjdB\ndoSD2DAZqNIdYjApaPQ2AH2KKhEisD+tJWO/YRmDf/15w38O1xEXSPGekEHn\nNfpdMymfWkmAO7uoFARVEtQ3iD4QWq/2KNEKhDxGAwNDzZAvnv8U1yjZqhxR\nDoyAU//7xZja9b+O+x6C67dISCWAHGKx+V6bNkvB5G0VG5l7tYF0zY4n+f43\nR4hAWysziIvE+gzzk7I/bQ/Eb8pTpoGe05NkaYZPNYJd87fFQTIdASFqhTUY\nsmYCDMe4oG4cFeAop7sNqXEhVWMQFTY7JBLQD0zNJHrQaBYEJyOwMjJyvQ95\nMq68YY2cH+Sc9dc9TNV5TN0fdZK/bknFJa02mp2niXA34M5d4GQuHv5PZlCn\nIVwhHqBC8VFo9PZvaZTwffLBP0RheNqJqhTEW2E1pqvgMS/32LXoNGBG08qt\nPNNdmds7k/rKgfUaKR+sQLZyesPRdXJlsra1OdStfX7V6P5jBfvwpJAvU/Ro\nAttRIvJjUY5hh3LOpKFuFvwuvkN13ff+MeHaDzlTMhsKzzI2s0FCcEoVlmZx\nmqb+ksYCPppDvhqBp3Znw6XXHpUFVSLiPN0kbGUX1CC+QoxYC5MlzHYQSaXa\nzvpK6q/t1olF3kz3/RticCxnRGo8Xg48DmzeX3KykTAf0h7T2kjdUHON5tIk\nTLdf\r\n=6RUi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiKnARCjvLgxKfDNemLV/6qoPjJLpfrxO87+PjpMI4bgIhAKCN70kN/kjWU0oHKYmeVZjTfaqcqwbmhf0j5rWrRZ2i"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.4.5_1564079389375_0.471809729299997"},"_hasShrinkwrap":false},"8.4.6":{"name":"wavefile","version":"8.4.6","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","module":"./index.js","main":"./dist/wavefile.cjs.js","browser":"./dist/wavefile.min.js","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src test/wavefile-parser --recursive -R dot --timeout=1600000","test-esm":"node ./node_modules/mocha/bin/_mocha test/dist test/src --esm --recursive -R dot --timeout=240000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-cjs":"node ./node_modules/mocha/bin/_mocha test/dist test/src --cjs --recursive -R dot --timeout=240000","test-min":"node ./node_modules/mocha/bin/_mocha test/dist test/src --min --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-esm && npm run test-tsc && npm run test-cli && npm run test-cjs && npm run test-min","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc index.js ./lib/wavefile-converter.js ./lib/wavefile-creator.js ./lib/wavefile-parser.js ./lib/wavefile-reader.js -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","codecov":"^3.5.0","docdash":"^0.4.0","esm":"^3.2.25","google-closure-compiler":"^20180716.0.1","jsdoc":"^3.6.3","jshint":"^2.10.2","mocha":"^5.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^12.0.2","rollup":"^0.61.2","rollup-plugin-babel":"^3.0.7","rollup-plugin-closure-compiler-js":"^1.0.6","rollup-plugin-commonjs":"^9.3.4","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-terser":"^1.0.1","terser":"^3.17.0","typescript":"^2.9.2"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.3.1","bitdepth":"^7.0.2","byte-data":"^16.0.3","imaadpcm":"^4.1.2"},"gitHead":"0bad66dd470bde05863df347336c6fdbf9f3658e","_id":"wavefile@8.4.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-mKvPtkXTFE3U8Uo8qJr/hCJP3booCI09vsoWY3OHrdKB+8ZefO/5/wSRZSbPSgFDB+WWn3Am3c01h/sguTYuyA==","shasum":"8c99809df1a344edb12839da69e588bf53c7e483","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-8.4.6.tgz","fileCount":27,"unpackedSize":558016,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdem6yCRA9TVsSAnZWagAA/6MP/i5PM1OsP4HSMn8f4lbm\naGY9QetcXauLs7sTZ8cUSSgBf6LQVAV+IHU4Cj4MkNE9s7rOd5+wQeiWvSO0\nyM2B5/jPavmNYbPCuxjKd0WrMF7xnT42g95NTTCA9jWAR36bVGEW369ZTaEk\nsanyohRj+fSfpIy4oicfcHvMx51TtUXJoctCP4a9ZtVgJhvIs9EUfClkUMsa\nN9N8nPc6ggdluRtc6qSfrRjRvWYwt6txonk93UZWg+pVCxpog6+b1vrGskMJ\ntjsWwEUrMx3Ng++lnvFILxzdvHJ+/VXz8d8Es+qPdC0mkrxOYmFOVxGjonde\n+fMjFcJusoH1YyFlvbCDDxlwsnedWHdE3BlmJSjdW5pXHj0dKpf6S/s9f3VW\noatYxR8hmqZ+xtu4XkCPm5KjH/HE1K/AKArgPtDg235R4MKilWpJSr+zbJVO\nTxO2WkW2T1iAvrYkkClpvuhQfGVpk5sV3vWBvZ4SsnY1VaWHyLLplk8yI1SC\nRFcGBv4BtRfwOmaSl7AhyEGKiCWY+2ifvo0OEh336gnp8dlk2DGXf0vm1I5a\nO4bnKbfNYsKhdbKF79TPos96sSqls+FNP6nPaZZSwWKEvuEZqIBxa4r5nzTm\namoN8OOHGnhIgdaxOkVreutG7gPMT3BYJIu6mlY1hRgbWrOKPou0FcLkWpRw\ng4d+\r\n=JjGo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGb0YhLkqsACJ5j2KX2m8xxOqyuU7pPR6LLveg5CyaAnAiBTB2LSwE2iTSHb9XJ0LQLIYgO0LN++ymO9oos5eF3gjQ=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_8.4.6_1568304817403_0.10880129236470681"},"_hasShrinkwrap":false},"9.0.0":{"name":"wavefile","version":"9.0.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src test/wavefile-parser --recursive -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"npm test && rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","base64-arraybuffer-es6":"^0.5.0","bitdepth":"^8.0.0","byte-data":"^17.0.0","imaadpcm":"^5.0.0"},"gitHead":"da797414956e1d272419e04a520cd3c7a862fc76","_id":"wavefile@9.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-CYbH0QwCt+yFfUlmgDQjnG5tCuyTxcfOGLECsHAkf0rbWzFPs4eFkmRC1BiKqvuf1obx3goa+ljz/P5dCrnZ6g==","shasum":"cc1986290799dda6d9f2393622c064a5f2be4e31","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-9.0.0.tgz","fileCount":24,"unpackedSize":203204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDD53CRA9TVsSAnZWagAA4V8P/AhuFG/+INn/FLp197BB\n5erSegOIjqqCZZ3uzENjsbvodO9EmzQfdIHgeijJV+nZozfnJd98zhXAE7Le\nPvuvrFGfl6RLlKN6vyhzM92Fry0/O5GljWl8muPxk8mXig5qcSRylSukIG9M\ndBcVY5DdX9YZHRVSQy3CGnFtjGP0jldJuuXu12f440riW502NdzYVKQSgCHu\nkxZM2BQw+twWMbUIGPFI12DvH9R3MDDyKzoT2qsCe+CXkjyksItgI1SIfoiN\naLlBpw4V91tCjtH0rZmGnlCNZZfpW9CyvzgLzXf+YtAyAr9ILJYa6y9r5P6X\n1WQ0UncWPDMaboX5wWeEfTb6Ny9W7aoiDiYkZm19tmV4f3v4GqL+pkiUjGKB\nSiaG8FtQKN1nu3c6jvo7J5tJ+vdp+i3OjkR1OyhmX5LJZrT58ApbazC5FYpp\n3hfmtc8QDBzUGVAPYQoKRY+tmznoD6Towy7U4ch7oeO9U/dcPXbQQPhjxRBW\nPyr7wJ/6BENODFyc5QNECp9qhn3ud3PfL+DIPE4Cy0LRwroc9pgHyzmh9nRF\nws3VACd1yKudjR24uSGjalGAI7mrUwHhTYig9MMWTkBZOTT9PIqx/BXiV21i\nxWKPhJihzJjOq59va1Rd5TO2Uwf/ZxMxB+fmylwLxtmvBSpaDgbRxU8QddKE\n08lm\r\n=7gyO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhqseT56NbxbM2g+2aFDMKsFl5hFR+2DuLlL9OWs3QDwIgYX+SElDphg/VQtTzU7l9JPCzdJ6DCwzasfzJUwycybc="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_9.0.0_1577860726706_0.7211160086955579"},"_hasShrinkwrap":false},"9.0.1":{"name":"wavefile","version":"9.0.1","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src test/wavefile-parser --recursive -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"npm test && rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^8.0.0","byte-data":"^18.0.1","imaadpcm":"^5.0.0"},"gitHead":"36e82ece70be7741d86eae9c3dad073dff354e98","_id":"wavefile@9.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-+gtXeSLgKnlHm+NL7GUl1foX4ahjJSMtRNIRUQb9+5HxJWPX+QbZJA+4qakUBp+HhHEoYPC7mOODJg88wtrw6w==","shasum":"1d74efe76ca08aeabda5dc911384bd3b0768fa42","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-9.0.1.tgz","fileCount":25,"unpackedSize":205874,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDVk0CRA9TVsSAnZWagAAuMgP/iGUdYi/WCL47X/5MOaB\nqsPcHhODtbkkZzWAOxEPuWLMSErlt9/NIG7LzKqF6rZl31Ce7dS5yZNMa2dz\nkyog1dMWmO8IRMHf13GKHbaiFqcQVaR4j6551m5KjV5w2sefm73OFudHAtyT\ndiEW96VGVBZXesFJcQR1tYsdh6GYqWReQhVeJdBrhi7a4/AM3/jo9A54CWwy\ntfDWBKaPGgxISjCAAb1oJJwpyBpcpcK9fWHyAvrfLoHDlm1HNZHGtaAZ3QCk\ngNhNRjgvc8gnMbrupMt4EwuqiLTSFpebp7ukgx6yCdWrnpQi2mZdPc27W/gK\nGJN7wSRQtq4/zXp+fH0lM0BaaJEiHqunFPdNYy9hFamUzrfa6r8QS5wuyg8S\nXpk7WhM1fd1pkDCMzTq0x0HttNSFTDPJR3LWCR9pPEjDfgNCHY6kfA4AH471\ntBit+NsjNy7QLPnx3OsbkLFodOSJgiUYWzZZI2URVu2XNE+EZHP7DMgSeitf\nvIA78wygFldvRndZbXV2rnEtbJxsY4wYy/eIk6uzkcvyDjuPQNEwnZvJi5vn\n60d1pAKGH1+FaW727Fy2swtdw4wqR6sKMle/rCM0KTAzWBh/llYTn1tIBHVs\nyg8nH6BGVeCIa64Zr6bwoCwwisj4ZYOXB7levGcNeEqwJhJo7i1tWqDIIjaF\nbi2W\r\n=Fo/c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF51D0+McCNQuqiyVhZKvQwWVEFXUB6nQ2p2zIdqSqk3AiBizgWhQugxhYzA4sLzYMQBBoJw7h0lUFt6QqmJWNGfRg=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_9.0.1_1577933107583_0.13702601660778346"},"_hasShrinkwrap":false},"9.0.2":{"name":"wavefile","version":"9.0.2","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src test/wavefile-parser --recursive -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"npm test && rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^8.0.0","byte-data":"^18.0.3","imaadpcm":"^5.0.0"},"gitHead":"852fb37a94dff7d59f38ab0af79a2f67446e69ec","_id":"wavefile@9.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-uLl6kSggzd1YFgZ1xpmYSiIlYNTcGMSRaHjvoeaWExLH02ISk/KRMRyhT+9mmvMfXjnsYgFyQD5WD528AosAPg==","shasum":"a80f0c747e9e796581ccb48354284c9d4c256de1","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-9.0.2.tgz","fileCount":25,"unpackedSize":206393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDrKxCRA9TVsSAnZWagAANeYP/0WDGIY5mXyNvn6ndqC9\nw2oxZufI60TxbNmn2rWvjRag7Kw/YPpe6tygltr4YVepxHMvj6OPDDwUDz0B\nl/SL2UVQc/0lolwXJTr/sQz2hoq4rox6qn6kP/eHV0jzC6WuTHx2Rbbty5wr\n3kSCwMUbig+b6XbdFCuiSv/RrVB3IvkmnKvurkcpLwv9k+zuqxDDKDorE/MG\nv0+deLSbPJHZeOwFJRJrYBnAylshQo5x+rUK0whJbkLRWLGH2xen0mgr1cS3\nE+CvUVUj1bQfoVI6SxafgN0UeOuc4zWDkBWRiOzhN2QHzgIxpIdjfcXF6Rnp\nbKO1p+rCE73CsnvWZ1RWcBNKmWrLavZ9tBCttyEnv0rP66RgY4e+a84f76D9\nZIaRjWwXXerXO95J9dwisyrkdAxsdg77ceWRnEBYtwIDPAhjdqEGOndT1vDj\nw+//fE/ZskBpwhLgdfSBcoc7S3QtUwQo+q7oy9qrN9LYS1ae+nNfFzvpFuIl\n1W6D6sgFCKyNZ179+VnRR19fJvZVC+mLHb3wLbNLScRX4LeeCx3NRKJ0jQ+o\n3aNdhEPCThzfJNODvF/vQ6PbxSpyst6o1+reXA7sOtVMB3ZiE3hWpEFSXuLb\nygLoZpsrvL725DOKoPTNN7bPGE5IVU7G959mWDGhKWIxZq+VW27oEJLbZpDi\n7MjY\r\n=KFM3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDX6XAQGZB3QHj1j2HZDQ96cYBw8Z94+ZrkU6L7N13rYQIgePQ2RGQ25SOPD4hJR7AKt1jiaCO8BRDCV1j2lKtx47s="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_9.0.2_1578021552405_0.44918567091085704"},"_hasShrinkwrap":false},"9.0.3":{"name":"wavefile","version":"9.0.3","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src test/wavefile-parser --recursive -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"npm test && rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^8.0.0","byte-data":"^18.0.3","imaadpcm":"^5.0.0"},"gitHead":"a73567c9e368214e506f27303e672d2c60696c67","_id":"wavefile@9.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-8DzLDHUAvIStTfMyyEsu3BecENfmzhsom/od6MfpeVqr/FUwUcqeYPgl4CLVGUiXBHkrqheZn93OIOu4/2keBw==","shasum":"9ac1d36b8e6c572bf3652c3caf50c8db12713299","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-9.0.3.tgz","fileCount":25,"unpackedSize":206582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDuujCRA9TVsSAnZWagAAh9kP/RiKPgaXCrz3DRF1TzNF\nQXF8g9KDan5JxyjQLtHqnsEh/ZeyNvGz/w7qpni11q55KXTonj/FFRWvHhwA\njBPv2c5JypjqRBRBOzBSmcCuBXAgDVF8c39VJNaxIroocvAwD5GvpJVW0fnl\nkTMfYD23Wp5UU4j+FYleWldstor6rA3yfcwM6gmEB5IskXzxGekBGv3q3Q1Y\nJg7yeBM5+a7efFHQeyPN+xwJlFqn9s2vWwxaiJ/JL95zZP+j14wX9U15Py4n\nEgF7BI6ZjpJBSsUZpeVJ/K1T9OZiaP3CnVGFz+BvKfc6Tdh6NoHapZFYUhaH\nK1Nl1B5BbRbgIwB53TU5QjRTW525ZNaM1rNXiahEwk1fDB0y5LssicipWRmN\nS9HxFZUImI1AP9YPxN1XwpCckNTXu/SldliqXLooY8A4WWVDgC+z6+uaDpyJ\nJG41OeO8i0rl87SFrhndASZJt8rlJrrYQctqt1CDlI6Kt/HxSbNdFIK0ud8O\ndqKcO1FNnja2BIel16hB0iXUb6Oe2DuqMYwhq9LTiaaMN6wd45m5xkhD3kGO\nu61tur12y70Yf74xyUZ2xxTzeD5/0+aTO3Cls0agfnw2YI2FmDvs0spnrlvO\ntWuJN/4esfblsMGnmpAMuFfhCjJk2+fzdJulM79lIsP8xCdMYrtcl4xMwEpO\n2F/I\r\n=sjEO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDMmAYirarqBo4DqKk094d4viq1PrTW7i88KMcnvoalVAiBXbseclxvYhuQjQqDxhHndhllc5K72BpHshrWhBQZExQ=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_9.0.3_1578036130423_0.4107035071336911"},"_hasShrinkwrap":false},"9.1.0":{"name":"wavefile","version":"9.1.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src test/wavefile-parser --recursive -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"npm test && rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^8.0.0","byte-data":"^18.0.3","imaadpcm":"^5.0.0"},"gitHead":"f014e9800397feb323e31c54c41f0dd5cc239a72","_id":"wavefile@9.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-5HBWYMIXhg7JHMriO7ZVNpZsjS15pZRIbyB6tL4KcGPKnzcYIr279yrfvv5Ltr98zdLKookJ7WEa9vzj0LajKQ==","shasum":"a34460f7d01c2310e355b7cbae5cda33a71195e2","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-9.1.0.tgz","fileCount":25,"unpackedSize":217120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD7s7CRA9TVsSAnZWagAAnTAQAJBjp++wtI/qAv1lCMQS\np5O9xPTmchEAQjcEbQJs7Z58Ri2R0T+YrrwisLzJ/tnV21muytGwBm5yaK9b\nsB875Z75q7MgEaRkIoZoj07upB4nETsuIEfwOwRnOdm1lXdiYbRdBQP6FGVL\nCCJBPmHQbhbElaAyl1wt3/P1eyJ8KNmuOpUtxNlg4t2GHpOFdXshKp9OsKNH\n2B5FWc8HkEouGwqijUAr2r/5jD8gUsMCiboG2KtdZIBeGxT6ACkEajgFLl1h\n7fonZQEZdIogluqXSXRr2+Av4pNeeWBgKaVtm8cnAuZIGxkMgLmpJrvMT0Vq\ngahjvJQd+/9ScKdE+8C2XwEvaOX27OaYU8GdKScvY/f2em+NvmA1NXafA6Av\nU0hR2EVdyWD5mUtOCenwapqckO03teclRVCMTugPIxXa5fIcMpxYeJQzXml/\n0Yk6RdhFSiUltOhPSTuTNequCtvNrRoIZIOoZNQPI8S4gBXavxzu8EjI37Ja\nT5yq9IosYXlmiIUu2UUHzEbZMFnZhk9f1J18+6zUia9TklboMJsbJSPizM/x\nEF9HeNJ26CPhx3ZAirPpZIgiNA0uoJ3E/aBGfcNJ2GN+2u49lIZrateAA1xY\nHMSN4qYbt8SIQXBBVtJg8s6epoDeYufw2IoKKKjcHghaTwBQe28n9JxJrpjp\nIgny\r\n=8THw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBh5OUEJWQuBFlozstaAyEKg7GDfyQOzSBr8D9FCDXsDAiA5pJ5Y11F36TUc5Eutwlx4tDM0EA/qelpVeVvw3Ld22g=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_9.1.0_1578089274880_0.3037187190839581"},"_hasShrinkwrap":false},"9.1.1":{"name":"wavefile","version":"9.1.1","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"npm test && rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^8.0.0","byte-data":"^18.0.4","imaadpcm":"^5.0.0"},"gitHead":"471f050d60425d22a9d42fe77fb5d5dd1d490bdb","_id":"wavefile@9.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-zQXR2M3dOHyEyGXPLcVVjmS5/YJ2A+tOalYlWIJJKb06Ur8yQ4qs34ogrufbhOxPiJQd+xyCf3nbtD4kzB7S1g==","shasum":"03a8e0c88a18c49c679265da0fd8d1f28848dd33","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-9.1.1.tgz","fileCount":26,"unpackedSize":209688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeEXcyCRA9TVsSAnZWagAAQSoQAJSSwKjKx1p8cEPgTwVf\nOrZ8yB4ct007DlyyOgrjW7wv+DnrR4C4a1NWywAnj7NU1FvN68L/R1ZGNmrO\nDLm7mIk1CHBqdfKALcA+xYC8pxpLHVi89kNEzotvfJkgceKmLyxNt81L6IGa\nX8Ov2JOeC3ClzGQAWK1mwF26ExPFe/ROtntY4+bkcA/bill8/AaGfMw3cono\nvqLJD2+OS4cp/36oDK3klPupkpsBdFyUs9IvoMIGaW2RqNa99CA8EJESaQIK\nwKwGaODNitBUFJIhC856zhrxwtctClp0JgpcxHTHM24zgLwunGU2c4QjIdUR\nVBo0E1dWrwVN4f+jO6thWRUb1Zl91a+p3IqekmD1xMBrH/qHbDSqU6JwT0+S\nR3otZqTbWulrcHKDqnxy4xBNUP1Ln4BAX9XKdU2Y0V7sslWiChnmtu5yXarl\nQ1zyrvG6ffbqyIwewN+pB4wLgeoy0oBiL3MTLKrW9Tji4Nh/i17RIqJ1qwDq\nGQ8SdVCJSvTTJZpBa33chFBEMd9APmZgvCXBhBI+V/6holklKVQNXXxFtUwS\njEAWH6h4q0fxyAiwFx2+QoDnt7cvrnbOIxcMmoR9zto181fS3wKhG01WpxGx\n/T7lt31hpQ0Yd/UINoMcpDhiwPDHJmpGfqImMeMRlxL4kIip7ssZxzbuFikA\nUX9Y\r\n=dvkB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwngC1g2I3ZGC4zGuCmc1TUPtazqqQ88rj9z3cvx94wwIgGzLPEcs8PZq3KlDTFtlQJrD+Z2VH0riRMNexgHkAE7A="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_9.1.1_1578202930043_0.34941131125659175"},"_hasShrinkwrap":false},"10.0.0":{"name":"wavefile","version":"10.0.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"npm test && rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^8.0.0","byte-data":"^18.0.4","imaadpcm":"^5.0.0"},"gitHead":"29aa6e6ea443ed043d382d3dfe3371d8edbb9f57","_id":"wavefile@10.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-rgnR2PcTbKXl04HY9uAsMcDWntHj9zmT44FrxKNDvJ6Y1hbcRlXY2UdhU6JBMJXFyNoWClRzhc+Qeum3hRK+BQ==","shasum":"e52eb0092b1b6000ab8cd2142dbb424ca50bdd16","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-10.0.0.tgz","fileCount":26,"unpackedSize":223065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFEFaCRA9TVsSAnZWagAAek4P/1NLfDcBdtbab/ZWZSOA\nOWufPr7ZZEDFu7Id3EsL5wuLuWpC0L4FXtih265a+XYWgrQHzIXDG3KHmE2x\nEvnX2cGHJpOHT96c8mq0t1Gi/CrYxtFawXmGWjxLds3dQbp0cS6uw8vAAjpU\nEn9FX/fO6BuBcflmFaN/LVhxVu6hmApWLW6tAI67uwjwOrgBBc7EPxkZTTE+\ntwenL/h76Qj6T+M1ytYOWLPBwWC3iPeSwb3GzFaZg4j2Qbfc+NYF1ciM0gQC\n1Jyp36e3u5zxGVA+8lH20Op/o05E28P7CtMO7dc1dM2acqIU4Potg1MAdHIb\nkXjlQ5EiLy40smvBJH3UnWXU0FFLLtoa1WYIVPEANqrr7b633jlkVay34XdT\nYXw7svLHQmnnvJ1O34NjT+xpO80w4HUPknUv1Rbzd4Y85ZcmaC3OJvtVcnJJ\nlqulQSZAaSTpkV+LUKVbC/jvWCQn7KwvDSoI2io3uJERGxI19C2EPuqDCohJ\nMWoC0r2OViuPZZYnXabGMwPA/qIj6EIhHNoJjR733gfrNvH9E7geT3lOc8oV\nBltqJRMbTzFAJx1naUEBi/wshJTeqoxrFvIwPYJk3RcRpS+NIDFa1NMozpgn\nXETfHzlE4Gn7j1/vGrAU6OJUw+q5nhfNKzywnuztdQyzBpv1dX1Jna1eoKuz\nV81c\r\n=Dvkf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICsARz7hX7eLE5dHymDADzx5FPmJsqitcoAfJiYMFvu7AiBj7r4Qw1Rkw3ntFmT/BeoRFspZk7tXa4hUImCMwkfy+g=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_10.0.0_1578385753455_0.7270266585545373"},"_hasShrinkwrap":false},"10.1.0":{"name":"wavefile","version":"10.1.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"npm test && rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^8.0.0","byte-data":"^18.0.4","imaadpcm":"^5.0.0"},"gitHead":"c898d226dad24e69b01857a0b400ee778dd44716","_id":"wavefile@10.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-Tg6ov3oq385HVy5Y1nGKOFldrlHKnaNIqwEUe+LGSCO0P4+uPLnA5XfGRQg5hMNUgnWEn+HI8mgIfJZag67OSw==","shasum":"11044846cc386d694dd5cdaa280144b4971baae5","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-10.1.0.tgz","fileCount":26,"unpackedSize":226733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFivgCRA9TVsSAnZWagAAAKUP/R0CVPKkEsyKWHqVtfyO\nhDVAL70QZo5gErh46Fca2dA6i8O/K6C1hHz1NDQht40x9hF3/TdfzwOa/xXH\nQO8Z/xQ79TCDeeJphJGRByVry1VCLouEAiTsWVaUAja/1KaAM+DWdzjP6s0C\nSQI/Y8M5jX6e2s9s5OP8i7FWo4n7AMrdD5p9qLMuMkZfCeHSmSHSI2G3YO3D\njabB6cJhRbosK2rMzQUwQaNW0IgoPa7TT0VO/dbtpLjw80pXelaG6iUdR/nU\nX4iEORBt/NclQSpkrc3m250q5OzfNFBLgjoHrbU9Xoz2mIq4yN5kLJAkHJw9\n6IAEotoyrD8Bb5Faj6GdR3Wo+y9vgokTzhq3IJOnVVt2P1cItdj0GBgf8J4O\n906qGGj7zoGm/XVPgAHZoEQWJgj3SEyADbbVLfkuDnZPDZr28a4dvaUUPXTw\nhIGWPDMc9uxYKSCicM3eDWgjtReAYTgqliu9xEmOGdY7Y+5xvoNJscy1faGX\nmglrfTihl+GgF1/0KftUnCpK+Uda+WSgWIq5jjsSclvs7UHm8GNQ/dZ6o1xq\nnxLMLZJY1yddGQ6wkGgoIctjsEI2id+xMc4zIunleBqFtnjfL+g7oLY9K4z5\nyXFg49qMlLT+SIaEzIOGiI6rnN1xHujtYiYTy5fL2Pc1IvugS4F2MOuTFEyc\n71Gr\r\n=HyoU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZIjmx40N0x/zAOMm2CVe8ECrA3uXaeT396G2WgBjobwIhAMtHto1Wli4kQrSngtshiJ6/YuX6C2bHcAmKk8YKdlMu"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_10.1.0_1578511327333_0.7690497045622149"},"_hasShrinkwrap":false},"10.2.0":{"name":"wavefile","version":"10.2.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue","resampler"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-sr":"nyc ./node_modules/mocha/bin/_mocha test/resampler-full -R dot --timeout=1600000","test-sr-sinc":"nyc ./node_modules/mocha/bin/_mocha test/resampler-full/sinc.js -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^9.0.0","byte-data":"^18.0.4","imaadpcm":"^5.0.0"},"gitHead":"29f5b0301e7037ae185204e366e312a11d750665","_id":"wavefile@10.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-yn6QmxUqv9gqv9InyuP5rSvhrt7KslCL+GAPbnNV8Mlq3Usa1ixjjidLDcPcr1zGKrSvrYePbeKEZ/u5Pj4nJg==","shasum":"215c155eb2deae35611028cbf7b230b4478b01df","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-10.2.0.tgz","fileCount":27,"unpackedSize":247252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIQP0CRA9TVsSAnZWagAAXE0P/2zNX5qYCDYidK51hg7h\nBtexU7N9Z6u3XpnnD/CCsLbbS3F5tPqn6bD4vSMecJohDWmudBhBlAHFSPB3\nnyIm/l47GdXrBMQYjq+1gtIxhfPza0ZhWDGQNQOqZ5NnYLMIdJQMKMjrWXCc\nMg0WMj7Xnp9cWDkGmwSYY7ZsTLFNQ6HSFWRNsGFJwFv5AsyHnZg/i6KxIn5W\nkQ7yrYW0Tqpzzc9Q3fFAORRfWdK68eibvxcJ3XrGw2LzCycETWV2aHeLFSQk\nDT2nNr6YXqoGvw0amSs93RzRbp10KUV5suF3Mm2oYspz3qFdqbZto1D/aW0c\nBDQJM9CsNft9StE8Bv/sKjM7XxKwgIMEZ4uCiC9gLc/+UX7BRLDrEGe/KkFC\nlgH5SrEoAkiAfwdxcU1hgFZoB8XXy28iaKRZZ3iETINbOov/zcUr7ztZA3SA\nL1x4MbP87OHARgk4HGKpTlM+uWOl0aZsa68HjMb6VUD6b7tmKUuDLYUXw48N\n9McXDp4eucdlVYFLZq/L1LENIHW8X1ErFedeyiLPVut8IdI/2G3/vY3yLXKJ\n/DdykKjACey7DW8GKbKibBGehl4ysTirarHVMjPSpGfg3dklXTziWQmJbpT9\ni03si4th7rikdrvj6mSaB+FtNtgwMHVxXOI/LOmSfZyW6D/f0ONk36lMaXSq\njcB+\r\n=YDv6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2eb4uaH1ra0iiQ4LEHY0vxtemDs0wbI/29YF9lF96jQIgVM/H4QrwlQPjYn9gBGdmz3AsBix7op4AsgTJ8u8U18Q="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_10.2.0_1579222003668_0.21036002679918675"},"_hasShrinkwrap":false},"10.3.0":{"name":"wavefile","version":"10.3.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue","resampler"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-sr":"node ./node_modules/mocha/bin/_mocha test/resampler-full -R dot --timeout=1600000","test-sr-point":"node ./node_modules/mocha/bin/_mocha test/resampler-full/point.js -R dot --timeout=1600000","test-sr-linear":"node ./node_modules/mocha/bin/_mocha test/resampler-full/linear.js -R dot --timeout=1600000","test-sr-cubic":"node ./node_modules/mocha/bin/_mocha test/resampler-full/cubic.js -R dot --timeout=1600000","test-sr-sinc":"node ./node_modules/mocha/bin/_mocha test/resampler-full/sinc.js test/resampler-full/sinc-no-LPF.js -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^9.0.0","byte-data":"^18.0.4","imaadpcm":"^5.0.0"},"gitHead":"0842559a114b3f20bc358fdfaeda7cc0f7320870","_id":"wavefile@10.3.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-nj5tIK7NGARUIleJgQHKrLxeCBsOKbhBnoDaJAnvhpjKdqbChSyilr2ZCZOwx/ZvW9S4ozeQq2vHdBqLAA0FHw==","shasum":"0915c5e58e7c2d805e3c3cfb88d9a7e6a6846b59","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-10.3.0.tgz","fileCount":28,"unpackedSize":252462,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJiDdCRA9TVsSAnZWagAAMDYP/3Ir8WvpzmTFaeID2PZ5\npuxczMYZh2DXr/jfbOWDClAwy5Fvs9s26Do/f3xQ7ukR3k/Lnih/xAizE9dX\nKEnadaHWTHcLwQDZiND09ccRZOcudyulw4Vu8sMj4nyKKLNhr9z+CBdQhuo0\nRnf/GSZCoECDw452f341f54c+5yP8GQ0LCaN1lf+1DAiBkUIQcl+yCS6FJsH\nx9/ZwBwcse1EeSR1wZXkTByucDh8t+NDNLm+LICe9M5hxBUrLokbekOIu0gI\nPSbBk7Oeqt7sH2DU7yGQ+cEGlbp2UvDb9hBseVrWdY61k/U354ThT7pF2hqb\nmH2KY355intxc+MLw/pkwShc49+V4N8DVJJM4BUN5cepfttFFX4b1s3ji1fk\n9D3OS58tnp10v4HaJg92LDopaoG60Jy5itlJvvjD8r6xhEP/lQok5vvloWGi\nQ+kbZC6VMr68w3p4el0xuLqlzvNJCdsrkbWTkMFgP7rG/oB0xWh/OGwWOVeN\nEyWQ0yNk9JCh49xSJFP85K/nhgZ63f90hZL0U0wL0SRpoW/WYYEVESLTJW1d\nKHs0oqruX3FVwz1egTANIcIl2//Cdr+e7c3RDlw17lV1iGw+PqQYj6D7m4NQ\naO4EaOtpbOpEGjprI16joKqu+/SYEO6uXpsdRq506u6tIgKxUPImV8Gbz8l1\nZjs2\r\n=EtS2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhfClUMsa4BJHVQguDRTn70MjNVbCou7GsjUwlbWx4KgIgWiQgMrf302DgBtq9eN3vpDcvx3CE3iHA6YafN9g8068="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_10.3.0_1579557085341_0.3756710620858019"},"_hasShrinkwrap":false},"10.4.0":{"name":"wavefile","version":"10.4.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue","resampler"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-sr":"node ./node_modules/mocha/bin/_mocha test/resampler-full -R dot --timeout=1600000","test-sr-point":"node ./node_modules/mocha/bin/_mocha test/resampler-full/point.js -R dot --timeout=1600000","test-sr-linear":"node ./node_modules/mocha/bin/_mocha test/resampler-full/linear.js -R dot --timeout=1600000","test-sr-cubic":"node ./node_modules/mocha/bin/_mocha test/resampler-full/cubic.js -R dot --timeout=1600000","test-sr-sinc":"node ./node_modules/mocha/bin/_mocha test/resampler-full/sinc.js test/resampler-full/sinc-no-LPF.js -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^9.0.0","byte-data":"^18.0.4","imaadpcm":"^5.0.0"},"gitHead":"8f780ac63444fe52167d376934e85f123a183797","_id":"wavefile@10.4.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-tN8TLc1q30R4RDukBNIwVwXMTMmEl6Gecm12DZk9WKdyE123pRlmpu8pydNgNaczWw9eToNhjigN+Y1uIcR3fA==","shasum":"f29c27ad7754f891018ec6ca10a1a2d63341c928","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-10.4.0.tgz","fileCount":29,"unpackedSize":259455,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJlstCRA9TVsSAnZWagAAKccP+wXMfV57vDkXjM8IHULa\nao5ssyiaPoP6riZ9DIZi/1h4u6WrXoQ8JsPFhJOTe6VVb3kuemSCmjDUEOTk\nuaGbBFGiiAOQL2U7KoCEWhReuYFkaUwcIgPe2dh1Q4xB9QvDsWpP8Dx85yLD\nmyz4y2n00BUqXWUOHaaNPq9TU2p2HBxcgWGfG3uZedkUZdz6DALlkoTr9ait\nXqG/VT1sNBHsULFELNyK0i3VCBYUz2l12dMrc9rS+QrZYq1KhJb0utqCGmsk\nTfRZH07PEcX3zbfu9eHFGzIAplTVFoIP0iCZDXlmOwyOhSBMF1RiQ3LisJul\nZrdIwFLiaw8ykETHOChcSDFv5LJw5Yko9aSmN4I1Yql/99rS2TRtxdoObZ4p\nuCklCHtoYimlqgAxlIymi/7E43q+Hfepb/ryLXicfZic4XZPJZHf256q+IlQ\nzTl2RJns+IISnU/CsT3nbS9CSaAo4TTwiFZCSdzAL2WFI6y/E2T2bmTfuSVD\nMhLhDavlIKE8dffNy/O6LOqzkttEXWa8ZJQt7Y0klQJPWPSx0rbCcDZzlcCe\nJRwJ+ntc3z1GjRM4Ecp31XZ7PoRq8DhvyvfgQFEu6vD1V8ZS2QVEOPEFXRA7\nBBMNcC0j2XqAsWVbxEVTqVWHeH5e0/T9VI55FjkhXOqSXoYosIOWkX/t0vSM\naP56\r\n=Dki1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOrg5edHIlewHBIQjrqQC3od/GUsxYQyUn9XKZGGRTuwIhAJqHFzckOjDnS9aWkAbA8C8krL6DEcJaadLHa7Xx5q8B"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_10.4.0_1579572012953_0.8845718572543353"},"_hasShrinkwrap":false},"10.4.1":{"name":"wavefile","version":"10.4.1","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue","resampler"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-sr":"node ./node_modules/mocha/bin/_mocha test/resampler-full -R dot --timeout=1600000","test-sr-point":"node ./node_modules/mocha/bin/_mocha test/resampler-full/point.js -R dot --timeout=1600000","test-sr-linear":"node ./node_modules/mocha/bin/_mocha test/resampler-full/linear.js -R dot --timeout=1600000","test-sr-cubic":"node ./node_modules/mocha/bin/_mocha test/resampler-full/cubic.js -R dot --timeout=1600000","test-sr-sinc":"node ./node_modules/mocha/bin/_mocha test/resampler-full/sinc.js test/resampler-full/sinc-IIR.js -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^9.0.0","byte-data":"^18.0.4","imaadpcm":"^5.0.0"},"gitHead":"90242f9d2b7e0e914d8fb2c5eb33004aebd8519a","_id":"wavefile@10.4.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-qqtqVZkt0M/8UpdqxCqdbtjfD4LStOrpGAUZ/Au0/OPmk1uR4q99pGxfxlgFpemAxvPcN1oe8Pdhe6/Ad4YOlg==","shasum":"ec8573147ae7efd2f8a9656ee28e6fdc96be865a","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-10.4.1.tgz","fileCount":29,"unpackedSize":259401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJy3CCRA9TVsSAnZWagAAtsEP/1fTq3/etgk+YWks/U9O\nCrevJh8LTKbR5YJENrHPM/1ovXym/zgeKDII92M8K+UzEaGmwzzupvN9MU4O\n3mmPcV8I8fEXwazGplwSBFr0b2zzT5OrcvVRhHzwOA0hGfU0NTliqrytCvJM\ns7L/y/exmKK1mUbIj/LXiS4RCO/385BbKxJPVMpDGX15G3NUNS6CQ0DPEoKZ\ne/Lcepmgz0uH3qZCvK69n98S0WpvPAOGEssWqRRIDoSUZGt0X3o5PFs/FMVi\n6Rg8nNBI9puNib5eL21EMHdu6XA+Bb61EmwfF0dnhNKtv7pnL2z7/7KXpmYJ\nPBzwKA+ZwQ9ExErMfGxujvPqUYGzwToCmipzmw4/ZdJAqPVMbbplyH/TcE1n\n9bhNiT9sDGCmkr+u8xKgYN7mus7vRFfCYqnJj5eiw7WKB+uWfllTMYgbR2hq\num/xGYOKznQ3/tjaEZQj3fQYCNR2Ygd95N/E5xmig3gYxxxYSDoZWfnlmlkY\nbJRM2aNAZnx/FRS3R/SmYCEG740MA5ilSW+ozuPByDYtHpjcTu3mQuoX8nC6\nKTexQitG+H57Wdec1Awa1xiYmD5xoftvdJLw/i3kB5tM5YvU5/PhPgYiCdB1\nyjUcmvo+TVc1+nnYec5f4ub9Q1fmVQjb1/J1MXOh3tG0q1mZe7efvOQ9Ytvo\nZunl\r\n=ZI1H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDFAzsnEEnZLYU+N8NnNBVgUoo5g/aVsrN523MhUom/zAiAuALX7tFcL42oHvM72y72GuvgPV+RwCP26zPYYdZLTJQ=="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_10.4.1_1579625922239_0.7220562832141619"},"_hasShrinkwrap":false},"10.4.2":{"name":"wavefile","version":"10.4.2","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue","resampler"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-sr":"node ./node_modules/mocha/bin/_mocha test/resampler-full -R dot --timeout=1600000","test-sr-point":"node ./node_modules/mocha/bin/_mocha test/resampler-full/point.js -R dot --timeout=1600000","test-sr-linear":"node ./node_modules/mocha/bin/_mocha test/resampler-full/linear.js -R dot --timeout=1600000","test-sr-cubic":"node ./node_modules/mocha/bin/_mocha test/resampler-full/cubic.js -R dot --timeout=1600000","test-sr-sinc":"node ./node_modules/mocha/bin/_mocha test/resampler-full/sinc.js test/resampler-full/sinc-IIR.js test/resampler-full/sinc-no-lpf.js -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^9.0.0","byte-data":"^18.0.4","imaadpcm":"^5.0.0"},"gitHead":"4f3f4bde5bf45b8d55c9e25becb710ffacd19524","_id":"wavefile@10.4.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-NFH/u+X2GSoDaSdJBrAJeTOi9zVbB1r1tc2gIHuvodq6+OujWzNH1n1qX5srDu+70WqeUOu+yF9eYi14UzQELw==","shasum":"d853ea3d2edff795692b828a123ba78679ba3770","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-10.4.2.tgz","fileCount":29,"unpackedSize":259846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJ+DgCRA9TVsSAnZWagAAdcYP/i+ToB2RhNnqbcKjnJK1\naHY0LBF9QY/AE502FihIoOY7O6ruKdQpcbI14zoazbk5hb1WTt7Q79MLsWSu\nGKkC/xhSNzY99nMNf5JwQVMPdB6lyNZf1Fzb8adfPhoQhkg3YGSFAORL6Tdn\n55AabavE66RuocatB6p5sAisuzp/ug+mjwhorFctLRJ2WS2+HpDvGZMvKFGH\n+MNleEYmG8xFwR9sGYFtxZ6FPGH7RUkigZK20M8yci0Or/+Xi6wUwRps3Dhg\nJlay1GooA0O2k/xs2tp+2rjWnGW/R33MtTRsqGR2m8oHC6PgqhazBUQqOxMR\nob+1PHgjFw1WIAorwEK/jVqsrSxkkmVZn7G6tzsV97kO/qA13p2+wQc4LoAG\nnv++uvlFLmEhfAhgaNGrpx3S6Fqu8eJglQDxWEe1bjrdl1uBhQVl3ng0nS5T\nle0iNSDNB6ZVY/bOY4kXhWoPJ6l82MOxuO+HN7KSxLinEGGNzEs/TBlO9GIc\nVhw15sS87k6YDaAEdeoSnJosXR8Kq2+r3oWpTpkHDcu7ba2R89MevNv3K4sg\nTcZbKcAkfCnHbIm4wnUJG1VnmwV4qSkBisPutKbphz6WenT8cJ0Cu73OJ7Ej\nDNqPTTJ8ojRQGb0rriwyF4vSZvmPLnReQtMBWZOAVoL338uNsnxA8Aprejog\n3f7S\r\n=/I83\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgjI6Td5zPcvhVIzxIM0u6O56Ow52Cxi4uGhMtUYdEKgIhAPHwmgCOJo6A/2KY4UFJxk9/VplkCX//rPMItBHispFJ"}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_10.4.2_1579671775413_0.11250275065284154"},"_hasShrinkwrap":false},"10.4.3":{"name":"wavefile","version":"10.4.3","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue","resampler"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-sr":"node ./node_modules/mocha/bin/_mocha test/resampler-full -R dot --timeout=1600000","test-sr-point":"node ./node_modules/mocha/bin/_mocha test/resampler-full/point.js -R dot --timeout=1600000","test-sr-linear":"node ./node_modules/mocha/bin/_mocha test/resampler-full/linear.js -R dot --timeout=1600000","test-sr-cubic":"node ./node_modules/mocha/bin/_mocha test/resampler-full/cubic.js -R dot --timeout=1600000","test-sr-sinc":"node ./node_modules/mocha/bin/_mocha test/resampler-full/sinc.js test/resampler-full/sinc-IIR.js test/resampler-full/sinc-no-lpf.js -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{"alawmulaw":"^5.0.2","bitdepth":"^9.0.0","byte-data":"^18.1.1","imaadpcm":"^5.0.0"},"gitHead":"13b3509e7213c41bf066b33093874b4b457c8f3a","_id":"wavefile@10.4.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-swOuA9jcI6GLq5dKhCSR6BA/KxMhJxvDwXznXDPXXG9CMx/hH9y5waiQp3UAb56fV2H4/5PWsxSvVxQ8taxsfA==","shasum":"22c0b7f08ed4a5b3b0e119a47716e54e3d9d7034","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-10.4.3.tgz","fileCount":29,"unpackedSize":260895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLxm3CRA9TVsSAnZWagAAzQ4P/AhnQqGz7ZdgJ0TCaVN9\nzYiN6DGKPMEtLvuysSCvl6rZbLEFFVZZv4cTY7+gZaDlnQV9FFTkCr6p9CvB\nz3lgMoAwihIfO/I6hFWypbb6aF674bM+rQkwLCu2qiFUpB2r1f2xcTyhbvE0\nwARn1KVo2fD0oYLG+oRAun3kScfU3ZbailB3TyyLmGQuzhZSh0g3WxFA2Xd7\nauE5ocvR87xnJES5FH2XWMlTlgcxmoRYtVUbn0vs3fp/n/yEAKAuXX3wm8I+\njSO/LqaFjCVh28MUSdEYrtr8i8BgXOYUCEMbgLU+t//BlK5Xp0cfS3xXXnCB\nB1HBwaNRnfC7F1jraEzsOb3/vkQDYuKntgP4r9uUj7WMBhEfYFLqOH1tXc82\n+lBZ97mrD+3JE1WpOBOtPtbYBUWc7VeCli2jifEX04JAp8eZp5k9rzoDfONQ\n6o0zwkam0MFEs6zGkktRDITmghlgOkaR0UkoX8SmW071H654JgLuFDwOef91\noa09lRyNgdQWPEHmeOgtUAv60TJvXsHEK4fNIbJaaIBzKV2+1KugeO9e/GxB\n3DP+pR0c1j1OO/7cp9QTMYGtDbeg7azx2dWDoQ8ZjObcnnF/LKsOPFo3szUd\nlWPiXPdXGQGe1slYSwU9LUdp85hoqOTq9XAPySpOjaoO9UVYweI0XYNZmLHx\nBgPB\r\n=rJHE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAnxmc2Ls4YFNPl7B2J68j5aX4Q4W9QmuXmKTqRW7SoDAiEArSSzM1gpNs4RUX4bP+gVZ7o/WFKbKdD1WPxycIIDeKs="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_10.4.3_1580145078885_0.8916911035085149"},"_hasShrinkwrap":false},"11.0.0":{"name":"wavefile","version":"11.0.0","description":"Create, read and write wav files according to the specs.","homepage":"https://github.com/rochars/wavefile","author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","main":"./dist/wavefile.js","module":"./index.js","types":"./index.d.ts","bin":{"wavefile":"./bin/wavefile.js"},"engines":{"node":">=8"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue","resampler"],"repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"},"directories":{"bin":"bin","dist":"dist","externs":"externs","lib":"lib","scripts":"scripts"},"scripts":{"lint":"jshint index.js bin externs lib test/src","test":"nyc ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src test/wavefile-parser test/lib --recursive -R dot --timeout=1600000","test-sr":"node ./node_modules/mocha/bin/_mocha test/resampler-full -R dot --timeout=1600000","test-sr-point":"node ./node_modules/mocha/bin/_mocha test/resampler-full/point.js -R dot --timeout=1600000","test-sr-linear":"node ./node_modules/mocha/bin/_mocha test/resampler-full/linear.js -R dot --timeout=1600000","test-sr-cubic":"node ./node_modules/mocha/bin/_mocha test/resampler-full/cubic.js -R dot --timeout=1600000","test-sr-sinc":"node ./node_modules/mocha/bin/_mocha test/resampler-full/sinc.js test/resampler-full/sinc-IIR.js test/resampler-full/sinc-no-lpf.js -R dot --timeout=1600000","test-umd":"node ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src --umd --recursive -R dot --timeout=240000","test-tsc":"tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js","test-cli":"wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT && wavefile ./test/files/M1F1-int12WE-AFsp.wav --resample=16000 --method=point ./test/files/out/to-sample-rate/M1F1-int12WE-AFsp-CLI.wav","test-dist":"npm run test-umd && npm run test-tsc && npm run test-cli","rollup-bundle":"rollup -c && npm run test-dist","doc":"jsdoc -c .jsdocrc -d docs -r README.md -t node_modules/docdash","build":"npm run lint && npm test && npm run rollup-bundle && npm run doc","coverage":"nyc report --reporter=lcov > coverage.lcov && codecov"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"^0.13.0","@rollup/plugin-commonjs":"^11.0.0","@rollup/plugin-node-resolve":"^6.0.0","byte-data":"^19.0.1","codecov":"^3.6.1","docdash":"^1.1.1","esm":"^3.2.25","jsdoc":"^3.6.3","jshint":"^2.10.3","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^14.1.1","rollup":"^1.27.14","typescript":"^3.7.4"},"dependencies":{},"gitHead":"038bd4b289e1e5addc8947fe3a8e060c9017b809","_id":"wavefile@11.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"},"dist":{"integrity":"sha512-/OBiAALgWU24IG7sC84cDO/KfFuvajWc5Uec0oV2zrpOOZZDgGdOwHwgEzOrwh8jkubBk7PtZfQBIcI1OaE5Ng==","shasum":"9302165874327ff63a704d00b154c753eaa1b8e7","tarball":"https://registry.npmjs.org/wavefile/-/wavefile-11.0.0.tgz","fileCount":37,"unpackedSize":311007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMlj/CRA9TVsSAnZWagAAD/UP/0Yyob7b5smn8pCbYAW7\nj1wnK/m7IoRAhHowkFSRrpKGywybTv901eso42Mw4yQ4lSg/uQ0bYcbyH+ok\nPA8Qfc2V+zq0JkDmzlEIQMQ7gtrmsFlT84QJ7mo/o4YmMcvUH7Xxm6yV3FkE\nMGHzeMAA/VtjUWpnAyfWYovidcAXQdCPjkwukegHqezZgcgQAClF/ByV5Weg\nVapTQxBWxvsjeD+1tup7ecQVFy27P7Ut2WJ0y7TmnNsNy5ODYJ/6eMM9F9To\nMihjN0rh4++7dOpPVOTh0FBjANLI4je1ae7V42vPP0qrvngOurnVVgdr+WW+\nprzQsUzavJysHMDW96vSCPruo3wOAiret68sNPStMccC7cU5PpIi0WnJv0CV\nqb3wJEHzb+zeG4Pn+O0k9sAs4Ko0EOxEkDq1ttiqQloc2WnaIZGl2If2+Zf1\ngzMZIy8l/F/jIUHRqbLdxaPiPFlkshkaAz6PzraTFt3NC/20hM+i6ZWlpgZq\nynUdP/ki8aL5IYr+cIx74epR95XnofdjaWqCLdG+0pZ9G+l1AAsVbFsm+vRH\nrGnaPiNJCNRcZQB4Hc/oF47AKZKtt9lK4xqyXETAWbKMlm5bZfP/S9S+lbh9\nyswtVAjwdBENisY7PuvHn1d7dQdjsl2GjNNMgetN6F9hMPqy/99xSqaVw851\nPscl\r\n=NRNG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAC55uuN8Wot9joxVbtFntH7rJZo9NmbQasNEHkkVbwgIgb76VTaLG6zibyjuIYNBSBycbRp+iEdLMIBwg0yyXvwE="}]},"maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavefile_11.0.0_1580357886550_0.06404577036603154"},"_hasShrinkwrap":false}},"readme":"# wavefile\r\nCopyright (c) 2017-2019 Rafael da Silva Rocha.  \r\nhttps://github.com/rochars/wavefile\r\n\r\n[![NPM version](https://img.shields.io/npm/v/wavefile.svg?style=for-the-badge)](https://www.npmjs.com/package/wavefile) [![Docs](https://img.shields.io/badge/API-docs-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/docs) [![Tests](https://img.shields.io/badge/tests-online-blue.svg?style=for-the-badge)](https://rochars.github.io/wavefile/test/browser.html)  \r\n[![Codecov](https://img.shields.io/codecov/c/github/rochars/wavefile.svg?style=flat-square)](https://codecov.io/gh/rochars/wavefile) [![Unix Build](https://img.shields.io/travis/rochars/wavefile.svg?style=flat-square)](https://travis-ci.org/rochars/wavefile) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/wavefile.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/wavefile) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/wavefile.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/wavefile/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1880/badge)](https://bestpractices.coreinfrastructure.org/projects/1880)\r\n\r\n\r\n## Notice\r\nMy country, Brazil, is under a fascist government that is hunting and killing its opponents. I've been threatened too.\r\n\r\n\r\nCreate, read and write wav files according to the specs.\r\n\r\n- **MIT licensed**\r\n- **Use it in the browser (IE10+)**\r\n- **Use it in Node.js**\r\n- **Use it as a command line tool**\r\n- **Handle files up to 2GB**\r\n- **Zero dependencies**\r\n\r\nWith **wavefile** you can:\r\n\r\n- [Create wav files](#create-wave-files-from-scratch)\r\n- [Read wav files](#read-wave-files)\r\n- [Change the bit depth of the audio](#change-the-bit-depth)\r\n- [Change the sample rate of the audio](#change-the-sample-rate)\r\n- [Read and write RIFF tags](#add-riff-tags-to-files)\r\n- [Set and delete cue points and their labels](#add-cue-points-to-files)\r\n- [Create regions in wav files](#create-regions-in-files)\r\n- [Encode/decode files as ADPCM, A-Law and μ-Law](#ima-adpcm)\r\n- [Turn RIFF files to RIFX and RIFX to RIFF](#rifx)\r\n- [Create or edit BWF metadata (\"bext\" chunk)](#add-bwf-metadata)\r\n\r\nAnd more.\r\n\r\n## Install\r\n```\r\nnpm install wavefile\r\n```\r\n\r\nTo use it from the [command line](#command-line), install it globally:\r\n```\r\nnpm install wavefile -g\r\n```\r\n\r\n## Use\r\n\r\n### Node\r\n```javascript\r\nconst wavefile = require('wavefile');\r\nlet wav = new wavefile.WaveFile();\r\n```\r\nor \r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\nlet wav = new WaveFile();\r\n```\r\nor\r\n```javascript\r\nimport { WaveFile } from 'wavefile';\r\nlet wav = new WaveFile();\r\n```\r\n\r\n### Browser\r\nUse the **wavefile.js** file in the *dist* folder:\r\n```html\r\n<script src=\"wavefile.js\"></script>\r\n<script>\r\n  var wav = new wavefile.WaveFile();\r\n</script>\r\n```\r\n\r\nOr load it from the [jsDelivr](https://cdn.jsdelivr.net/npm/wavefile) CDN:\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/wavefile\"></script>\r\n```\r\n\r\nOr load it from [unpkg](https://unpkg.com/wavefile):\r\n```html\r\n<script src=\"https://unpkg.com/wavefile\"></script>\r\n```\r\n\r\n#### Browser compatibility\r\nIE10+. Should work in all modern browsers.\r\n\r\nCross-browser tests powered by  \r\n<a href=\"https://www.browserstack.com\"><img src=\"https://rochars.github.io/wavefile/docs/Browserstack-logo@2x.png\" width=\"150px\"/></a>\r\n\r\n\r\n### Command line use\r\nTo see the available options:\r\n```\r\nwavefile --help\r\n```\r\n\r\n## Node.js Example\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\n\r\n// Load a wav file buffer as a WaveFile object\r\nlet wav = new WaveFile(buffer);\r\n\r\n// Check some of the file properties\r\nconsole.log(wav.container);\r\nconsole.log(wav.chunkSize);\r\nconsole.log(wav.fmt.chunkId);\r\n\r\n// Call toBuffer() to get the bytes of the file.\r\n// You can write the output straight to disk:\r\nlet wavBuffer = wav.toBuffer();\r\n\r\n// Call toDataURI() to get the file as a DataURI:\r\nlet wavDataURI = wav.toDataURI();\r\n```\r\n\r\n## Table of Contents\r\n- [Install](#install)\r\n- [Use](#use)\r\n- [Operation Manual](#operation-manual)\r\n  * [Create wave files from scratch](#create-wave-files-from-scratch)\r\n  * [Read wave files](#read-wave-files)\r\n  * [Add RIFF tags to files](#add-riff-tags-to-files)\r\n  * [Add cue points to files](#add-cue-points-to-files)\r\n  * [Create regions in files](#create-regions-in-files)\r\n  * [RIFX](#rifx)\r\n  * [IMA-ADPCM](#ima-adpcm)\r\n  * [A-Law](#a-law)\r\n  * [mu-Law](#mu-law)\r\n  * [Change the bit depth](#change-the-bit-depth)\r\n  * [Change the sample rate](#change-the-sample-rate)\r\n  * [Add BWF metadata](#add-bwf-metadata)\r\n  * [RF64](#rf64)\r\n  * [XML Chunks](#xml-chunks)\r\n  * [The samples](#the-samples)\r\n  * [Command line](#command-line)\r\n- [API](#api)\r\n  * [The WaveFile methods:](#the-wavefile-methods-)\r\n  * [The WaveFile properties](#the-wavefile-properties)\r\n    + [Cue points](#cue-points)\r\n    + [Sample loops](#sample-loops)\r\n    + [LIST chunk](#list-chunk)\r\n- [Contributing to wavefile](#contributing-to-wavefile)\r\n- [References](#references)\r\n- [Legal](#legal)\r\n\r\n## Operation Manual\r\n\r\n### Create wave files from scratch\r\nUse the ```fromScratch(numChannels, sampleRate, bitDepth, samples)``` method.\r\n\r\n#### Mono:\r\n```javascript\r\nlet wav = new WaveFile();\r\n\r\n// Create a mono wave file, 44.1 kHz, 32-bit and 4 samples\r\nwav.fromScratch(1, 44100, '32', [0, -2147483, 2147483, 4]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\n\r\n#### Stereo:\r\nSamples can be informed interleaved or de-interleaved. If they are de-interleaved, WaveFile will interleave them. In this example they are de-interleaved.\r\n```javascript\r\n// Stereo, 48 kHz, 8-bit, de-interleaved samples\r\n// WaveFile interleave the samples automatically\r\nwav.fromScratch(2, 48000, '8', [\r\n    [0, 2, 4, 3],\r\n    [0, 1, 4, 3]\r\n]);\r\nfs.writeFileSync(path, wav.toBuffer());\r\n```\r\nPossible values for the bit depth are:  \r\n\"4\" - 4-bit IMA-ADPCM  \r\n\"8\" - 8-bit  \r\n\"8a\" - 8-bit A-Law  \r\n\"8m\" - 8-bit mu-Law  \r\n\"16\" - 16-bit  \r\n\"24\" - 24-bit  \r\n\"32\" - 32-bit  \r\n\"32f\" - 32-bit floating point  \r\n\"64\" - 64-bit floating point\r\n\r\nYou can also use any bit depth between \"8\" and \"53\", like **\"11\", \"12\", \"17\", \"20\" and so on**.\r\n\r\n#### A word on bit depth\r\nResolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.\r\n\r\n### Read wave files\r\n```javascript\r\nconst WaveFile = require('wavefile').WaveFile;\r\nwav = new WaveFile();\r\n// Read a wav file from a buffer\r\nwav.fromBuffer(buffer);\r\n// Read a wav file from a base64 string\r\nwav.fromBase64(base64);\r\n// Read a wav file from a data URI\r\nwav.fromDataURI(dataURI);\r\n```\r\n\r\n### Add RIFF tags to files\r\nYou can create (or overwrite) tags on files with the **WaveFile.setTag()** method.\r\n```javascript\r\n// Write the ICMT tag with some comments to the file\r\nwav.setTag(\"ICMT\", \"some comments\");\r\n```\r\n\r\nTo get the value of a tag (if it exists), use **WaveFile.getTag()**:\r\n```javascript\r\nconsole.log(wav.getTag(\"ICMT\"));\r\n// some comments\r\n```\r\n\r\nYou can delete a tag with **WaveFile.deleteTag()**:\r\n```javascript\r\nwav.deleteTag(\"ICMT\");\r\n```\r\n\r\n### Add cue points to files\r\nYou can create cue points using the **WaveFile.setCuePoint()** method. The method takes a object with the cue point data and creates a cue point in the corresponding position of the file. The only required attribute of the object is *position*, a number representing the position of the point in milliseconds:\r\n```javascript\r\n// to create a cue point\r\nwav.setCuePoint({position: 1500});\r\n```\r\n\r\nYou can also create cue points with labels by defining a *label* attribute:\r\n```javascript\r\n// to create a cue point with a label\r\nwav.setCuePoint({position: 1500, label: 'some label'});\r\n```\r\n\r\nTo delete a cue point use **WaveFile.deleteCuePoint()** informing the index of the point. Points are ordered according to their position. **The first point is indexed as 1.**\r\n```javascript\r\nwav.deleteCuePoint(1);\r\n```\r\n\r\nMind that creating or deleting cue points will change the index of other points if they exist.\r\n\r\nTo list all the cue points in a file, in the order they appear:\r\n```javascript\r\nlet cuePoints = wav.listCuePoints();\r\n```\r\nThis method will return a list with cue points ordered as they appear in the file.\r\n```javascript\r\n[\r\n  {\r\n    position: 500, // the position in milliseconds\r\n    label: 'cue marker 1',\r\n    end: 1500, // the end position in milliseconds\r\n    dwName: 1,\r\n    dwPosition: 0,\r\n    fccChunk: 'data',\r\n    dwChunkStart: 0,\r\n    dwBlockStart: 0,\r\n    dwSampleOffset: 22050, // the position as a sample offset\r\n    dwSampleLength: 3646827, // the region length as a sample count\r\n    dwPurposeID: 544106354,\r\n    dwCountry: 0,\r\n    dwLanguage: 0,\r\n    dwDialect: 0,\r\n    dwCodePage: 0,\r\n  },\r\n  //...\r\n];\r\n```\r\n\r\n### Create regions in files\r\nYou can create regions using the **WaveFile.setCuePoint()** method. Regions are cue points with extra data.\r\n\r\nIf you define a not null *end* attribute in the object describing the cue point, the point will be created as a region. The *end* attribute should be the end of the region, in milliseconds, counting from the start of the file, and always greater than the *position* of the point:\r\n```javascript\r\n// to create a region with a label:\r\nwav.setCuePoint({position: 1500, end: 2500, label: 'some label'});\r\n```\r\nYou can also define the following optional properties when creating a region:\r\n- dwPurposeID\r\n- dwCountry\r\n- dwLanguage\r\n- dwDialect\r\n- dwCodePage\r\n\r\n### RIFX\r\n**wavefile** can handle existing RIFX files and create RIFX files from scratch. Files created from scratch will default to RIFF; to create a file as RIFX you must define the container:\r\n```javascript\r\nwav.fromScratch(1, 48000, '16', [0, 1, -3278, 327], {\"container\": \"RIFX\"});\r\n```\r\n\r\nRIFX to RIFF and RIFF to RIFX:\r\n```javascript\r\n// Turn a RIFF file to a RIFX file\r\nwav.toRIFX();\r\n\r\n// Turn a RIFX file to a RIFF file\r\nwav.toRIFF();\r\n```\r\n\r\n### IMA-ADPCM\r\n16-bit 8000 Hz mono wave files can be compressed as IMA-ADPCM:\r\n```javascript\r\n// Encode a 16-bit wave file as 4-bit IMA-ADPCM:\r\nwav.toIMAADPCM();\r\n```\r\nIMA-ADPCM files compressed with **wavefile** will have a block align of 256 bytes.\r\n\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing. Compressing audio with sample rate different from 8000 Hz or more than one channel is not supported and will throw errors.\r\n\r\nTo decode 4-bit IMA-ADPCM as 16-bit linear PCM:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 16-bit:\r\nwav.fromIMAADPCM();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 4-bit IMA-ADPCM as 24-bit:\r\nwav.fromIMAADPCM(\"24\");\r\n```\r\n\r\n### A-Law\r\n16-bit wave files (mono or stereo) can be encoded as A-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit A-law:\r\nwav.toALaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit A-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit A-Law as 16-bit:\r\nwav.fromALaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit A-Law as 24-bit:\r\nwav.fromALaw(\"24\");\r\n```\r\n\r\n### mu-Law\r\n16-bit wave files (mono or stereo) can be encoded as mu-Law:\r\n```javascript\r\n// Encode a 16-bit wave file as 8-bit mu-law:\r\nwav.toMuLaw();\r\n```\r\nIf the audio is not 16-bit it will be converted to 16-bit before compressing.\r\n\r\nTo decode 8-bit mu-Law as 16-bit linear PCM:\r\n```javascript\r\n// Decode 8-bit mu-Law as 16-bit:\r\nwav.fromMuLaw();\r\n```\r\n\r\nDecoding always result in 16-bit audio. To decode to another bit depth:\r\n```javascript\r\n// Decode 8-bit mu-Law as 24-bit:\r\nwav.fromMuLaw(\"24\");\r\n```\r\n\r\n### Change the bit depth\r\nYou can change the bit depth of the audio with the **toBitDepth(bitDepth)** method. WaveFile only change the bit depth of the samples; no dithering is done.\r\n```javascript\r\n// Load a wav file with 32-bit audio\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Change the bit depth to 24-bit\r\nwav.toBitDepth(\"24\");\r\n\r\n// Write the new 24-bit file\r\nfs.writeFileSync(\"24bit-file.wav\", wav.toBuffer());\r\n```\r\n\r\n### Change the sample rate\r\nYou can change the sample rate of the audio with the **toSampleRate()** method. By default, **cubic interpolation** is used to resample the data. You can choose between **cubic**, **sinc**, **point** and **linear**.\r\n```javascript\r\n// Load a wav file with 16kHz audio\r\nlet wav = new WaveFile(fs.readFileSync(\"16kHz-file.wav\"));\r\n\r\n// Change the sample rate to 44.1kHz\r\n// using the default configuration\r\nwav.toSampleRate(44100);\r\n// this is the same as:\r\n// wav.toSampleRate(44100, {method: \"cubic\"});\r\n\r\n// Write the new 44.1kHz file\r\nfs.writeFileSync(\"44100Hz-file.wav\", wav.toBuffer());\r\n```\r\n\r\nTo use another method:\r\n```javascript\r\n// Change the sample rate to 44.1kHz using sinc\r\nwav.toSampleRate(44100, {method: \"sinc\"});\r\n```\r\n\r\n#### Resampling methods\r\n- **point**: Nearest point interpolation, lowest quality, no LPF by default, fastest\r\n- **linear**: Linear interpolation, low quality, no LPF by default, fast\r\n- **cubic**: Cubic interpolation, use LPF by default **(default method)**\r\n- **sinc**: Windowed sinc interpolation, use LPF by default, slowest\r\n\r\nYou can turn the LPF on and off for any resampling method:\r\n```javascript\r\n// Will use 'sinc' method with no LPF\r\nwav.toSampleRate(44100, {method: \"sinc\", LPF: false});\r\n\r\n// Will use 'linear' method with LPF\r\nwav.toSampleRate(44100, {method: \"linear\", LPF: true});\r\n```\r\n\r\nThe default LPF is a IIR LPF. You may define what type of LPF will be used by changing the LPFType attribute on the *toSampleRate()* param. You can use **IIR** or **FIR**:\r\n```javascript\r\n// Will use 'linear' method with a FIR LPF\r\nwav.toSampleRate(44100, {method: \"linear\", LPF: true, LPFType: 'FIR'});\r\n\r\n// Will use 'linear' method with a IIR LPF, the default\r\nwav.toSampleRate(44100, {method: \"linear\", LPF: true});\r\n```\r\n\r\n#### Changing the sample rate of ADPCM, mu-Law or A-Law\r\nYou need to convert compressed files to standard PCM before resampling:\r\n\r\nTo resample a mu-Law file:\r\n```javascript\r\n// convert the file to PCM\r\nwav.fromMuLaw();\r\n// resample\r\nwav.toSampleRate(44100, {method: \"sinc\"});\r\n// back to mu-Law\r\nwav.toMuLaw();\r\n```\r\n\r\n### Add BWF metadata\r\nTo add BWF data to a file you can use the **bext** property:\r\n```javascript\r\n// Load a wav file with no \"bext\"\r\nlet wav = new WaveFile(fs.readFileSync(\"32bit-file.wav\"));\r\n\r\n// Add some BWF metadata\r\nwav.bext.originator = \"wavefile\";\r\n\r\n// Write the new BWF file\r\nfs.writeFileSync(\"32bit-file-with-bext.wav\", wav.toBuffer());\r\n```\r\n\r\nBy default **wavefile** will not insert a \"bext\" chunk in new files or in files that do not already have a \"bext\" chunk unless a property of **WaveFile.bext** is changed from it's default value. See below the full list of properties in **WaveFile.bext**.\r\n\r\n### RF64\r\n**wavefile** have limited support of RF64 files. It possible to read (at least some) RF64 files, but changing the bit depth or applying compression to the samples will result in a RIFF file.\r\n\r\n### XML Chunks\r\n**wavefile** support reading and writing **iXML** and **\\_PMX** chunks.\r\n\r\nTo get the value of iXML or \\_PMX chunks:\r\n```javascript\r\n/** @type {string} */\r\nlet iXMLValue = wav.getiXML();\r\n/** @type {string} */\r\nlet _PMXValue = wav.get_PMX();\r\n```\r\n\r\nTo set the value of iXML or \\_PMX chunks:\r\n```javascript\r\nwav.setiXML(iXMLValue);\r\nwav.set_PMX(_PMXValue);\r\n```\r\n\r\nThe value for XML chunks must always be a string.\r\n\r\nthe *chunkSize* of the XML chunks will be adjusted when *toBuffer()* is called.\r\n\r\n### The samples\r\nSamples are stored in *data.samples* as a Uint8Array.\r\n\r\nTo get the samples as a Float64Array you should use the *getSamples()* method:\r\n```javascript\r\nlet samples = wav.getSamples();\r\n```\r\nIf the file is stereo or have more than one channel then the samples will be returned de-interleaved in a *Array* of *Float64Array* objects, one Float64Array for each channel. The method takes a optional boolean param *interleaved*, set to **false** by default. If set to **true**, samples will be returned interleaved. **Default is de-interleaved**.\r\n```javascript\r\n// Both will return de-interleaved samples\r\nsamples = wav.getSamples();\r\nsamples = wav.getSamples(false);\r\n\r\n// To get interleaved samples\r\nsamples = wav.getSamples(true);\r\n```\r\n\r\nYou can use any typed array as the output of *getSamples()*:\r\n```javascript\r\n// Will return the samples de-interleaved,\r\n// packed in a array of Int32Array objects, one for each channel\r\nsamples = wav.getSamples(false, Int32Array);\r\n// will return the samples de-interleaved,\r\n// packed in a array of Int16Array objects, one for each channel\r\nlet samples = getSamples(false, Int16Array);\r\n// will return the samples interleaved, packed in a Int16Array\r\nlet samples = getSamples(true, Int16Array);\r\n```\r\n\r\nTo get and set samples in a WaveFile instance you should use WaveFile.getSample(index) and WaveFile.setSample(index, sample). The 'index' is the index of the sample in the sample array, not the index of the bytes in data.samples.\r\n\r\nExample:\r\n```javascript\r\nwav = new WaveFile();\r\n\r\n// some samples\r\nlet samples = [561, 1200, 423];\r\n\r\n// Create a WaveFile using the samples\r\nwav.fromScratch(1, 8000, \"16\", samples);\r\n\r\n// Getting and setting a sample in the WaveFile instance:\r\nwav.getSample(1); // return 1200, the value of the second sample\r\nwav.setSample(1, 10); // change the second sample to 10\r\nwav.getSample(1); // return 10, the new value of the second sample\r\n```\r\n\r\n### Range:\r\n- 0 to 255 for 8-bit\r\n- -32768 to 32767 for 16-bit\r\n- -8388608 to 8388607 for 24-bit\r\n- -2147483648 to 2147483647 for 32-bit\r\n- -1.0 to 1.0 for 32-bit (float)\r\n- -1.0 to 1.0 for 64-bit (float)\r\n\r\nFloating point samples may be defined out of range. Integer samples will be clamped on overflow.\r\n\r\n### Command line\r\nTo use **wavefile** from the command line, install it globally:\r\n```\r\n$ npm install wavefile -g\r\n```\r\n\r\nTo see the available options:\r\n```\r\n$ wavefile --help\r\n```\r\n\r\nThe available options:\r\n```\r\n  --resample   Ex: wavefile input.wav --resample=44100 output.wav\r\n               Change the sample rate. The input file is not affected.\r\n               Use with --method to change the interpolation method:\r\n               Ex: wavefile in.wav --resample=8000 --method=sinc out.wav\r\n               If --method is ommited, cubic interpolation will be used.\r\n\r\n  --bitdepth   Ex: wavefile input.wav --bitdepth=32f output.wav\r\n               Change the bit depth.\r\n               The input file is not affected.\r\n               Possible values: 8, 16, 24, 32, 32f, 64\r\n\r\n  --compress   Ex: wavefile input.wav --compress=adpcm output.wav\r\n               Apply compression to the file.\r\n               The input file is not affected.\r\n               Possible values: adpcm, alaw, mulaw\r\n\r\n  --tag        Ex: wavefile input.wav --tag=ICRD\r\n               Print the value of tag if the tag exists.\r\n\r\n  --list-tags  Ex: wavefile input.wav --list-tags\r\n               Print all tags of the file.\r\n\r\n  --list-cue   Ex: wavefile input.wav --list-cue\r\n               Print all the cue points of the file.\r\n\r\n  --bits       Ex: wavefile input.wav --bits\r\n               Print the bit depth of the file.\r\n\r\n  --rate       Ex: wavefile input.wav --rate\r\n               Print the sample rate of the file.\r\n\r\n  --help       Ex: --help\r\n               Show this help page.\r\n```\r\n\r\nThe **--resample** command performs resampling using *cubic interpolation* by default. Use it with the **--method** option to change the interpolation method:\r\n```\r\n$ wavefile input.wav --resample=44100 method=sinc output.wav\r\n```\r\nYou can use *point*,*linear*,*cubic* and *sinc*.\r\n\r\n## API\r\nTo create a WaveFile object:\r\n```javascript\r\n// Create a empty WaveFile object\r\nWaveFile();\r\n\r\n// Create a WaveFile object with the contents of a wav file buffer\r\nWaveFile(wav);\r\n\r\n/**\r\n * @param {Uint8Array=} wav A wave file buffer.\r\n * @throws {Error} If no \"RIFF\" chunk is found.\r\n * @throws {Error} If no \"fmt \" chunk is found.\r\n * @throws {Error} If no \"data\" chunk is found.\r\n */\r\nWaveFile(wav);\r\n```\r\n\r\n### The WaveFile methods\r\n```javascript\r\n/**\r\n * Set up the WaveFileCreator object based on the arguments passed.\r\n * Existing chunks are reset.\r\n * @param {number} numChannels The number of channels.\r\n * @param {number} sampleRate The sample rate.\r\n *    Integers like 8000, 44100, 48000, 96000, 192000.\r\n * @param {string} bitDepthCode The audio bit depth code.\r\n *    One of '4', '8', '8a', '8m', '16', '24', '32', '32f', '64'\r\n *    or any value between '8' and '32' (like '12').\r\n * @param {!(Array|TypedArray)} samples The samples.\r\n * @param {Object=} options Optional. Used to force the container\r\n *    as RIFX with {'container': 'RIFX'}\r\n * @throws {Error} If any argument does not meet the criteria.\r\n */\r\nWaveFile.fromScratch(numChannels, sampleRate, bitDepth, samples, options) {}\r\n\r\n/**\r\n * Set up the WaveFileParser object from a byte buffer.\r\n * @param {!Uint8Array} wavBuffer The buffer.\r\n * @param {boolean=} [samples=true] True if the samples should be loaded.\r\n * @throws {Error} If container is not RIFF, RIFX or RF64.\r\n * @throws {Error} If format is not WAVE.\r\n * @throws {Error} If no 'fmt ' chunk is found.\r\n * @throws {Error} If no 'data' chunk is found.\r\n */\r\nWaveFile.fromBuffer(bytes, samples=true) {}\r\n\r\n/**\r\n * Return a byte buffer representig the WaveFile object as a .wav file.\r\n * The return value of this method can be written straight to disk.\r\n * @return {!Uint8Array} A .wav file.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBuffer() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a base64 string to load the WaveFile object.\r\n * @param {string} base64String A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromBase64(base64String) {}\r\n\r\n/**\r\n * Return a base64 string representig the WaveFile object as a .wav file.\r\n * @return {string} A .wav file as a base64 string.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toBase64() {}\r\n\r\n/**\r\n * Return a DataURI string representig the WaveFile object as a .wav file.\r\n * The return of this method can be used to load the audio in browsers.\r\n * @return {string} A .wav file as a DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.toDataURI() {}\r\n\r\n/**\r\n * Use a .wav file encoded as a DataURI to load the WaveFile object.\r\n * @param {string} dataURI A .wav file as DataURI.\r\n * @throws {Error} If any property of the object appears invalid.\r\n */\r\nWaveFile.fromDataURI(dataURI) {}\r\n\r\n/**\r\n * Force a file as RIFF.\r\n */\r\nWaveFile.toRIFF() {}\r\n\r\n/**\r\n * Force a file as RIFX.\r\n */\r\nWaveFile.toRIFX() {}\r\n\r\n/**\r\n * Change the bit depth of the samples.\r\n * @param {string} newBitDepth The new bit depth of the samples.\r\n *    One of '8' ... '32' (integers), '32f' or '64' (floats)\r\n * @param {boolean=} [changeResolution=true] A boolean indicating if the\r\n *    resolution of samples should be actually changed or not.\r\n * @throws {Error} If the bit depth is not valid.\r\n */\r\nWaveFile.toBitDepth(bitDepth, changeResolution=true) {}\r\n\r\n/**\r\n * Convert the sample rate of the file.\r\n * @param {number} sampleRate The target sample rate.\r\n * @param {Object=} options The extra configuration, if needed.\r\n */\r\nWaveFile.toSampleRate(sampleRate, options=null) {};\r\n\r\n/**\r\n * Encode a 16-bit wave file as 4-bit IMA ADPCM.\r\n * @throws {Error} If sample rate is not 8000.\r\n * @throws {Error} If number of channels is not 1.\r\n */\r\nWaveFile.toIMAADPCM() {}\r\n\r\n/**\r\n * Decode a 4-bit IMA ADPCM wave file as a 16-bit wave file.\r\n * @param {string=} [bitDepthCode='16'] The new bit depth of the samples.\r\n *    One of '8' ... '32' (integers), '32f' or '64' (floats).\r\n */\r\nWaveFile.fromIMAADPCM(bitDepth='16') {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit A-Law.\r\n */\r\nWaveFile.toALaw() {}\r\n\r\n/**\r\n * Decode a 8-bit A-Law wave file into a 16-bit wave file.\r\n * @param {string=} [bitDepthCode='16'] The new bit depth of the samples.\r\n *    One of '8' ... '32' (integers), '32f' or '64' (floats).\r\n */\r\nWaveFile.fromALaw(bitDepth='16') {}\r\n\r\n/**\r\n * Encode 16-bit wave file as 8-bit mu-Law.\r\n */\r\nWaveFile.toMuLaw() {}\r\n\r\n/**\r\n * Decode a 8-bit mu-Law wave file into a 16-bit wave file.\r\n * @param {string=} [bitDepthCode='16'] The new bit depth of the samples.\r\n *    One of '8' ... '32' (integers), '32f' or '64' (floats).\r\n */\r\nWaveFile.fromMuLaw(bitDepth='16') {}\r\n\r\n/**\r\n * Write a RIFF tag in the INFO chunk. If the tag do not exist,\r\n * then it is created. It if exists, it is overwritten.\r\n * @param {string} tag The tag name.\r\n * @param {string} value The tag value.\r\n * @throws {Error} If the tag name is not valid.\r\n */\r\nWaveFile.setTag(tag, value) {}\r\n\r\n/**\r\n * Return the value of a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {?string} The value if the tag is found, null otherwise.\r\n */\r\nWaveFile.getTag(tag) {}\r\n\r\n/**\r\n * Remove a RIFF tag in the INFO chunk.\r\n * @param {string} tag The tag name.\r\n * @return {boolean} True if a tag was deleted.\r\n */\r\nWaveFile.deleteTag(tag) {}\r\n\r\n/**\r\n * Return a Object<tag, value> with the RIFF tags in the file.\r\n * @return {!Object<string, string>} The file tags.\r\n */\r\nWaveFile.listTags() {}\r\n\r\n/**\r\n * Create a cue point in the wave file.\r\n * @param {!Object} pointData A object with the data of the cue point.\r\n *\r\n * # Only required attribute to create a cue point:\r\n * pointData.position: The position of the point in milliseconds\r\n *\r\n * # Optional attribute for cue points:\r\n * pointData.label: A string label for the cue point\r\n *\r\n * # Extra data used for regions\r\n * pointData.end: A number representing the end of the region,\r\n *   in milliseconds, counting from the start of the file. If\r\n *   no end attr is specified then no region is created.\r\n *\r\n * # You may also specify the following attrs for regions, all optional:\r\n * pointData.dwPurposeID\r\n * pointData.dwCountry\r\n * pointData.dwLanguage\r\n * pointData.dwDialect\r\n * pointData.dwCodePage\r\n * \r\n * # This is what a complete pointData object look like:\r\n * {\r\n *   position: number,\r\n *   label: ?string,\r\n *   end: ?number,\r\n *   dwPurposeID: ?number,\r\n *   dwCountry: ?number,\r\n *   dwLanguage: ?number,\r\n *   dwDialect: ?number,\r\n *   dwCodePage: ?number\r\n * }\r\n */\r\nWaveFile.setCuePoint(pointData) {}\r\n\r\n/**\r\n * Remove a cue point from a wave file.\r\n * @param {number} index the index of the point. First is 1,\r\n *      second is 2, and so on.\r\n */\r\nWaveFile.deleteCuePoint(index) {}\r\n\r\n/**\r\n * Return an array with all cue points in the file, in the order they appear\r\n * in the file.\r\n * Objects representing cue points/regions look like this:\r\n *   {\r\n *     position: 500, // the position in milliseconds\r\n *     label: 'cue marker 1',\r\n *     end: 1500, // the end position in milliseconds\r\n *     dwName: 1,\r\n *     dwPosition: 0,\r\n *     fccChunk: 'data',\r\n *     dwChunkStart: 0,\r\n *     dwBlockStart: 0,\r\n *     dwSampleOffset: 22050, // the position as a sample offset\r\n *     dwSampleLength: 3646827, // the region length as a sample count\r\n *     dwPurposeID: 544106354,\r\n *     dwCountry: 0,\r\n *     dwLanguage: 0,\r\n *     dwDialect: 0,\r\n *     dwCodePage: 0,\r\n *   }\r\n * @return {!Array<Object>}\r\n */\r\nWaveFile.listCuePoints() {}\r\n\r\n/**\r\n * Update the label of a cue point.\r\n * @param {number} pointIndex The ID of the cue point.\r\n * @param {string} label The new text for the label.\r\n */\r\nWaveFile.updateLabel(pointIndex, label) {}\r\n\r\n/**\r\n * Return the samples packed in a Float64Array.\r\n * @param {boolean=} [interleaved=false] True to return interleaved samples,\r\n *   false to return the samples de-interleaved.\r\n * @param {Function=} [OutputObject=Float64Array] The sample container.\r\n * @return {!(Array|TypedArray)} the samples.\r\n */\r\nWaveFile.getSamples(interleaved=false, OutputObject=Float64Array) {};\r\n\r\n/**\r\n * Return the sample at a given index.\r\n * @param {number} index The sample index.\r\n * @return {number} The sample.\r\n * @throws {Error} If the sample index is off range.\r\n */\r\nWaveFile.getSample(index) {};\r\n\r\n/**\r\n * Set the sample at a given index.\r\n * @param {number} index The sample index.\r\n * @param {number} sample The sample.\r\n * @throws {Error} If the sample index is off range.\r\n */\r\nWaveFile.setSample(index, sample) {};\r\n\r\n\r\n/**\r\n * Return the value of the iXML chunk.\r\n * @return {string} The contents of the iXML chunk.\r\n */\r\nWaveFile.getiXML() {};\r\n\r\n/**\r\n * Set the value of the iXML chunk.\r\n * @param {string} iXMLValue The value for the iXML chunk.\r\n * @throws {TypeError} If the value is not a string.\r\n */\r\nWaveFile.setiXML(iXMLValue) {};\r\n\r\n/**\r\n * Get the value of the _PMX chunk.\r\n * @return {string} The contents of the _PMX chunk.\r\n */\r\nWaveFile.get_PMX() {};\r\n\r\n/**\r\n * Set the value of the _PMX chunk.\r\n * @param {string} _PMXValue The value for the _PMX chunk.\r\n * @throws {TypeError} If the value is not a string.\r\n */\r\nWaveFile.set_PMX(_PMXValue) {};\r\n\r\n```\r\n\r\n#### WaveFile.listCuePoints()\r\nThis method returns a list of objects, each object representing a cue point or region. The list looks like this:\r\n```javascript\r\n[\r\n  {\r\n    position: 500, // the position in milliseconds\r\n    label: 'cue marker 1',\r\n    end: 1500, // the end position in milliseconds\r\n    dwName: 1,\r\n    dwPosition: 0,\r\n    fccChunk: 'data',\r\n    dwChunkStart: 0,\r\n    dwBlockStart: 0,\r\n    dwSampleOffset: 22050, // the position as a sample offset\r\n    dwSampleLength: 3646827, // the region length as a sample count\r\n    dwPurposeID: 544106354,\r\n    dwCountry: 0,\r\n    dwLanguage: 0,\r\n    dwDialect: 0,\r\n    dwCodePage: 0\r\n  },\r\n  // ...\r\n]\r\n```\r\nThe list order reflects the order of the points in the file.\r\n\r\n### The WaveFile properties\r\n```javascript\r\n/**\r\n * The container identifier.\r\n * \"RIFF\", \"RIFX\" and \"RF64\" are supported.\r\n * @type {string}\r\n */\r\nWaveFile.container = '';\r\n/**\r\n * @type {number}\r\n */\r\nWaveFile.chunkSize = 0;\r\n/**\r\n * The format.\r\n * Always 'WAVE'.\r\n * @type {string}\r\n */\r\nWaveFile.format = '';\r\n/**\r\n * The data of the \"fmt\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fmt = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    audioFormat: 0,\r\n    /** @type {number} */\r\n    numChannels: 0,\r\n    /** @type {number} */\r\n    sampleRate: 0,\r\n    /** @type {number} */\r\n    byteRate: 0,\r\n    /** @type {number} */\r\n    blockAlign: 0,\r\n    /** @type {number} */\r\n    bitsPerSample: 0,\r\n    /** @type {number} */\r\n    cbSize: 0,\r\n    /** @type {number} */\r\n    validBitsPerSample: 0,\r\n    /** @type {number} */\r\n    dwChannelMask: 0,\r\n    /**\r\n     * 4 32-bit values representing a 128-bit ID\r\n     * @type {!Array<number>}\r\n     */\r\n    subformat: []\r\n};\r\n/**\r\n * The data of the \"fact\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.fact = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwSampleLength: 0\r\n};\r\n/**\r\n * The data of the \"cue \" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.cue = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwCuePoints: 0,\r\n    /** @type {!Array<!Object>} */\r\n    points: [],\r\n};\r\n/**\r\n * The data of the \"smpl\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.smpl = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    dwManufacturer: 0,\r\n    /** @type {number} */\r\n    dwProduct: 0,\r\n    /** @type {number} */\r\n    dwSamplePeriod: 0,\r\n    /** @type {number} */\r\n    dwMIDIUnityNote: 0,\r\n    /** @type {number} */\r\n    dwMIDIPitchFraction: 0,\r\n    /** @type {number} */\r\n    dwSMPTEFormat: 0,\r\n    /** @type {number} */\r\n    dwSMPTEOffset: 0,\r\n    /** @type {number} */\r\n    dwNumSampleLoops: 0,\r\n    /** @type {number} */\r\n    dwSamplerData: 0,\r\n    /** @type {!Array<!Object>} */\r\n    loops: [],\r\n};\r\n/**\r\n * The data of the \"bext\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.bext = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {string} */\r\n    description: '', //256\r\n    /** @type {string} */\r\n    originator: '', //32\r\n    /** @type {string} */\r\n    originatorReference: '', //32\r\n    /** @type {string} */\r\n    originationDate: '', //10\r\n    /** @type {string} */\r\n    originationTime: '', //8\r\n    /**\r\n     * 2 32-bit values, timeReference high and low\r\n     * @type {!Array<number>}\r\n     */\r\n    timeReference: [0, 0],\r\n    /** @type {number} */\r\n    version: 0, //WORD\r\n    /** @type {string} */\r\n    UMID: '', // 64 chars\r\n    /** @type {number} */\r\n    loudnessValue: 0, //WORD\r\n    /** @type {number} */\r\n    loudnessRange: 0, //WORD\r\n    /** @type {number} */\r\n    maxTruePeakLevel: 0, //WORD\r\n    /** @type {number} */\r\n    maxMomentaryLoudness: 0, //WORD\r\n    /** @type {number} */\r\n    maxShortTermLoudness: 0, //WORD\r\n    /** @type {string} */\r\n    reserved: '', //180\r\n    /** @type {string} */\r\n    codingHistory: '' // string, unlimited\r\n};\r\n/**\r\n * The data of the 'iXML' chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.iXML = {\r\n  /** @type {string} */\r\n  chunkId: '',\r\n  /** @type {number} */\r\n  chunkSize: 0,\r\n  /** @type {string} */\r\n  value: ''\r\n};\r\n/**\r\n * The data of the \"ds64\" chunk.\r\n * Used only with RF64 files.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.ds64 = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {number} */\r\n    riffSizeHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    riffSizeLow: 0, // DWORD\r\n    /** @type {number} */\r\n    dataSizeHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    dataSizeLow: 0, // DWORD\r\n    /** @type {number} */\r\n    originationTime: 0, // DWORD\r\n    /** @type {number} */\r\n    sampleCountHigh: 0, // DWORD\r\n    /** @type {number} */\r\n    sampleCountLow: 0, // DWORD\r\n    /** @type {number} */\r\n    //\"tableLength\": 0, // DWORD\r\n    /** @type {!Array<number>} */\r\n    //\"table\": []\r\n};\r\n/**\r\n * The data of the \"data\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.data = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {!Uint8Array} */\r\n    samples: new Uint8Array(0)\r\n};\r\n/**\r\n * The data of the \"LIST\" chunks.\r\n * Each item in this list look like this:\r\n *  {\r\n *      chunkId: '',\r\n *      chunkSize: 0,\r\n *      format: '',\r\n *      subChunks: []\r\n *   }\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n/**\r\n * The data of the \"junk\" chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile.junk = {\r\n    /** @type {string} */\r\n    chunkId: '',\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {!Array<number>} */\r\n    chunkData: []\r\n};\r\n/**\r\n * The data of the '_PMX' chunk.\r\n * @type {!Object<string, *>}\r\n */\r\nWaveFile._PMX = {\r\n  /** @type {string} */\r\n  chunkId: '',\r\n  /** @type {number} */\r\n  chunkSize: 0,\r\n  /** @type {string} */\r\n  value: ''\r\n};\r\n/**\r\n * The bit depth code according to the samples.\r\n * @type {string}\r\n */\r\nWaveFile.bitDepth =  '';\r\n```\r\n\r\n#### Cue points\r\nItems in *cue.points* are objects like this:\r\n```javascript\r\n{\r\n    /** @type {number} */\r\n    dwName: 0, // a cue point ID\r\n    /** @type {number} */\r\n    dwPosition: 0,\r\n    /** @type {number} */\r\n    fccChunk: 0,\r\n    /** @type {number} */\r\n    dwChunkStart: 0,\r\n    /** @type {number} */\r\n    dwBlockStart: 0,\r\n    /** @type {number} */\r\n    dwSampleOffset: 0\r\n}\r\n```\r\n\r\n#### Sample loops\r\nItems in *smpl.loops* are objects like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    dwName: '', // a cue point ID\r\n    /** @type {number} */\r\n    dwType: 0,\r\n    /** @type {number} */\r\n    dwStart: 0,\r\n    /** @type {number} */\r\n    dwEnd: 0,\r\n    /** @type {number} */\r\n    dwFraction: 0,\r\n    /** @type {number} */\r\n    dwPlayCount: 0\r\n}\r\n```\r\n\r\n#### LIST chunk\r\n\"LIST\" chunk data is stored as follows:\r\n```javascript\r\n/**\r\n * An array of the \"LIST\" chunks present in the file.\r\n * @type {!Array<!Object>}\r\n */\r\nWaveFile.LIST = [];\r\n```\r\n\r\nItems in *WaveFile.LIST* are objects like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    chunkId: '', // always 'LIST'\r\n    /** @type {number} */\r\n    chunkSize: 0,\r\n    /** @type {string} */\r\n    format: '', // 'adtl' or 'INFO'\r\n    /** @type {!Array<!Object>} */\r\n    subChunks: []\r\n};\r\n```\r\nWhere \"subChunks\" are the subChunks of the \"LIST\" chunk. A single file may have many \"LIST\" chunks as long as their formats (\"INFO\", \"adtl\", etc) are not the same. **wavefile** can read and write \"LIST\" chunks of format \"INFO\" and \"adtl\".\r\n\r\nFor \"LIST\" chunks with the \"INFO\" format, \"subChunks\" will be an array of objects like this:\r\n```javascript\r\n{\r\n    /** @type {string} */\r\n    chunkId: '', // some RIFF tag\r\n    /** @type {number} */\r\n    chunkSize 0,\r\n    /** @type {string} */\r\n    value: ''\r\n}\r\n```\r\nWhere \"chunkId\" may be any RIFF tag:  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n## Contributing to wavefile\r\n**wavefile** welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.\r\n\r\nSee [CONTRIBUTING.md](https://github.com/rochars/wavefile/blob/master/CONTRIBUTING.md) for details.\r\n\r\n### Style guide\r\n**wavefile** code should follow the Google JavaScript Style Guide:  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n### Code of conduct\r\nThis project is bound by a Code of Conduct: The [Contributor Covenant, version 1.4](https://github.com/rochars/wavefile/blob/master/CODE_OF_CONDUCT.md), also available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\r\n\r\n## References\r\n\r\n### Papers\r\nhttps://tech.ebu.ch/docs/tech/tech3285.pdf  \r\nhttps://tech.ebu.ch/docs/tech/tech3306-2009.pdf  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html  \r\nhttps://www.loc.gov/preservation/digital/formats/fdd/fdd000356.shtml  \r\nhttp://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf  \r\nhttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format  \r\nhttp://www.neurophys.wisc.edu/auditory/riff-format.txt  \r\nhttps://sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info\r\n\r\n### Software\r\nhttps://github.com/erikd/libsndfile  \r\nhttps://gist.github.com/hackNightly/3776503  \r\nhttps://github.com/chirlu/sox/blob/master/src/wav.c\r\n\r\n### Other\r\nhttps://developercertificate.org/  \r\nhttps://www.contributor-covenant.org/version/1/4/code-of-conduct.html  \r\nhttps://google.github.io/styleguide/jsguide.html\r\n\r\n## Legal\r\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)\r\n\r\n### LICENSE\r\nCopyright (c) 2017-2019 Rafael da Silva Rocha.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","maintainers":[{"name":"rochars","email":"rocha.rafaelsilva@gmail.com"}],"time":{"modified":"2022-05-24T02:28:34.923Z","created":"2017-11-01T04:49:10.553Z","0.0.1":"2017-11-01T04:49:10.553Z","0.0.2":"2017-11-01T06:38:57.972Z","0.0.3":"2017-11-01T09:54:10.398Z","0.0.5":"2017-11-14T02:19:35.229Z","0.0.6":"2017-11-17T13:08:38.420Z","0.0.7":"2017-11-17T19:44:11.365Z","0.0.8":"2017-11-21T21:16:52.013Z","0.1.0":"2017-11-24T03:07:59.543Z","0.2.0":"2017-11-24T03:29:07.047Z","0.3.0":"2017-11-24T08:03:20.064Z","0.4.0":"2017-11-26T05:14:10.585Z","0.4.1":"2017-11-26T15:58:10.665Z","0.4.2":"2017-11-26T18:36:21.550Z","0.4.3":"2017-11-26T20:12:10.418Z","0.4.4":"2017-11-27T00:48:52.552Z","0.4.5":"2017-11-27T09:31:04.901Z","0.4.6":"2017-11-28T02:28:11.237Z","0.4.7":"2017-11-28T17:07:40.477Z","0.4.8":"2017-11-28T21:46:04.702Z","0.5.0":"2017-11-28T22:20:25.671Z","0.6.0":"2017-11-29T03:24:01.719Z","1.0.0":"2017-12-01T02:58:44.458Z","1.0.1":"2017-12-01T03:27:47.078Z","1.0.2":"2017-12-03T05:10:20.329Z","1.0.3":"2017-12-03T09:55:17.240Z","1.0.4":"2017-12-04T17:29:58.221Z","2.0.0":"2018-03-23T12:52:16.302Z","2.1.0":"2018-04-16T23:57:31.262Z","2.1.1":"2018-04-20T11:55:44.157Z","2.2.0":"2018-04-20T18:23:53.141Z","2.3.0":"2018-04-20T20:39:37.709Z","2.3.1":"2018-04-20T20:42:22.702Z","2.3.2":"2018-04-20T20:43:35.952Z","2.3.3":"2018-04-20T20:51:11.038Z","2.3.4":"2018-04-21T22:49:24.717Z","2.3.5":"2018-04-21T23:07:35.927Z","2.3.6":"2018-04-22T18:30:05.778Z","3.0.0":"2018-04-25T02:29:44.971Z","3.0.1":"2018-04-25T04:20:38.271Z","3.0.2":"2018-04-25T06:33:19.983Z","4.0.0":"2018-04-27T08:46:34.556Z","5.0.0":"2018-04-30T17:22:22.038Z","5.0.1":"2018-04-30T21:46:34.913Z","5.0.2":"2018-04-30T22:24:16.934Z","5.0.3":"2018-04-30T23:46:23.681Z","6.0.0":"2018-05-02T05:08:37.648Z","6.1.0":"2018-05-02T07:42:59.154Z","6.1.1":"2018-05-04T02:33:10.938Z","6.2.0":"2018-05-04T06:37:51.240Z","6.2.1":"2018-05-06T01:11:13.788Z","6.3.0":"2018-05-06T20:31:27.569Z","6.4.0":"2018-05-07T03:53:34.720Z","6.4.1":"2018-05-07T16:53:18.123Z","6.5.0":"2018-05-10T06:38:47.773Z","6.5.1":"2018-05-10T09:23:42.193Z","6.6.0":"2018-05-10T23:48:38.906Z","6.6.1":"2018-05-10T23:57:46.749Z","6.7.0":"2018-05-11T07:59:28.065Z","6.8.0":"2018-05-12T23:27:01.502Z","6.9.0":"2018-05-13T01:09:43.027Z","6.10.0":"2018-05-13T14:47:31.020Z","6.10.1":"2018-05-14T03:33:39.240Z","6.10.2":"2018-05-18T11:22:03.658Z","6.10.3":"2018-05-25T05:02:46.468Z","6.10.4":"2018-06-01T18:54:08.417Z","6.11.0":"2018-06-10T02:25:07.239Z","6.12.0":"2018-06-11T00:50:06.099Z","6.12.1":"2018-06-11T05:21:22.914Z","6.12.2":"2018-06-11T10:27:47.639Z","6.12.3":"2018-06-11T10:32:11.001Z","6.12.4":"2018-06-11T10:38:35.800Z","6.12.5":"2018-06-11T20:13:53.786Z","6.12.6":"2018-06-12T00:03:45.655Z","6.12.7":"2018-06-12T19:36:18.789Z","6.13.0":"2018-06-13T16:20:12.728Z","7.0.0-alpha.0":"2018-06-15T00:58:24.596Z","7.0.0-alpha.1":"2018-06-18T03:58:43.254Z","7.0.0-alpha.2":"2018-06-18T10:39:55.145Z","7.0.0-alpha.3":"2018-06-18T12:45:44.800Z","7.0.0-alpha.4":"2018-06-18T12:48:43.501Z","7.0.0-alpha.5":"2018-06-18T12:50:18.269Z","7.0.0-alpha.6":"2018-06-18T14:55:18.370Z","7.0.0-alpha.7":"2018-06-19T05:42:44.378Z","7.0.0-alpha.8":"2018-06-20T22:39:10.154Z","7.0.0-alpha.9":"2018-06-20T23:21:14.296Z","7.0.0-alpha.10":"2018-06-22T09:10:20.636Z","7.0.0-alpha.11":"2018-06-22T19:53:18.174Z","7.0.0-alpha.12":"2018-06-24T00:03:24.764Z","7.0.0-alpha.13":"2018-06-24T01:18:22.522Z","7.0.0-alpha.14":"2018-06-24T06:01:51.515Z","7.0.0-alpha.15":"2018-06-24T06:16:15.494Z","7.0.0-alpha.16":"2018-06-24T09:22:11.025Z","7.0.0-alpha.18":"2018-06-25T08:07:22.899Z","7.0.0-alpha.20":"2018-06-27T05:41:19.798Z","7.0.0-alpha.21":"2018-06-27T08:15:57.102Z","7.0.0":"2018-06-27T16:39:17.065Z","7.0.1":"2018-06-28T00:36:03.910Z","8.0.0-alpha.0":"2018-06-29T00:46:57.406Z","8.0.0-alpha.1":"2018-06-29T03:35:48.061Z","8.0.0":"2018-06-29T04:57:57.615Z","8.0.1-alpha.0":"2018-06-29T06:19:18.701Z","8.0.1":"2018-06-29T06:43:28.676Z","8.0.2":"2018-06-29T15:33:07.743Z","8.0.3-alpha.0":"2018-07-03T03:24:16.040Z","8.0.3":"2018-07-03T04:25:58.553Z","8.1.0-alpha.0":"2018-07-04T04:56:04.405Z","8.1.0-alpha.1":"2018-07-04T05:18:12.114Z","8.1.0-alpha.2":"2018-07-04T05:23:39.929Z","8.1.0-alpha.3":"2018-07-04T05:43:26.787Z","8.1.0-alpha.4":"2018-07-04T05:45:33.809Z","8.1.0-alpha.5":"2018-07-04T06:05:17.209Z","8.1.0-alpha.6":"2018-07-04T06:32:11.890Z","8.1.0-alpha.7":"2018-07-04T06:39:20.086Z","8.1.0":"2018-07-04T06:52:31.555Z","8.1.1":"2018-07-04T19:12:20.845Z","8.1.2":"2018-07-06T10:14:26.542Z","8.1.3":"2018-07-09T00:39:27.064Z","8.1.4":"2018-07-10T04:12:58.156Z","8.1.5-alpha.0":"2018-07-10T13:37:53.719Z","8.1.5-alpha.1":"2018-07-10T13:39:50.650Z","8.1.5-alpha.3":"2018-07-11T01:24:54.077Z","8.1.5":"2018-07-11T01:33:57.225Z","8.1.6-alpha.0":"2018-07-11T08:01:28.736Z","8.2.0-alpha.0":"2018-07-12T07:07:20.757Z","8.2.0":"2018-07-12T07:19:28.447Z","8.3.0":"2018-07-13T05:23:12.243Z","8.3.1":"2018-07-13T07:40:53.982Z","8.3.2":"2018-07-13T19:46:53.837Z","9.0.0-alpha.0":"2018-07-20T21:00:47.651Z","8.4.0":"2018-08-02T04:51:04.262Z","8.4.1":"2018-08-06T09:41:42.085Z","8.4.2":"2018-08-07T02:11:48.305Z","8.4.3":"2018-08-07T22:36:00.142Z","8.4.4":"2018-08-09T19:44:16.487Z","8.4.5":"2019-07-25T18:29:49.552Z","8.4.6":"2019-09-12T16:13:37.603Z","9.0.0":"2020-01-01T06:38:46.906Z","9.0.1":"2020-01-02T02:45:07.805Z","9.0.2":"2020-01-03T03:19:12.642Z","9.0.3":"2020-01-03T07:22:10.651Z","9.1.0":"2020-01-03T22:07:55.043Z","9.1.1":"2020-01-05T05:42:10.290Z","10.0.0":"2020-01-07T08:29:13.646Z","10.1.0":"2020-01-08T19:22:07.578Z","10.2.0":"2020-01-17T00:46:43.880Z","10.3.0":"2020-01-20T21:51:25.519Z","10.4.0":"2020-01-21T02:00:13.167Z","10.4.1":"2020-01-21T16:58:42.416Z","10.4.2":"2020-01-22T05:42:55.598Z","10.4.3":"2020-01-27T17:11:19.335Z","11.0.0":"2020-01-30T04:18:06.744Z"},"keywords":["wav","RIFF","RIFX","RF64","WAVE","BWF","audio","8-bit","11-bit","12-bit","16-bit","20-bit","24-bit","32-bit","64-bit","PCM","ADPCM","encode","decode","A-Law","mu-Law","_PMX","iXML","cue","resampler"],"author":{"name":"Rafael da Silva Rocha","email":"rocha.rafaelsilva@gmail.com"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/rochars/wavefile","repository":{"type":"git","url":"git://github.com/rochars/wavefile.git"},"bugs":{"url":"https://github.com/rochars/wavefile/issues"}}