Skip to content
This repository has been archived by the owner on Jun 9, 2019. It is now read-only.

NodeJS + raspberry PI #39

Open
revolunet opened this issue Dec 16, 2014 · 0 comments
Open

NodeJS + raspberry PI #39

revolunet opened this issue Dec 16, 2014 · 0 comments

Comments

@revolunet
Copy link

Hi there,

Running this simple code on raspberry PI gives choppy sound output and works fine on OSX. Any idea what i'm doing wrong ?

Playing ogg files on the rpi works correctly though.

thanks !

var T = require("timbre");

var PulseGenerator = function() {
    this.freq = 440;
    this.interval = 1000;
};

PulseGenerator.prototype.play = function() {
    this.tone = T("sin", {
        freq: this.freq
    });
    this.pulse = T('+pulse', {
        freq: this.interval + 'ms'
    });
    var sound = T('*', this.tone, this.pulse).play();
};

PulseGenerator.prototype.setFrequency = function(freq) {
    this.tone.set('freq', freq);
};

PulseGenerator.prototype.setInterval = function(ms) {
    this.pulse.set('freq', ms + 'ms');
};

var p = new PulseGenerator();
p.play();
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant