{"_id":"lamejs","_rev":"9-9685a86c964bad6f5c235568e8954372","name":"lamejs","description":"Pure JavaScript MP3 Encoder","dist-tags":{"latest":"1.2.1"},"versions":{"1.0.0":{"name":"lamejs","version":"1.0.0","description":"Pure JavaScript MP3 Encoder","main":"src/js/lametest.js","directories":{"doc":"doc","test":"test"},"scripts":{"test":"echo \"Error: no test specified\" && exit 0"},"repository":{"type":"git","url":"git+https://github.com/zhuker/lamejs.git"},"keywords":["mp3","encoder","audio","webaudio"],"author":{"name":"Alex Zhukov"},"license":"LGPL-3.0","bugs":{"url":"https://github.com/zhuker/lamejs/issues"},"homepage":"https://github.com/zhuker/lamejs#readme","gitHead":"4b405d842709363bf1c3c52dfa7a840b84f482ff","_id":"lamejs@1.0.0","_shasum":"bb5d10b9a9635df41cf59945c6cf5ee6616eceea","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"zhuker","email":"zhukov.alex@gmail.com"},"dist":{"shasum":"bb5d10b9a9635df41cf59945c6cf5ee6616eceea","tarball":"https://registry.npmjs.org/lamejs/-/lamejs-1.0.0.tgz","integrity":"sha512-9VEdU915tjFak2XeR8NWNjR2sYko6SVpyemweY6UyM7lX+jDtWHXT9lc76IopOEQ6dAXe/NfRd3lA2bCozvPwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUaaSNzyyjIOLyvGwgFySjVT/6q9Cepad6ytLxV5pd7wIgV/k+Ar3vql3vQRH8QQ5HCEA1Mrp6NEV0qhyQpgqOZ8I="}]},"maintainers":[{"name":"zhuker","email":"zhukov.alex@gmail.com"}]},"1.1.0":{"name":"lamejs","version":"1.1.0","description":"Pure JavaScript MP3 Encoder","main":"src/js/lametest.js","directories":{"doc":"doc","test":"test"},"scripts":{"test":"echo \"Error: no test specified\" && exit 0"},"repository":{"type":"git","url":"git+https://github.com/zhuker/lamejs.git"},"keywords":["mp3","encoder","audio","webaudio"],"author":{"name":"Alex Zhukov"},"license":"LGPL-3.0","bugs":{"url":"https://github.com/zhuker/lamejs/issues"},"homepage":"https://github.com/zhuker/lamejs#readme","dependencies":{"use-strict":"1.0.1"},"gitHead":"e2e418c209caa7f36b9573a8f563425d2e285a57","_id":"lamejs@1.1.0","_shasum":"525c971a57d5efff865c3a0fbe48a6833d16a2e8","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"zhuker","email":"zhukov.alex@gmail.com"},"dist":{"shasum":"525c971a57d5efff865c3a0fbe48a6833d16a2e8","tarball":"https://registry.npmjs.org/lamejs/-/lamejs-1.1.0.tgz","integrity":"sha512-yTLhdfaM+6Woh0szTMO7FpvYdzbY1Fm7IxuA5PePt6IbH3WAt+lqQ6Pp8F1nbnwi4icQ/XN6jSNkYSr6g8BNbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrscxznxIxV0UZ3D5ozTpQfzJi4gFGwry5wm+puOeEOQIhAP1LHtWr/iY4madFgNU9CJ9JgeSNaBxSnAdaQPf1ov8L"}]},"maintainers":[{"name":"zhuker","email":"zhukov.alex@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/lamejs-1.1.0.tgz_1460748282016_0.6673598538618535"}},"1.2.0":{"name":"lamejs","version":"1.2.0","description":"Pure JavaScript MP3 Encoder","main":"src/js/index.js","directories":{"doc":"doc","test":"test"},"scripts":{"test":"node src/js/Tests.js"},"repository":{"type":"git","url":"git+https://github.com/zhuker/lamejs.git"},"keywords":["mp3","encoder","audio","webaudio"],"author":{"name":"Alex Zhukov"},"license":"LGPL-3.0","bugs":{"url":"https://github.com/zhuker/lamejs/issues"},"homepage":"https://github.com/zhuker/lamejs#readme","dependencies":{"use-strict":"1.0.1"},"gitHead":"bfb7f6c6d7877e0fe1ad9e72697a871676119a0e","_id":"lamejs@1.2.0","_shasum":"0259f83db4666141a7b671b8caa6369d95177d08","_from":".","_npmVersion":"4.1.2","_nodeVersion":"6.10.0","_npmUser":{"name":"zhuker","email":"zhukov.alex@gmail.com"},"dist":{"shasum":"0259f83db4666141a7b671b8caa6369d95177d08","tarball":"https://registry.npmjs.org/lamejs/-/lamejs-1.2.0.tgz","integrity":"sha512-xEYvsB2sZ9jIccqfUQpQEBdB6UYQDG/ta2xQkH7oEpENb0JHFJii965WVF8ErUMdZzoe7EdIruz1WpICdhZ9Pw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDa4rUj+3YcvvA5oHYtr5pIkZ7eXkeevCjH6hqNxs1zpQIhAJZyQh2pXZzxfeHuJYtGSaLQPU3X2nVVvJg0m0P2G5ip"}]},"maintainers":[{"name":"zhuker","email":"zhukov.alex@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lamejs-1.2.0.tgz_1498333057998_0.3800563937984407"}},"1.2.1":{"name":"lamejs","version":"1.2.1","description":"Pure JavaScript MP3 Encoder","main":"src/js/index.js","directories":{"doc":"doc","test":"test"},"scripts":{"test":"node src/js/Tests.js"},"repository":{"type":"git","url":"git+https://github.com/zhuker/lamejs.git"},"keywords":["mp3","encoder","audio","webaudio"],"author":{"name":"Alex Zhukov"},"license":"LGPL-3.0","bugs":{"url":"https://github.com/zhuker/lamejs/issues"},"homepage":"https://github.com/zhuker/lamejs#readme","dependencies":{"use-strict":"1.0.1"},"gitHead":"260ecf8a2cf15b97e65442986c5c9149b0be7764","_id":"lamejs@1.2.1","_nodeVersion":"14.18.1","_npmVersion":"7.20.3","dist":{"integrity":"sha512-s7bxvjvYthw6oPLCm5pFxvA84wUROODB8jEO2+CE1adhKgrIvVOlmMgY8zyugxGrvRaDHNJanOiS21/emty6dQ==","shasum":"0f92d38729213f106d4a19ded20821da7e89c8e4","tarball":"https://registry.npmjs.org/lamejs/-/lamejs-1.2.1.tgz","fileCount":146,"unpackedSize":6458317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqOnoCRA9TVsSAnZWagAAIbMP/3LcK4Tgx0O1ZuDuQ5ET\n8Hsx22TicV/3owJZw81QpCdDl7SXaRKmB3YUm7a+Vk0mPHefhBK3m4ecoQaB\nTrL5+Ot6vpWlW46hSkAlwP4FDBM2P4cQWpvX+apLeg81VID3VOgoIORRGeDD\nUjo8jodcU36SUpbhYalHGhV3u/F3kanY+EP46TqQ+PnXtLsO8fJXFgwAdK26\nfdSavKlw6y40T4MA/9tW+/a9P/XC3NYuPscXdsD3a1mEOlaNw0PUrmcBDHoZ\nEm4H5SFmWnuBbAOvKGMe68/60bKON6P4Kl/iHP5kFRRhaqYFB7/22evLz3cf\nEBcj5xkKhxDFqjXCcbOBitE8xAUjLgeI4cI+nW9Vj9Yov5WX0fPJMEBEvbt0\nxo4MjDiYuz6kJ5ldYvzmU+rDWn16bJ2p35E1TOcUsPdyfx0I3I8fZMfGSK7g\nhi7nDDRurfg8wyo0+IFEO0yunRihfymRg0SyDkmtVBentMXiNZQjAgW7UTH6\nbF4P+eIrrt0YF2alTbBnlRfbUethCn5hJ3F2f2t0GETDD5FY3Ek11tmrNHG1\nJ5v0sACguzvjcNLEqpYgDbrGzsLI88HAWg4Jifa9iU5mtw73DreWhEBONR5H\nYwWfqPsEOrI1EqAbCMggoV3/HzfuquZ++k3GGIxhs7KXaX1YC2F9s2uyw8N7\nA5pj\r\n=c3Rw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx23HW68d8EAQmCg97R4fNNIo9emxyPIcbzCdB2PxdJQIhAIlB74LaDGY0jvqoAKQKDcRrW6B4lBwWqJrErbQvrvE1"}]},"_npmUser":{"name":"zhuker","email":"zhukov.alex@gmail.com"},"maintainers":[{"name":"zhuker","email":"zhukov.alex@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lamejs_1.2.1_1638459879707_0.49353520514474614"},"_hasShrinkwrap":false}},"readme":"# lamejs\nFast mp3 encoder written in JavaScript.\nOn my machine it works 20x faster than realtime (it will encode 132 second long sample in 6.5 seconds) both on node and chrome.\nlamejs is a rewrite of jump3r-code which is a rewrite of libmp3lame.\n\n## Installation\n\nTo install via Bower or npm, simply do the following:\n\n```bash\n$ bower install lamejs --save\n```\n\n```bash\n$ npm install lamejs\n```\n\n# Quick Start\n\n```javascript\n<script src='lame.all.js'></script>\n<script>\nvar mp3Data = [];\n\nvar mp3encoder = new lamejs.Mp3Encoder(1, 44100, 128); //mono 44.1khz encode to 128kbps\nvar samples = new Int16Array(44100); //one second of silence replace that with your own samples\nvar mp3Tmp = mp3encoder.encodeBuffer(samples); //encode mp3\n\n//Push encode buffer to mp3Data variable\nmp3Data.push(mp3Tmp);\n\n// Get end part of mp3\nmp3Tmp = mp3encoder.flush();\n\n// Write last data to the output data, too\n// mp3Data contains now the complete mp3Data\nmp3Data.push(mp3Tmp);\n\nconsole.debug(mp3Data);\n</script>\n```\n\nTo use lamejs in Node.js build, you can install it from `npm`:\n\n```\nnpm install lamejs\n```\n\nThen use it:\n\n```\nvar lamejs = require(\"lamejs\");\n```\n\n# Real Example\n\nEither see [example.html](https://github.com/zhuker/lamejs/blob/master/example.html) for full example of wav file encoding in browser or use this:\n\n```javascript\n<script src='lame.all.js'></script>\n<script>\nchannels = 1; //1 for mono or 2 for stereo\nsampleRate = 44100; //44.1khz (normal mp3 samplerate)\nkbps = 128; //encode 128kbps mp3\nmp3encoder = new lamejs.Mp3Encoder(channels, sampleRate, kbps);\nvar mp3Data = [];\n\nsamples = new Int16Array(44100); //one second of silence (get your data from the source you have)\nsampleBlockSize = 1152; //can be anything but make it a multiple of 576 to make encoders life easier\n\nvar mp3Data = [];\nfor (var i = 0; i < samples.length; i += sampleBlockSize) {\n  sampleChunk = samples.subarray(i, i + sampleBlockSize);\n  var mp3buf = mp3encoder.encodeBuffer(sampleChunk);\n  if (mp3buf.length > 0) {\n      mp3Data.push(mp3buf);\n  }\n}\nvar mp3buf = mp3encoder.flush();   //finish writing mp3\n\nif (mp3buf.length > 0) {\n    mp3Data.push(new Int8Array(mp3buf));\n}\n\nvar blob = new Blob(mp3Data, {type: 'audio/mp3'});\nvar url = window.URL.createObjectURL(blob);\nconsole.log('MP3 URl: ', url);\n</script>\n```\n\n# Stereo\n\nIf you want to encode stereo mp3 use separate sample buffers for left and right channel\n\n```javascript\n<script src='lame.all.js'></script>\n<script>\nmp3encoder = new lamejs.Mp3Encoder(2, 44100, 128);\nvar mp3Data = [];\n\nleft = new Int16Array(44100); //one second of silence (get your data from the source you have)\nright = new Int16Array(44100); //one second of silence (get your data from the source you have)\nsampleBlockSize = 1152; //can be anything but make it a multiple of 576 to make encoders life easier\n\nfor (var i = 0; i < samples.length; i += sampleBlockSize) {\n  leftChunk = left.subarray(i, i + sampleBlockSize);\n  rightChunk = right.subarray(i, i + sampleBlockSize);\n  var mp3buf = mp3encoder.encodeBuffer(leftChunk, rightChunk);\n  if (mp3buf.length > 0) {\n    mp3Data.push(mp3buf);\n  }\n}\nvar mp3buf = mp3encoder.flush();   //finish writing mp3\n\nif (mp3buf.length > 0) {\n    mp3Data.push(mp3buf);\n}\n\nconsole.log(mp3Data);\n</script>\n```\n","maintainers":[{"name":"zhuker","email":"zhukov.alex@gmail.com"}],"time":{"modified":"2022-06-19T10:29:34.572Z","created":"2015-11-25T17:40:20.020Z","1.0.0":"2015-11-25T17:40:20.020Z","1.1.0":"2016-04-15T19:24:42.698Z","1.2.0":"2017-06-24T19:37:39.898Z","1.2.1":"2021-12-02T15:44:40.036Z"},"homepage":"https://github.com/zhuker/lamejs#readme","keywords":["mp3","encoder","audio","webaudio"],"repository":{"type":"git","url":"git+https://github.com/zhuker/lamejs.git"},"author":{"name":"Alex Zhukov"},"bugs":{"url":"https://github.com/zhuker/lamejs/issues"},"license":"LGPL-3.0","readmeFilename":"README.md","users":{"stgogm":true,"lightway82":true}}