Cylon module for Audio

Cylon.js For Audio

Cylon.js ( is a JavaScript framework for robotics, physical computing, and the Internet of Things.

This repository contains the Cylon adaptor for Audio playback. The implementation uses the node-speaker node module from @TooTallNate. Thank you!

Want to use Ruby on robots? Check out our sister project Artoo (

Want to use the Go programming language to power your robots? Check out our sister project Gobot (

Install the module with:

$ npm install cylon cylon-audio

You need to install the various dependencies before you can install cylon-audio on your Intel Edison. First, make sure you have updated to the very latest Edison firmware.

Then, add these lines to your /etc/opkg/base-feeds.conf file:

src/gz all
src/gz edison
src/gz core2-32

And then run:

opkg update
opkg install alsa-tools-dev

Plug in your USB sound device, then run, then run this command to check that ALSA sees your device:

aplay -Ll

Create a ~/.asoundrc file (or an /etc/asound.conf file for all users):

pcm.!default sysdefault:Device

Change Device to match the name of the card returned by the aplay -Ll command.

To verify that the system is working, run this command:

aplay /usr/share/sounds/alsa/Front_Center.wav

If you hear audio, you should now be able to run npm install cylon-audio. Thanks to for which partof these instructions were derived.

Using the cylon-audio module is pretty easy, pretty much just install the npm module and you are good to go, use it as you would any other device passing along the audio you wish to reproduce. To play audio, pass a full or relative path to the play function. See the example below for further details.

var Cylon = require('cylon');
  connections: {
    audio: { adaptor: 'audio' }
  devices: {
    audio: { driver: 'audio' }
  workfunction(my) {'playing', function(song){
      console.log('Playing this nice tune: "' + song + '"');
    // You can pass a string with a full or relative path here,'./audio_samples/audio-sample.mp3');

We're busy adding documentation to our web site at please check there as we continue to work on Cylon.js

Thank you!

For our contribution guidelines, please go to

For the release history, please go to

Copyright (c) 2014 The Hybrid Group. Licensed under the Apache 2.0 license.