Giter VIP home page Giter VIP logo

node-alsa-streamer's Introduction

node-alsa-streamer

Basic ALSA to FLAC streamer for Icecast, written in Node.js

Although originally developed to stream an analog source, like a turntable or cassette player, via an ADC audio hat on a Raspberry Pi over a local home or office network, this can be used for any mono or stereo analog source on any Linux machine that supports ALSA and Icecast.

Known Hardware Compatibility

To date, this has been tested using following Pi audio hats:

  • AudioInjector Stereo (Pi 2 & 3)
  • Fe-Pi Audio (Pi 2 & 3)
  • PiSound (Pi 3)

It has also been tested on Ubuntu 18.04 x64 laptop using an AT-LP120-USB turntable.

As this is using Icecast, this is not real-time audio streaming, with usual 2-8 secs of latency depending on the settings used.

Usage

This was written using NodeJS v10.x+, Icecast 2.4.x+, ALSA, and FFmpeg. Ensure these are installed on your linux distro.

$ git clone https://github.com/jrnelson90/node-alsa-streamer.git
$ cd node-alsa-streamer
$ npm install
$ node alsa-streamer.js

Settings for the audio stream are auto-loaded from a config.json file in the root project directory. If there is no config.json file present, a setup process will prompt you to select stream settings based on detected hardware capabilities for audio capture and icecast settings.

To modify your stream settings, either edit config.json manually. Or delete config.json to re-trigger the configuration setup process on the next program launch.

Known Issues

Currently the stream timeouts after roughly 1.5 hours when streaming 24-bit/48Khz FLAC. This time will be higher or lower depending on the combination of bit-depth and sampling rate that you select for your stream. I am as yet unsure if this a limitation in the configuration of ALSA, Icecast, or FFmpeg.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.