Skip to content
Simple lightweight package for creating your own radio station via NodeJS heavily inspired by Shoutcast and Icecast.
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
examples
src
.gitignore
.npmignore
LICENSE
README.md
jest.config.json
package.json deps cleanup Jul 28, 2019
tsconfig.json
tslint.json Get rid of hangs on streams (#10) Jul 26, 2019
yarn.lock

README.md

Radio engine for NodeJS

build coverage npm GitHub node

Usage

Simple lightweight package to start your own live radio station 📻 Just drop your mp3 files and broadcast them to the world 🌎Heavily inspired by Shoutcast and Icecast.

Setup

Installation

npm i @kefir100/radio-engine --save

Server

const { Station } = require('@kefir100/radio-engine');
const station = new Station({
  error: (...args) => {} // override default handlers
});

station.addTrack({ path: '/Music/', name: 'track1.mp3' });
station.addTrack({ path: '/Music/', name: 'track2.mp3' });
station.addTrack({ path: '/Music/', name: 'track3.mp3' });

server.get('/stream', (req, res) => {
  station.connectListener(req, res);
});

station.start({
  shuffle: true,
});

Client

<audio
    controls
    type='audio/mp3'
    src='/stream'
/>

or just go to EXAMPLES

node examples/server.js

OR

node examples/server.js [path/to/your_mp3tracks]

NOTICE

Version 1.3.0 lacks backward compatibility. You just have to use addTrack method using name field (see the example below) as opposed to file (like in previous versions).

Demo

Fully working demo is available on http://ch1ller.com

You can’t perform that action at this time.