Closed stefandz closed 9 years ago
Not a node expert either, but I experienced the same problem and have found a workaround.
The problem appears to be that it is somewhat difficult to make node scripts run indefinitely. In you case it probably works fine, it just finishes execution very quickly.
Change the 1000 (1 second) parameter in the following code example to a larger value.
setTimeout(function () {
console.log('stopping');
airtunes.stopAll(function () {
console.log('all stopped');
});
}, 1000);
There are better ways to do this, just search for make node application run permanently
Thank you for this, and sorry for taking so long to get back to you (busy couple of weeks!). However, you're quite right - this is a good starting point workaround. I think it comes down to the handshaking between the Airplay source (us, in this case) and the sink taking a while. A value of 10000 seems to have no ill effects for me. Possibly a consideration for a future permanent code change if it doesn't negatively impact anyone else?
Also ran into this issue... this certainly fixed it. I was pulling hairs out assuming that the example should work..
Hi everyone
I've spent quite a lot of time trying to sort this out myself, and I feel like I'm probably doing something dumb, but here goes!
I have node 0.8 installed and Airtunes installed (AFAICS) correctly, in as much as it is happy enough to run without errors. However, trying to stream to Airfoil speaker results in no audio being heard, and the connection only lasting momentarily. Airfoil gives an error "A connection error occurred. Error during read: Connection reset by peer (54)". However, I can happily connect via Airplay to Airfoil using my iPhone. I have shown what's going on in a YouTube video (sorry about dreadful compression).
https://www.youtube.com/watch?v=aK6zTZCyclY
A few extra facts:
Please let me know if I'm doing something really daft - surely this must work for lots of other people?