{"_id":"audiobuffer-to-wav","_rev":"5-a9fb6e2df33f328edba6b428ed612acf","name":"audiobuffer-to-wav","description":"convert an AudioBuffer to .wav format","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"audiobuffer-to-wav","version":"1.0.0","description":"convert an AudioBuffer to .wav format","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{},"devDependencies":{"budo":"^7.0.2","xhr":"^2.2.0"},"scripts":{"test":"node test.js","start":"budo demo/index.js --live"},"keywords":["convert","AudioBuffer","to","wav","format","for","browser","webaudio","web audio","audio","buffer","conversion","formats","fmt","riff","wave","sound"],"repository":{"type":"git","url":"git://github.com/Jam3/audiobuffer-to-wav.git"},"homepage":"https://github.com/Jam3/audiobuffer-to-wav","bugs":{"url":"https://github.com/Jam3/audiobuffer-to-wav/issues"},"gitHead":"2272eb09bd46a05e50a6d684d908aa6f13c58f63","_id":"audiobuffer-to-wav@1.0.0","_shasum":"d5b432271455e7fee56b111cd0f8d620d7f9e105","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"d5b432271455e7fee56b111cd0f8d620d7f9e105","tarball":"https://registry.npmjs.org/audiobuffer-to-wav/-/audiobuffer-to-wav-1.0.0.tgz","integrity":"sha512-CAoir4NRrAzAgYo20tEMiKZR84coE8bq/L+H2kwAaULVY4+0xySsEVtNT5raqpzmH6y0pqzY6EmoViLd9W8F/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZBeIMGmyx2lwNvckB9jcrFpE/Xc0DWTX2UvqMr3XLSAiEAn9q6AuSUiXj/wxSgUp30crUbGXp+8tXs4WUZdy/p2EI="}]},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}]}},"readme":"# audiobuffer-to-wav\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nEncodes the contents of an [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer) from the WebAudio API as WAVE. Supports 16-bit PCM and 32-bit float data.\n\nThe code for this has been adapted from the export feature of [Recorder.js](https://github.com/mattdiamond/Recorderjs).\n\nPRs welcome.\n\n## Install\n\n```sh\nnpm install audiobuffer-to-wav --save\n```\n\n## Example\n\n```js\nvar toWav = require('audiobuffer-to-wav')\nvar xhr = require('xhr')\nvar context = new AudioContext()\n\n// request the MP3 as binary\nxhr({\n  uri: 'audio/track.mp3',\n  responseType: 'arraybuffer'\n}, function (err, body, resp) {\n  if (err) throw err\n  // decode the MP3 into an AudioBuffer\n  audioContext.decodeAudioData(resp, function (buffer) {\n    // encode AudioBuffer to WAV\n    var wav = toWav(buffer)\n    \n    // do something with the WAV ArrayBuffer ...\n  })\n})\n```\n\nSee [the demo](./demo/index.js) for an example of loading MP3, decoding it, and triggering a download of the encoded WAV file.\n\nA more advanced example might be to write the file using Node and Electron or [hihat](https://www.npmjs.com/package/hihat), i.e. an easy way to convert MP3/OGG/etc to WAV.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/audiobuffer-to-wav.png)](https://www.npmjs.com/package/audiobuffer-to-wav)\n\n#### `arrayBuffer = encodeWAV(audioBuffer, [opt])`\n\nEncodes the [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer) instance as WAV, returning a new array buffer. Interleaves multi-channel data, if necessary.\n\nBy default, exports with 16-bit PCM (format: 1). You can specify `opt.float32` instead, which will write format 3 with 32-bit float data.\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/Jam3/audiobuffer-to-wav/blob/master/LICENSE.md) for details.\n","maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"time":{"modified":"2022-06-13T03:43:57.056Z","created":"2015-12-14T17:00:03.174Z","1.0.0":"2015-12-14T17:00:03.174Z"},"homepage":"https://github.com/Jam3/audiobuffer-to-wav","keywords":["convert","AudioBuffer","to","wav","format","for","browser","webaudio","web audio","audio","buffer","conversion","formats","fmt","riff","wave","sound"],"repository":{"type":"git","url":"git://github.com/Jam3/audiobuffer-to-wav.git"},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"bugs":{"url":"https://github.com/Jam3/audiobuffer-to-wav/issues"},"license":"MIT","readmeFilename":"README.md","users":{"sbugert":true,"ragg":true}}