Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lameworker

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lameworker

Package for running LAME MP3 in a Web Worker.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

LAME worker

Package for running LAME in a Web Worker. LAME makes it easy to encode and decode MP3 files. See example.html for an example that records audio from the microphone and encodes it as MP3 in real-time, then lets the user download it.

Example

Using this library is very simple. Assuming you have an HTML file with lame.js and lame.worker.js in the same directory, you can do the following:

<script src="lame.js"></script>
<script>
var lame = lameworker();
lame.getVersion(function (error, version) {
  console.log('Using LAME v' + version);
});
</script>

See dist/example.html for a full example.

Using with Browserify etc.

If you're using a toolchain that simulates a CommonJS environment, you can import this package instead of using the global from dist/lame.js:

var lameworker = require('lameworker');

// Note that you still need to refer to a stand-alone worker file.
var lame = lameworker('/static/lame.worker.js');

lame.getVersion(function (error, version) {
  console.log('Using LAME v' + version);
});

You can find the stand-alone worker file as dist/lame.worker.js in this package.

TODO

There are some obvious improvements to be done still:

  1. Keep buffers within the Web Worker and only send back a Blob instance once the encoding is complete
  2. Simpler API with a helper on the main thread side to make encoding MP3 just a couple of API calls
  3. When the main thread sends data to the Web Worker, transfer the buffer instead of cloning it
  4. More? Please add issues to this repository!

Building

Make sure you have Emscripten set up on your system, then run make.

FAQs

Package last updated on 25 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc