node-lame

Node.js native bindings to libmp3lame & libmpg123

  • 所有者: TooTallNate/node-lame
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

node-lame

NodeJS native bindings to libmp3lame & libmpg123

Build Status

For all your async streaming MP3 encoding/decoding needs, there's node-lame!
This module hooks into libmp3lame, the library that the lame command uses, to
provide Encoder and Decoder streams to NodeJS.

Installation

node-lame comes bundled with its own copy of libmp3lame and libmpg123, so
there's no need to have them installed on your system.

Simply compile and install node-lame using npm:

$ npm install lame

Example

Here's an example of using node-lame to encode some raw PCM data coming from
process.stdin to an MP3 file that gets piped to process.stdout:

var lame = require('lame');

// create the Encoder instance
var encoder = new lame.Encoder({
  // input
  channels: 2,        // 2 channels (left and right)
  bitDepth: 16,       // 16-bit samples
  sampleRate: 44100,  // 44,100 Hz sample rate

  // output
  bitRate: 128,
  outSampleRate: 22050,
  mode: lame.STEREO // STEREO (default), JOINTSTEREO, DUALCHANNEL or MONO
});

// raw PCM data from stdin gets piped into the encoder
process.stdin.pipe(encoder);

// the generated MP3 file gets piped to stdout
encoder.pipe(process.stdout);

See the examples directory for some more example code.

API

Decoder class

The Decoder class is a Stream subclass that accepts MP3 data written to it,
and outputs raw PCM data. It also emits a "format" event when the format of
the MP3 file is determined (usually right at the beginning).

Encoder class

The Encoder class is a Stream subclass that accepts raw PCM data written to
it, and outputs a valid MP3 file. You must specify the PCM data format when
creating the encoder instance. Only 16-bit signed samples are currently
supported (rescale before passing to the encoder if necessary)...

主要指標

概覽
名稱與所有者TooTallNate/node-lame
主編程語言C++
編程語言Python (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2011-11-09 01:08:44
推送於2024-06-06 06:13:21
最后一次提交2018-10-03 23:50:26
發布數17
最新版本名稱v1.2.4 (發布於 2016-06-27 07:20:15)
第一版名稱v0.0.1 (發布於 )
用户参与
星數569
關注者數20
派生數111
提交數300
已啟用問題?
問題數80
打開的問題數41
拉請求數15
打開的拉請求數5
關閉的拉請求數11
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?