stephen / airsonos

:musical_note: AirPlay to Sonos
MIT License
2.1k stars 255 forks source link

Crashes when selecting device from system preferenced #351

Open alexwileyy opened 7 years ago

alexwileyy commented 7 years ago

Using Node V6.3.0

Crashing when selecting the Sonos speaker from system preferences on mac with the following error: `crypto.js:238 this._handle.initiv(cipher, toBuf(key), toBuf(iv)); ^

Error: Invalid key length at Error (native) at new Decipheriv (crypto.js:238:16) at Object.Decipheriv (crypto.js:235:12) at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141:25) at RtpServer. (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtp.js:32:23) at emitTwo (events.js:106:13) at Socket.emit (events.js:191:7) at UDP.onMessage (dgram.js:540:8)`

shanehull commented 7 years ago

Same issue here.

`crypto.js:241 this._handle.initiv(cipher, toBuf(key), toBuf(iv)); ^

Error: Invalid key length at new Decipheriv (crypto.js:241:16) at Object.Decipheriv (crypto.js:238:12) at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141:25) at RtpServer. (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtp.js:32:23) at emitTwo (events.js:106:13) at Socket.emit (events.js:191:7) at UDP.onMessage [as onmessage] (dgram.js:547:8)`

Edit: Same thing happens when I try to Airplay from my phone.

shanehull commented 7 years ago

@alexwileyy the following fixed my issue: https://github.com/stephen/airsonos/issues/316#issuecomment-255663049