Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script crashes while trying to connect and play audio #55

Open
alpeer opened this issue Nov 7, 2018 · 0 comments
Open

script crashes while trying to connect and play audio #55

alpeer opened this issue Nov 7, 2018 · 0 comments

Comments

@alpeer
Copy link

alpeer commented Nov 7, 2018

Scenario

Trying the run example script: examples/server.js
Server starts and waits.✓
Client recognizes server successfully ✓
but script crashes while trying to connect and play audio ╳ :(

Environment

OS: OSX Mojave
Client OS: iOS 12.0

Script

// s.js
'use strict';

var AirTunesServer = require('nodetunes');
var Speaker = require('speaker');

var speaker = new Speaker({
  channels: 2,
  bitDepth: 16,
  sampleRate: 44100,
});
var server = new AirTunesServer({ serverName: 'NodeTunes Speaker' });

server.on('clientConnected', function(stream) {
  stream.pipe(speaker);
});

server.start();

Crash Log

mac:_airplay alper$ node s.js
crypto.js:267
  this._handle.initiv(cipher, toBuf(key), toBuf(iv));
               ^

Error: Invalid key length
    at new Decipheriv (crypto.js:267:16)
    at Object.createDecipheriv (crypto.js:627:10)
    at Object.decryptAudioData (/Users/alper/Documents/GitHub/_airplay/node_modules/nodetunes/lib/helper.js:141:25)
    at RtpServer.<anonymous> (/Users/alper/Documents/GitHub/_airplay/node_modules/nodetunes/lib/rtp.js:32:23)
    at emitTwo (events.js:126:13)
    at Socket.emit (events.js:214:7)
    at UDP.onMessage [as onmessage] (dgram.js:659:8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant