{"_id":"wav","_rev":"18-5c1c8338781d464203e551fd7750ccfd","name":"wav","description":"`Reader` and `Writer` streams for Microsoft WAVE audio files","dist-tags":{"latest":"1.0.2"},"versions":{"0.0.1":{"name":"wav","description":"`Reader` and `Writer` streams for Microsoft WAVE audio files","version":"0.0.1","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-wave.git"},"keywords":[],"dependencies":{"debug":"*","readable-stream":"~0.0.3"},"devDependencies":{"mocha":"*"},"main":"./index.js","scripts":{"test":"mocha"},"engines":{"node":"*"},"_id":"wav@0.0.1","dist":{"shasum":"c5b4c36f099485607b4e620afab5561e5555faac","tarball":"https://registry.npmjs.org/wav/-/wav-0.0.1.tgz","integrity":"sha512-y5TBl3KbTjlooQ4rL2GdgmUgMbLRAlpSl9C6xIjXGRDk+EfP85Syck+uwoZxP6Yhf0oqzr+/1w+8UOqWOM8TLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEhAb/y+wCtQz/WrdFNY5PIAGCDn96dXkbx735nXGsqAIhAMvafmZ0p9Ac8U8ZOoqgONprr6XTheFR78z0g3WG3TMB"}]},"_npmVersion":"1.1.62","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{}},"0.1.0":{"name":"wav","description":"`Reader` and `Writer` streams for Microsoft WAVE audio files","version":"0.1.0","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-wave.git"},"keywords":[],"dependencies":{"debug":"*","stream-parser":"*","readable-stream":"~0.0.3"},"devDependencies":{"mocha":"*"},"main":"./index.js","scripts":{"test":"mocha --reporter spec"},"engines":{"node":">= v0.8.x"},"_id":"wav@0.1.0","dist":{"shasum":"e704d2a769ea233f39f2d6795e8badd65f58b009","tarball":"https://registry.npmjs.org/wav/-/wav-0.1.0.tgz","integrity":"sha512-csib6rNSTVpyaywi0sfhWIH65eJBcwYInZqmKAxVf0RaRnKqFmizVJff4qeb6Ai3maP5Q7N6Bh9jMKwN3mp//g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH5iGwlBKtjRh9EcMPdY02vVjBA43O4ISmP5xH9Db7EaAiB16GilJv412rvpxjYhqwauTzJ2/0nkBK5N3AIwBCgzZg=="}]},"_from":".","_npmVersion":"1.2.12","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{}},"0.1.1":{"name":"wav","description":"`Reader` and `Writer` streams for Microsoft WAVE audio files","version":"0.1.1","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-wav.git"},"keywords":[],"dependencies":{"debug":"*","stream-parser":"*","readable-stream":"~0.0.3"},"devDependencies":{"mocha":"*"},"main":"./index.js","scripts":{"test":"mocha --reporter spec"},"engines":{"node":">= v0.8.x"},"bugs":{"url":"https://github.com/TooTallNate/node-wav/issues"},"homepage":"https://github.com/TooTallNate/node-wav","_id":"wav@0.1.1","dist":{"shasum":"414c488bf3aafb5dcc0906a0192a7080b990aac7","tarball":"https://registry.npmjs.org/wav/-/wav-0.1.1.tgz","noattachment":true},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{}},"0.1.2":{"name":"wav","description":"`Reader` and `Writer` streams for Microsoft WAVE audio files","version":"0.1.2","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-wav.git"},"keywords":[],"dependencies":{"debug":"*","readable-stream":"~1.1.10","stream-parser":"~0.1.0"},"devDependencies":{"mocha":"*"},"main":"./index.js","scripts":{"test":"mocha --reporter spec"},"engines":{"node":">= v0.8.x"},"bugs":{"url":"https://github.com/TooTallNate/node-wav/issues"},"homepage":"https://github.com/TooTallNate/node-wav","_id":"wav@0.1.2","dist":{"shasum":"33bfb4f3d9e84be99fd8091e356657499d23b871","tarball":"https://registry.npmjs.org/wav/-/wav-0.1.2.tgz","integrity":"sha512-zHO5TsSFKnrHuqhaAMSlExn8a3/XvF/IKBS6pvWOZuRmNrANj3pXvOiWO244jgwae5jOOKSqApbXks2kLVnukQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2rzvKZA5iVeYOo2XnQu96x51ZpnlbIE9E3jTv/VcwHwIhANDPYBQERuO6y2gHPvXleS4dYGIVabbcBrPV/rSKKWSp"}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{}},"1.0.0":{"name":"wav","description":"`Reader` and `Writer` streams for Microsoft WAVE audio files","version":"1.0.0","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-wav.git"},"keywords":[],"dependencies":{"debug":"~1.0.0","readable-stream":"1.0","stream-parser":"~0.3.0"},"devDependencies":{"mocha":"*"},"main":"./index.js","scripts":{"test":"mocha --reporter spec"},"gitHead":"6dc73a95061cbbda401edecd549f717a7e1003a0","bugs":{"url":"https://github.com/TooTallNate/node-wav/issues"},"homepage":"https://github.com/TooTallNate/node-wav","_id":"wav@1.0.0","_shasum":"38fd0d9b49fde786eb62b7d730cdd1b816c2255e","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"38fd0d9b49fde786eb62b7d730cdd1b816c2255e","tarball":"https://registry.npmjs.org/wav/-/wav-1.0.0.tgz","integrity":"sha512-zFXYR9HZDEIJPV/WDcwQUa1xtneaoh4bdGltJI+CBSlOR9K/CZUAsVZ1ktVkOcJ/iBj48NUQKvF+pRTkISYEPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9F+TRZNUQ5QHxpZ336VT2GGScc9MF0EnKVQaOxPpAnAIhALHb87U1UFWA34czK+MVI7Rz5EMGyf2jmNnL0UZqPhIH"}]},"directories":{}},"1.0.1":{"name":"wav","description":"`Reader` and `Writer` streams for Microsoft WAVE audio files","version":"1.0.1","license":"MIT","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"repository":{"type":"git","url":"git+https://github.com/tootallnate/node-wav.git"},"dependencies":{"debug":"^2.2.0","readable-stream":"^1.1.14","stream-parser":"^0.3.1"},"devDependencies":{"mocha":"^2.5.3","semistandard":"^8.0.0"},"scripts":{"test":"semistandard && mocha"},"gitHead":"92519d2253ff01c02b2df83b75b02f5f0cf67dcf","bugs":{"url":"https://github.com/tootallnate/node-wav/issues"},"homepage":"https://github.com/tootallnate/node-wav#readme","_id":"wav@1.0.1","_shasum":"bf2da5d0d016fd907a0ea63831ea39198c27cd40","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"linusu","email":"linus@folkdatorn.se"},"dist":{"shasum":"bf2da5d0d016fd907a0ea63831ea39198c27cd40","tarball":"https://registry.npmjs.org/wav/-/wav-1.0.1.tgz","integrity":"sha512-Pjq53YpuDRMZF7bc1ZferCAqGwbUXH1LwvZwbh0P5gN4TUf/3K3Nz/cOxsxltDCwV/f5XE2BoVA4XZqAPplvAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB+Uj0gKVE89bW9UVhtaWtE91NcfcE7XhVOrmVP03VMjAiBDQseuIf8BYnCGcSgEBIKopKixghrdPKMS5CMu81ITDA=="}]},"maintainers":[{"name":"linusu","email":"linus@folkdatorn.se"},{"name":"tootallnate","email":"nathan@tootallnate.net"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/wav-1.0.1.tgz_1469099737368_0.2975793816149235"},"directories":{}},"1.0.2":{"name":"wav","description":"`Reader` and `Writer` streams for Microsoft WAVE audio files","version":"1.0.2","license":"MIT","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"repository":{"type":"git","url":"git+https://github.com/TooTallNate/node-wav.git"},"dependencies":{"buffer-alloc":"^1.1.0","buffer-from":"^1.0.0","debug":"^2.2.0","readable-stream":"^1.1.14","stream-parser":"^0.3.1"},"devDependencies":{"mocha":"^2.5.3","semistandard":"^12.0.1"},"scripts":{"test":"semistandard && mocha"},"gitHead":"a7f9fd33909321a8c1212cc87d6c03223923cad4","bugs":{"url":"https://github.com/TooTallNate/node-wav/issues"},"homepage":"https://github.com/TooTallNate/node-wav#readme","_id":"wav@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"linusu","email":"linus@folkdatorn.se"},"dist":{"integrity":"sha512-viHtz3cDd/Tcr/HbNqzQCofKdF6kWUymH9LGDdskfWFoIy/HJ+RTihgjEcHfnsy1PO4e9B+y4HwgTwMrByquhg==","shasum":"bdbf3fa0d9b4519e9dfd2f603299ead0a2f22060","tarball":"https://registry.npmjs.org/wav/-/wav-1.0.2.tgz","fileCount":18,"unpackedSize":1185251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4t4mCRA9TVsSAnZWagAAbi0QAJB7cYa8Ci8gFodv0oU2\nlY9+QwlyjSaIw0kLukDQ5mqNmMzM4P/PJeTnxwqzikhekjvdyFE0ZSNhFvUz\nthJgBcUe6GxJ0at2SFAcrRXTIK/YCFpw3gso39WiOey8cBNBtoLQHpLULFNy\nvrqB0U09U6yYCGb16Bl86t+jsrghD1Qyrrk6VUG1HH4xdDMm4reaLk8LFpqs\ncx7aCJgbdqZjrQhBchDxsQs9Hv3YpcMIzJPeDojHrfQDtCJS5Uud0fl9hLZy\nhkVgYQnM6YQdbPXDhCHqeSChQjWrFH49DJZZKtYUKymGiU3dtBPE6XhYmtB+\nFZvLTVVH1zgFB8DA+w7zOvJev0OV8rh/H4CjJQKp1EWACimFLKhWLOJsZlhJ\nxuifSAeHN4pHLhNB36QTMxxEH6gnbGHRd1/jo0cLcUqyyJIm4bU8+Dhzti8z\nJ6yKW17fqkOx8jdni5M1pwECpS5hRoyD50MoyWsabueKWkddd0eYRYwXP9ug\nST01UMJzXpSKiAV7T7ErQG3sXxO2Pacyep0N7pykyY3yMB/JKLcbksh50LSy\njNGzJ6rwGwl/iolpJKB0lJCQ4DRy4DJXLq6FyN/jYfeZLt4ZlS8NeLH/hq7A\n5qMRDanaQP74d1AAwxDO2daE52ZgOefXXl7/VInSEvldUaVJjKpOn/2HiX6O\ncCTN\r\n=AWuP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH9xgQ19j48X4L1tv7WdUHmFntZCkuth3tHu6V3zqW3XAiBfa03ZW0DwxExx44ecBxJG5DBFpTBUHQQ8f1LB8AXa3Q=="}]},"maintainers":[{"name":"linusu","email":"linus@folkdatorn.se"},{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wav_1.0.2_1524817446146_0.9922041847265088"},"_hasShrinkwrap":false}},"readme":"node-wav\n========\n### `Reader` and `Writer` streams for Microsoft WAVE audio files\n[![Build Status](https://secure.travis-ci.org/TooTallNate/node-wav.svg)](http://travis-ci.org/TooTallNate/node-wav)\n\nThis module offers streams to help work with Microsoft WAVE files.\n\n\nInstallation\n------------\n\nInstall through npm:\n\n``` bash\n$ npm install wav\n```\n\n\nExample\n-------\n\nHere's how you would play a standard PCM WAVE file out of the speakers using\n`node-wav` and `node-speaker`:\n\n``` javascript\nvar fs = require('fs');\nvar wav = require('wav');\nvar Speaker = require('speaker');\n\nvar file = fs.createReadStream('track01.wav');\nvar reader = new wav.Reader();\n\n// the \"format\" event gets emitted at the end of the WAVE header\nreader.on('format', function (format) {\n\n  // the WAVE header is stripped from the output of the reader\n  reader.pipe(new Speaker(format));\n});\n\n// pipe the WAVE file to the Reader instance\nfile.pipe(reader);\n```\n\n\nAPI\n---\n\n  - [Reader()](#reader)\n  - [Writer()](#writeroptions)\n  - [FileWriter()](#filewriterpath-options)\n\n### Reader()\n\nThe `Reader` class accepts a WAV audio file written to it and outputs the raw\naudio data with the WAV header stripped (most of the time, PCM audio data will\nbe output, depending on the `audioFormat` property).\n\nA `\"format\"` event gets emitted after the WAV header has been parsed.\n\n### Writer(options)\n\nThe `Writer` class accepts raw audio data written to it (only PCM audio data is\ncurrently supported), and outputs a WAV file with a valid WAVE header at the\nbeginning specifying the formatting information of the audio stream.\n\nNote that there's an interesting problem, because the WAVE header also\nspecifies the total byte length of the audio data in the file, and there's no\nway that we can know this ahead of time. Therefore the WAVE header will contain\na byte-length if `0` initially, which most WAVE decoders will know means to\njust read until `EOF`.\n\nOptionally, if you are in a situation where you can seek back to the beginning\nof the destination of the WAVE file (like writing to a regular file, for\nexample), then you may listen for the `\"header\"` event which will be emitted\n_after_ all the data has been written, and you can go back and rewrite the new\nheader with proper audio byte length into the beginning of the destination\n(though if your destination _is_ a regular file, you should use the the\n`FileWriter` class instead).\n\nDefault options: \n\n```JSON\n{\n  \"channels\": 2,\n  \"sampleRate\": 44100,\n  \"bitDepth\": 16\n}\n```  \n\n\n### FileWriter(path, options)\n\nThe `FileWriter` class is, essentially, a combination of `fs.createWriteStream()` and the above `Writer()` class, except it automatically corrects the header after the file is written. Options are passed to both `Writer()` and `fs.createWriteStream()`.\n\nExample usage with `mic`:\n\n```js\nvar FileWriter = require('wav').FileWriter;\nvar mic = require('mic'); // requires arecord or sox, see https://www.npmjs.com/package/mic\n\nvar micInstance = mic({\n  rate: '16000',\n  channels: '1',\n  debug: true\n});\n\nvar micInputStream = micInstance.getAudioStream();\n\nvar outputFileStream = new FileWriter('./test.wav', {\n  sampleRate: 16000,\n  channels: 1\n});\n\nmicInputStream.pipe(outputFileStream);\n\nmicInstance.start();\n\nsetTimeout(function() {\n  micInstance.stop();\n}, 5000);\n```\n","maintainers":[{"name":"linusu","email":"linus@folkdatorn.se"},{"name":"tootallnate","email":"nathan@tootallnate.net"}],"time":{"modified":"2022-07-13T16:45:08.218Z","created":"2012-12-11T06:46:10.719Z","0.0.1":"2012-12-11T06:46:11.511Z","0.1.0":"2013-03-07T08:44:39.749Z","0.1.1":"2013-12-12T18:05:46.106Z","0.1.2":"2014-01-12T02:28:50.858Z","1.0.0":"2015-05-01T18:32:24.673Z","1.0.1":"2016-07-21T11:15:39.724Z","1.0.2":"2018-04-27T08:24:06.331Z"},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"repository":{"type":"git","url":"git+https://github.com/TooTallNate/node-wav.git"},"homepage":"https://github.com/TooTallNate/node-wav#readme","bugs":{"url":"https://github.com/TooTallNate/node-wav/issues"},"readmeFilename":"README.md","users":{"nomedescargues":true},"license":"MIT"}