1.1.0 • Published 8 years ago

streamplayer v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 years ago

This is a very simple module to allow playing audio streams via mpg321.

The standard method to play MP3 on nodejs appears to be to use a combination of the excellent lame and speaker modules. There are two reasons why you might prefer to use streamplayer instead:

  1. streamplayer does not require compilation of lame or mpg321 (only the very simple mkfifo), making it much less likely to break for nodejs changes.
  2. streamplayer sends events with progress information during playback.

Usage is very simple:

const StreamPlayer = require('streamplayer');

var player = new StreamPlayer();
var mp3_stream = yourFunc();

player.on('end', () => {
  console.log('Finished!');
});

player.on('progress', info => {
  console.log(`Played ${info.progress}%`);
});

player.play(mp3_stream);
1.1.0

8 years ago

1.0.0

8 years ago