npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

raop-rtsp-server

v0.0.10

Published

A simple RAOP server

Downloads

30

Readme

raop-rtsp-server

An attempt to create a RAOP (AirTunes) server in Node.js.

This project is highly work-in-progress - use it at your own risk!

Known compatibility issues:

  • Currently this module will only compile on Node.js v0.10. Hopefully this will be fixed soon.

Build status js-standard-style

Tips

If using this module to output raw PCM audio to STDOUT, I've found the following useful:

I've tried quite a few different audio players but I've only managed to get sox to play back to PCM audio.

Install via Homebrew:

brew install sox

FFmpeg should also be able to parse PCM audio if you like that program better.

Installation

For standalone usage, run:

npm install --global raop-rtsp-server

For programmatic usage, run:

npm install raop-rtsp-server

CLI usage

If the speaker module can compile on your system, you should just be able to start the server without any arguments:

raop-rtsp-server

If you'd rather pipe the PCM audio to another player, you can so so using the --stdout argument:

raop-rtsp-server --stdout | sox -traw -L -c2 -r44100 -b16 -e signed-integer - -tcoreaudio

For sox to be able to interpret the raw ALAC audio data, you need to help it a little. These are the command line arguments given in the example above:

  • -t raw - Set input type to raw. This means that sox shouldn't expect any headers in the data - just raw audio
  • -L - The audio data is formatted using native byte ordering, which is little endian on Intel CPU's. Your system might use -B for big endian
  • -c 2 - Use 2 audio channels
  • -r 44100 - Use a 44.1khz sample rate
  • -b 16 - Use a bit-depth of 16
  • -e signed-integer - The audio encoding type
  • - - Set input source to STDIN
  • -t coreaudio - Set output type to coreaudio (your system might differ, but this must always come after your input source)

Debugging

To run in debug mode, use the DEBUG environment variable:

DEBUG=* raop-rtsp-server

Programmatic usage

The module can also be access programmatically:

var server = require('raop-rtsp-server')

server.sessions.on('new', function (session) {
  session.on('data', function (chunk) {
    console.log('received %d audio bytes on session %s', chunk.length, session.id)
  })
})

server.start({ name: 'NodeTunes' })

The server.start() function takes an optional options object:

  • name - The name that the RAOP server (this will be shown on your iDevices). Defaults to raop-rtsp-server
  • port - The port that the server should listen on. Defaults to 5000

Session

The session object emitted by the new event is a readable stream and will output raw PCM audio data.

Properties

  • volume - A float between 0 and 1 representing the current volume level (0 being muted and 1 being full volume)
  • volumeDb - A float value representing the audio attenuation in dB. It ranges from -30 (lowest) to 0 (highest). A special number -144 represents mute.

Events

Besides the normal readable stream API, the session also emits the following events:

volume

Emitted when ever the client changes the volume. The value emitted is the volume as a float value representing the audio attenuation in dB. It ranges from -30 (lowest) to 0 (highest). A special number -144 represents mute.

License

MIT