{
  "_id": "lamejstmp",
  "maintainers": [
    {
      "name": "haoqirui",
      "email": "1580660181@qq.com"
    }
  ],
  "keywords": [
    "mp3",
    "encoder",
    "audio",
    "webaudio"
  ],
  "dist-tags": {
    "latest": "1.0.1"
  },
  "author": {
    "name": "Alex Zhukov"
  },
  "_rev": "3-aa93b487e2aab331cae4df32def36c6f",
  "description": "Pure JavaScript MP3 Encoder(this a tmp lib to fix bug 'MPEGMode is not defined')",
  "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\nthis lib is temporary to fix bug \"MPEGMode is not defined\".\nit's forked by 'https://github.com/isolin/lamejs'\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",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/isolin/lamejs.git"
  },
  "bugs": {
    "url": "https://github.com/zhuker/lamejs/issues"
  },
  "license": "LGPL-3.0",
  "versions": {
    "1.0.0": {
      "name": "lamejstmp",
      "version": "1.0.0",
      "description": "Pure JavaScript MP3 Encoder(this a tmp lib to fix bug 'MPEGMode is not defined')",
      "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/isolin/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"
      },
      "_id": "lamejstmp@1.0.0",
      "_nodeVersion": "16.13.1",
      "_npmVersion": "8.1.2",
      "dist": {
        "integrity": "sha512-Gfv9WUIaBYS8jN5al4JqZMlq9TmVfsBdzlSkzFoDK3s8lXD9e7HEKipmBuinEOpoJ3TkAj/5JZYDVO0O119YUA==",
        "shasum": "a5323e9e3349b21c6328841def29dcfb82c32d49",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/lamejstmp/-/lamejstmp-1.0.0.tgz",
        "fileCount": 146,
        "unpackedSize": 6458623,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6Q0XCRA9TVsSAnZWagAAJggQAJfbErhhpirzuHjIkB78\n/zLVvT2bBzanZx5PanDlSPY5Psj2D5X5fkcnXIZ+f2R96ZKNlS4tZXY1ZEEh\nmVfTz5Bi/eKTfhzFXxY/c4W68v6B5HcFSutU8U3+sCwd++ZcyvFAEw3sR9WE\nvIBvY6Oxrmo7+a7PWqbsoWr38UQn1+P1ib3UswkaL9Q1Rqz6ed5edKGxVpaq\neAyrOinPaICz85xSlBrRv9T/IVe0m//esc8nhWSPcp2TGLut3jopCisMesNp\nfSykehJ7cdNKjD2WDia194Pdz4iw00TNk6fDKqQx9zw5FZYbThuIKdhqDAT6\n838eYw30Dl7u0Tfo9MsHGRAQjLfPv53AcD/E/g2QVPpLaqL5Q6N3bN1tCwko\nwI6mxLOjqmaF0rTeNtox9wy9pHRMe8UePqIYPG9alJ+sb6A71l/8cyg+QIlV\nfUP+iELz5fBQ7k+Z0dDd3tg3XCu5hEOIZTfz003krpTZ1czm7rabmYmKRig8\nHTEnqqBL9GSZWEDlMEqfBT172eowtNrLAK5MVGdESZCYAJBVx/dWaCnzIjG6\nwQMwkSBDmRXXwopQQSm3kkg4cjQkSvIq8OQhZN2Up5LVCcJSV/kjZqcgUyhA\n9JvINrpH7eewdWn2TaqVN7Ojg12uPmYchzew/FJniWBpm0twN6Q4ojZQdSAP\nNS+o\r\n=Y8DV\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEYCIQCYQfJQCbIy/Znq5THlAQ0D/ZF/uDaC1c5ZyNK4kX61YQIhAPDdXsiG3evZR4IfihwQpOJD7oOstcZOnUB5Sb1Ou27N"
          }
        ]
      },
      "_npmUser": {
        "name": "haoqirui",
        "email": "1580660181@qq.com"
      },
      "maintainers": [
        {
          "name": "haoqirui",
          "email": "1580660181@qq.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/lamejstmp_1.0.0_1642663191014_0.5805325479021797"
      },
      "_hasShrinkwrap": false
    },
    "1.0.1": {
      "name": "lamejstmp",
      "version": "1.0.1",
      "description": "Pure JavaScript MP3 Encoder(this a tmp lib to fix bug 'MPEGMode is not defined')",
      "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/isolin/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"
      },
      "_id": "lamejstmp@1.0.1",
      "_nodeVersion": "16.13.1",
      "_npmVersion": "8.1.2",
      "dist": {
        "integrity": "sha512-eEENqMTpiDNTaeOWWbv58KVT4uh9tP7XqpG+aODm9U2eRHwH8Hsx3OnNKxd3noVN6cHmQomv5HQ9N7tzTSVxNQ==",
        "shasum": "d304b74837371efe3c4812927ce429b131b82873",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/lamejstmp/-/lamejstmp-1.0.1.tgz",
        "fileCount": 146,
        "unpackedSize": 6458734,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6Q3dCRA9TVsSAnZWagAA/bsP/3KQORgr5Dx95YeuceOT\n8xQrePhdkYLT9O5s0lBBS0mSszp0c5Y/LB7/u7B/FBoOnrz2eVBfp6Ybajko\nd2CLR8js78S2oWqaQsD3MuNo2VsBoAEg9HeMZ4L9sCvl9vbHGVTgy1nKknbE\nfPUGUOuYetoU/cymy00BmLeFPAzACpJALqK71khts8vDNYtkTx8GObXtxmBE\nWu0R3b8RcNMtOIvooV7ApHAhwUGZA0iPyCnfDKuEsLi0W4Cttp2aUhFjLxyS\n6sQT3s8noN3C/VolsSlUhMeTd/YUCsPwhR/dcCGkrESPW5UA+fobG2111mw9\noSbuzqXKw8/J6FVUwR4VDnJlHbYA9ZIC+/N8y21mWxkzudNHro2qBAVODot+\nQgfnci66M3UrsaZ/0kmM1eDqC2r5G14LMgabrfp/cgUsvvYjJxCiHHI0XFb8\nBa//TYy4PNuDVGYb2npCPA5qtWs7rKTwUuLCaDBQegvcEBwxlDp5XtsFTzkk\nfpnZWEM483UJbuEj6TNgC9n+xHsn0D5zD/xs8FbO+N/olZmExAJSsm4nY5/g\n6DhMD9snNSkaH9dEl4lLEyC8Cp+ErwYx0WO8Q6LotFwZfdO0NYFTJTfvh3x+\ndhKYPBjNFt/Se4NApJeidBTrxq9r/LQz28wV0mmOpb+4U9K7u0+xdj/zSQ+r\nBKhS\r\n=st9l\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIQDNBfDvSYOGo9R+LE+fniFRer6dkeKWyymzXnYDrZBvJgIgU5oFarQvyx2+HTt3hxglADlhqF+xZkKnnCwNPq3Onio="
          }
        ]
      },
      "_npmUser": {
        "name": "haoqirui",
        "email": "1580660181@qq.com"
      },
      "maintainers": [
        {
          "name": "haoqirui",
          "email": "1580660181@qq.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/lamejstmp_1.0.1_1642663389125_0.9363005896130239"
      },
      "_hasShrinkwrap": false,
      "deprecated": "this lamejs author has merge the fix commits, please use lamejs,lamejstmp no longer maintain"
    }
  },
  "name": "lamejstmp",
  "time": {
    "created": "2022-01-20T07:19:51.014Z",
    "1.0.0": "2022-01-20T07:19:51.297Z",
    "modified": "2026-05-13T13:49:02.183Z",
    "1.0.1": "2022-01-20T07:23:09.361Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/zhuker/lamejs#readme"
}