All Projects → dgurkaynak → Nodeshout

dgurkaynak / Nodeshout

Native libshout bindings for node.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Nodeshout

Radiodroid
radio browser app that uses www.radio-browser.info on android
Stars: ✭ 362 (+1067.74%)
Mutual labels:  radio
Rtlsdr Scanner
A cross platform Python frequency scanning GUI for the OsmoSDR rtl-sdr library
Stars: ✭ 544 (+1654.84%)
Mutual labels:  radio
Huxleyfm
An unofficial desktop app for listening to SomaFM, built with Electron.
Stars: ✭ 22 (-29.03%)
Mutual labels:  radio
Sky31radio
湘潭大学三翼校园 "四季电台" Android 客户端
Stars: ✭ 422 (+1261.29%)
Mutual labels:  radio
Trunk Recorder
Records calls from a Trunked Radio System (P25 & SmartNet)
Stars: ✭ 505 (+1529.03%)
Mutual labels:  radio
Chattervox
📡 An AX.25 packet radio chat protocol with support for digital signatures and binary compression. Like IRC over radio waves.
Stars: ✭ 662 (+2035.48%)
Mutual labels:  radio
Rtl Sdr
library for turning a RTL2832 based DVB dongle into a Software DefinedReceiver; mirror from https://git.osmocom.org/rtl-sdr/
Stars: ✭ 336 (+983.87%)
Mutual labels:  radio
Prompt Checkbox
This repository has been archived, use Enquirer instead.
Stars: ✭ 21 (-32.26%)
Mutual labels:  radio
Luaradio
A lightweight, embeddable software-defined radio framework built on LuaJIT
Stars: ✭ 509 (+1541.94%)
Mutual labels:  radio
Radiobox.css
🔘 Tiny set of pure CSS animations for your radio inputs. https://720kb.github.io/radiobox.css/
Stars: ✭ 699 (+2154.84%)
Mutual labels:  radio
Libretime
LibreTime: Radio Broadcast & Automation Platform
Stars: ✭ 439 (+1316.13%)
Mutual labels:  radio
Backbone.radio
Messaging patterns for Backbone applications.
Stars: ✭ 496 (+1500%)
Mutual labels:  radio
Qspectrumanalyzer
Spectrum analyzer for multiple SDR platforms (PyQtGraph based GUI for soapy_power, hackrf_sweep, rtl_power, rx_power and other backends)
Stars: ✭ 677 (+2083.87%)
Mutual labels:  radio
Hackrf
low cost software radio platform
Stars: ✭ 4,286 (+13725.81%)
Mutual labels:  radio
Hamexam
这是一个帮助业余无线电技术能力认证考试的软件,用来背题。
Stars: ✭ 25 (-19.35%)
Mutual labels:  radio
Goodwatch
Replacement board for Casio Calculator Watches using the CC430F6147
Stars: ✭ 343 (+1006.45%)
Mutual labels:  radio
Bootstrap Switch
Turn checkboxes and radio buttons in toggle switches.
Stars: ✭ 5,132 (+16454.84%)
Mutual labels:  radio
Uclaradio.com
UCLA Radio Website
Stars: ✭ 29 (-6.45%)
Mutual labels:  radio
Fabfm Kit
FM radio kit with enclosure
Stars: ✭ 10 (-67.74%)
Mutual labels:  radio
System Bus Radio
Transmits AM radio on computers without radio transmitting hardware.
Stars: ✭ 5,831 (+18709.68%)
Mutual labels:  radio

nodeshout

Native libshout bindings for node.js.

Libshout allows applications to easily communicate and broadcast to an Icecast streaming media server. It handles the socket connections, metadata communication, and data streaming for the calling application, and lets developers focus on feature sets instead of implementation details.

More detail: http://icecast.org

Original libshout docs: http://www.aelius.com/njh/libshout-doc/libshout.html (a copy of this page can be also found at /docs/libshout2.html)

Node version compability

Since this project heavily depends on node-ffi project, there can be compability issues.

My tests for the current version (0.1.3):

node npm result
12.11.0 6.11.3 node-ffi does not support node 12 yet
11.15.0 6.7.0
10.16.0 6.9.0
9.11.1 5.6.0
8.11.4 5.6.0
6.14.1 3.10.10

Usage

You have to install libshout library before using nodeshout. If you work on OS X, you can install via homebrew.

brew install libshout

Then, install nodeshout via npm.

npm i nodeshout

Initalize nodeshout library, create a Shout instance and configure it.

// Initalize
nodeshout.init();

// Create a shout instance
const shout = nodeshout.create();

// Configure it
shout.setHost('localhost');
shout.setPort(8000);
shout.setUser('source');
shout.setPassword('password');
shout.setMount('mount');
shout.setFormat(1); // 0=ogg, 1=mp3
shout.setAudioInfo('bitrate', '192');
shout.setAudioInfo('samplerate', '44100');
shout.setAudioInfo('channels', '2');

Open the connection.

shout.open();

If connection is successful, above function will return nodeshout.ErrorTypes.SUCCESS which is integer 0. After successful connection, you can send audio file chunks via shout.send method.

shout.send(buffer, bytesRead);

For the synchronization, there is 2 method provided. First one is shout.sync() method, this method blocks current thread. Second one is shout.delay() method, this method returns how many milliseconds you should wait to send next audio chunk.

Metadata

// Create a metadata instance
const metadata = nodeshout.createMetadata();

// Set currently playing song.
metadata.add('song', 'Led Zeppelin - I can\'t quit you baby');

// Apply metadata to shout
shout.setMetadata(metadata);

Streams

Helper streams make all the things super-easy. You don't have to deal with reading and syncing stuff. They're avaliable >= 0.1.1.

Include helper stream classes.

const { FileReadStream, ShoutStream } = require('nodeshout');

and then pipe them together. That's all!

const fileStream = new FileReadStream('./some/music.mp3', 65536);
const shoutStream = fileStream.pipe(new ShoutStream(shout));

shoutStream.on('finish', () => {
    // Finished playing, you can create
    // another stream for next song
});

Example

Check the /demos folder.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].