openairplay / node_airtunes Goto Github PK
View Code? Open in Web Editor NEWnode.js AirTunes v2 implementation: stream wirelessly to Apple audio devices.
License: BSD 2-Clause "Simplified" License
node.js AirTunes v2 implementation: stream wirelessly to Apple audio devices.
License: BSD 2-Clause "Simplified" License
Hi,
// OSX 10.10.3 (Yosemite)
// Node v0.10.33
After installing node_airtunes I thought I'd quickly fire up the example to make sure my environment was OK before going any further, so:
$ cat sample.pcm | node play_stdin.js --host yourhost
I replaced 'yourhost' with the IP of my Airport Express and the script proceeded without error, although I got no audio through the Airport Express. In fact no matter what IP I try (even ones which don't exist) the script proceeds with identical on-screen feedback:
$ cat sample.pcm | node play_stdin.js --host 192.168.1.100
pipe PCM data to play over AirTunes
example: cat sample.pcm | node play_stdin.js --host
adding device: 192.168.1.100:5000
stopping
all stopped
buffer buffering
buffer playing
buffer end
playback ended, waiting for AirTunes devices
I'm sure this is something noob that I've missed but can anyone help please?
Thanks,
Steve
Running npm install will result in an error message indicating missing openssl header files:
> [email protected] install /Users/geraldf/node_modules/airtunes
> node-gyp rebuild
CXX(target) Release/obj.target/airtunes/src/codec.o
../src/codec.cc:5:10: fatal error: 'openssl/aes.h' file not found
#include <openssl/aes.h>
After reading the web, it seams that the header files have been excluded from el capitan. the libraries should be still there.
I have no idea to change the npm install method to use a different location for the openssl header files.
hi
i'm trying to use node_airtunes
on a raspberry pi, running the latest raspbian “wheezy” build as operating system.
when executing one of your play_*.js
examples, i hear only indefinable noise on my apple tv.
doing the same on my mac works without any problem.
do you have any idea what could fix that problem? (compile options? c data types? ...) please find a log of my compile below.
thank you for any input! :)
cheers,
manu
make: Entering directory `/webapps/kaffeeundkuchen/node_modules/airtunes/build'
CXX(target) Release/obj.target/airtunes/src/codec.o
In file included from ../src/../alac/ALACEncoder.h:29:0,
from ../src/codec.cc:15:
../src/../alac/ALACAudioTypes.h:64:32: warning: multi-character character constant [-Wmultichar]
../src/../alac/ALACAudioTypes.h:65:28: warning: multi-character character constant [-Wmultichar]
../src/../alac/ALACAudioTypes.h:154:22: warning: multi-character character constant [-Wmultichar]
../src/../alac/ALACAudioTypes.h:182:26: warning: multi-character character constant [-Wmultichar]
CXX(target) Release/obj.target/airtunes/src/bindings.o
CC(target) Release/obj.target/airtunes/alac/EndianPortable.o
CC(target) Release/obj.target/airtunes/alac/ALACBitUtilities.o
CXX(target) Release/obj.target/airtunes/alac/ALACEncoder.o
In file included from ../alac/ALACEncoder.h:29:0,
from ../alac/ALACEncoder.cpp:33:
../alac/ALACAudioTypes.h:64:32: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:65:28: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:154:22: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:182:26: warning: multi-character character constant [-Wmultichar]
../alac/ALACEncoder.cpp:48:36: warning: multi-character character constant [-Wmultichar]
../alac/ALACEncoder.cpp: In member function 'int32_t ALACEncoder::EncodeStereo(BitBuffer*, void*, uint32_t, uint32_t, uint32_t)':
../alac/ALACEncoder.cpp:279:13: warning: variable 'denShift' set but not used [-Wunused-but-set-variable]
../alac/ALACEncoder.cpp: In member function 'int32_t ALACEncoder::EncodeStereoFast(BitBuffer*, void*, uint32_t, uint32_t, uint32_t)':
../alac/ALACEncoder.cpp:559:13: warning: variable 'denShift' set but not used [-Wunused-but-set-variable]
CC(target) Release/obj.target/airtunes/alac/ag_enc.o
In file included from ../alac/ag_enc.c:32:0:
../alac/ALACAudioTypes.h:64:32: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:65:28: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:154:22: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:182:26: warning: multi-character character constant [-Wmultichar]
CC(target) Release/obj.target/airtunes/alac/ag_dec.o
In file included from ../alac/ag_dec.c:31:0:
../alac/ALACAudioTypes.h:64:32: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:65:28: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:154:22: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:182:26: warning: multi-character character constant [-Wmultichar]
CC(target) Release/obj.target/airtunes/alac/dp_enc.o
CC(target) Release/obj.target/airtunes/alac/matrix_enc.o
In file included from ../alac/matrix_enc.c:30:0:
../alac/ALACAudioTypes.h:64:32: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:65:28: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:154:22: warning: multi-character character constant [-Wmultichar]
../alac/ALACAudioTypes.h:182:26: warning: multi-character character constant [-Wmultichar]
CC(target) Release/obj.target/airtunes/src/aes_utils.o
CC(target) Release/obj.target/airtunes/src/base64.o
SOLINK_MODULE(target) Release/obj.target/airtunes.node
SOLINK_MODULE(target) Release/obj.target/airtunes.node: Finished
COPY Release/airtunes.node
make: Leaving directory `/webapps/kaffeeundkuchen/node_modules/airtunes/build'
[email protected] node_modules/airtunes
└── [email protected]
When im doing an "npm install airtunes" i get this.
node version 6.3.1
npm version 3.10.3
node-gyp version 3.4.0
Any idea what the problem could be? :)
> npm i airtunes
> [email protected] install C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes
> node-gyp rebuild
Rene@DESKTOP-Q0UE41G C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes
> if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
codec.cc
bindings.cc
ALACEncoder.cpp
..\alac\ALACEncoder.cpp(438): warning C4805: '==': unsafe mix of type 'uint8_t' and type 'bool' in operation [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\alac\ALACEncoder.cpp(442): warning C4805: '==': unsafe mix of type 'uint8_t' and type 'bool' in operation [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\alac\ALACEncoder.cpp(686): warning C4805: '==': unsafe mix of type 'uint8_t' and type 'bool' in operation [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\alac\ALACEncoder.cpp(690): warning C4805: '==': unsafe mix of type 'uint8_t' and type 'bool' in operation [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\alac\ALACEncoder.cpp(920): warning C4805: '==': unsafe mix of type 'uint8_t' and type 'bool' in operation [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\alac\ALACEncoder.cpp(924): warning C4805: '==': unsafe mix of type 'uint8_t' and type 'bool' in operation [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\alac\ALACEncoder.cpp(1255): warning C4244: '=': conversion from 'alac_float64_t' to 'uint32_t', possible loss of data [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\bindings.cc(15): error C2248: 'v8::HandleScope::HandleScope': cannot access protected member declared in class 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
C:\Users\Rene\.node-gyp\6.3.1\include\node\v8.h(904): note: see declaration of 'v8::HandleScope::HandleScope'
C:\Users\Rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
c:\users\rene\desktop\airtunes\node_modules\airtunes\src\../alac/ALACBitUtilities.h(68): error C2371: 'ELEMENT_TYPE': redefinition; different basic types (compiling source file ..\src\codec.cc) [C:\Users\Rene\Desktop\Airtunes\node_modules\
airtunes\build\airtunes.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\winioctl.h(3944): note: see declaration of 'ELEMENT_TYPE' (compiling source file ..\src\codec.cc)
..\src\codec.cc(59): error C2248: 'v8::HandleScope::HandleScope': cannot access protected member declared in class 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(904): note: see declaration of 'v8::HandleScope::HandleScope'
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
..\src\codec.cc(62): error C2039: 'Dispose': is not a member of 'v8::Persistent<v8::Value,v8::NonCopyablePersistentTraits<T>>' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
with
[
T=v8::Value
]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(5293): note: see declaration of 'v8::Persistent<v8::Value,v8::NonCopyablePersistentTraits<T>>'
with
[
T=v8::Value
]
..\src\codec.cc(67): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(67): error C2143: syntax error: missing ',' before '&' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(68): error C2248: 'v8::HandleScope::HandleScope': cannot access protected member declared in class 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(904): note: see declaration of 'v8::HandleScope::HandleScope'
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
..\src\codec.cc(78): error C2660: 'v8::PersistentBase<T>::New': function does not take 1 arguments [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
with
[
T=v8::ObjectTemplate
]
..\src\codec.cc(79): error C2819: type 'v8::Persistent<v8::ObjectTemplate,v8::NonCopyablePersistentTraits<T>>' does not have an overloaded member 'operator ->' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
with
[
T=v8::ObjectTemplate
]
..\src\codec.cc(78): note: see declaration of 'v8::Persistent<v8::ObjectTemplate,v8::NonCopyablePersistentTraits<T>>'
with
[
T=v8::ObjectTemplate
]
..\src\codec.cc(79): note: did you intend to use '.' instead?
..\src\codec.cc(79): error C2039: 'SetInternalFieldCount': is not a member of 'v8::Persistent<v8::ObjectTemplate,v8::NonCopyablePersistentTraits<T>>' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
with
[
T=v8::ObjectTemplate
]
..\src\codec.cc(78): note: see declaration of 'v8::Persistent<v8::ObjectTemplate,v8::NonCopyablePersistentTraits<T>>'
with
[
T=v8::ObjectTemplate
]
..\src\codec.cc(80): error C2819: type 'v8::Persistent<v8::ObjectTemplate,v8::NonCopyablePersistentTraits<T>>' does not have an overloaded member 'operator ->' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
with
[
T=v8::ObjectTemplate
]
..\src\codec.cc(78): note: see declaration of 'v8::Persistent<v8::ObjectTemplate,v8::NonCopyablePersistentTraits<T>>'
with
[
T=v8::ObjectTemplate
]
..\src\codec.cc(80): note: did you intend to use '.' instead?
..\src\codec.cc(80): error C2039: 'NewInstance': is not a member of 'v8::Persistent<v8::ObjectTemplate,v8::NonCopyablePersistentTraits<T>>' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
with
[
T=v8::ObjectTemplate
]
..\src\codec.cc(78): note: see declaration of 'v8::Persistent<v8::ObjectTemplate,v8::NonCopyablePersistentTraits<T>>'
with
[
T=v8::ObjectTemplate
]
..\src\codec.cc(80): error C2660: 'v8::PersistentBase<v8::Object>::New': function does not take 1 arguments [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(81): error C2819: type 'v8::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' does not have an overloaded member 'operator ->' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
with
[
T=v8::Object
]
..\src\codec.cc(80): note: see declaration of 'v8::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
with
[
T=v8::Object
]
..\src\codec.cc(81): note: did you intend to use '.' instead?
..\src\codec.cc(81): error C2039: 'SetPointerInInternalField': is not a member of 'v8::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
with
[
T=v8::Object
]
..\src\codec.cc(80): note: see declaration of 'v8::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
with
[
T=v8::Object
]
..\src\codec.cc(82): error C2039: 'MakeWeak': is not a member of 'v8::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
with
[
T=v8::Object
]
..\src\codec.cc(80): note: see declaration of 'v8::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
with
[
T=v8::Object
]
..\src\codec.cc(84): error C2039: 'Close': is not a member of 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
..\src\codec.cc(87): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(87): error C2143: syntax error: missing ',' before '&' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(88): error C2248: 'v8::HandleScope::HandleScope': cannot access protected member declared in class 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(904): note: see declaration of 'v8::HandleScope::HandleScope'
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
..\src\codec.cc(90): error C2065: 'args': undeclared identifier [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(90): error C2228: left of '.Length' must have class/struct/union [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(90): note: type is 'unknown-type'
..\src\codec.cc(92): error C2039: 'Close': is not a member of 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
..\src\codec.cc(92): error C2660: 'v8::Null': function does not take 0 arguments [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(95): error C2065: 'args': undeclared identifier [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(95): error C2227: left of '->ToObject' must point to class/struct/union/generic type [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(96): error C2039: 'GetPointerFromInternalField': is not a member of 'v8::Object' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(2635): note: see declaration of 'v8::Object'
..\src\codec.cc(98): error C2065: 'args': undeclared identifier [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(101): error C2065: 'args': undeclared identifier [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(104): error C2065: 'args': undeclared identifier [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(104): error C2227: left of '->Int32Value' must point to class/struct/union/generic type [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(113): error C2039: 'Close': is not a member of 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
..\src\codec.cc(113): error C2660: 'v8::Integer::New': function does not take 1 arguments [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(116): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(116): error C2143: syntax error: missing ',' before '&' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(117): error C2248: 'v8::HandleScope::HandleScope': cannot access protected member declared in class 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(904): note: see declaration of 'v8::HandleScope::HandleScope'
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
..\src\codec.cc(119): error C2065: 'args': undeclared identifier [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(119): error C2228: left of '.Length' must have class/struct/union [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(119): note: type is 'unknown-type'
..\src\codec.cc(121): error C2039: 'Close': is not a member of 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
..\src\codec.cc(121): error C2660: 'v8::Null': function does not take 0 arguments [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(124): error C2065: 'args': undeclared identifier [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(126): error C2065: 'args': undeclared identifier [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(126): error C2227: left of '->Int32Value' must point to class/struct/union/generic type [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(131): error C2131: expression did not evaluate to a constant [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(131): note: failure was caused by non-constant arguments or reference to a non-constant symbol
..\src\codec.cc(131): note: see usage of 'kBlockSize'
..\src\codec.cc(149): error C2039: 'Close': is not a member of 'v8::HandleScope' [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
c:\users\rene\.node-gyp\6.3.1\include\node\v8.h(888): note: see declaration of 'v8::HandleScope'
..\src\codec.cc(149): error C2660: 'v8::Null': function does not take 0 arguments [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
..\src\codec.cc(153): error C2665: 'node::NODE_SET_METHOD': none of the 2 overloads could convert all the argument types [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
C:\Users\Rene\.node-gyp\6.3.1\include\node\node.h(257): note: could be 'void node::NODE_SET_METHOD(v8::Local<v8::Object>,const char *,v8::FunctionCallback)' (compiling source file ..\src\codec.cc)
C:\Users\Rene\.node-gyp\6.3.1\include\node\node.h(244): note: or 'void node::NODE_SET_METHOD(v8::Local<v8::Template>,const char *,v8::FunctionCallback)' (compiling source file ..\src\codec.cc)
..\src\codec.cc(153): note: while trying to match the argument list '(v8::Local<v8::Object>, const char [11], overloaded-function)'
..\src\codec.cc(154): error C2665: 'node::NODE_SET_METHOD': none of the 2 overloads could convert all the argument types [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
C:\Users\Rene\.node-gyp\6.3.1\include\node\node.h(257): note: could be 'void node::NODE_SET_METHOD(v8::Local<v8::Object>,const char *,v8::FunctionCallback)' (compiling source file ..\src\codec.cc)
C:\Users\Rene\.node-gyp\6.3.1\include\node\node.h(244): note: or 'void node::NODE_SET_METHOD(v8::Local<v8::Template>,const char *,v8::FunctionCallback)' (compiling source file ..\src\codec.cc)
..\src\codec.cc(154): note: while trying to match the argument list '(v8::Local<v8::Object>, const char [11], overloaded-function)'
..\src\codec.cc(155): error C2665: 'node::NODE_SET_METHOD': none of the 2 overloads could convert all the argument types [C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes\build\airtunes.vcxproj]
C:\Users\Rene\.node-gyp\6.3.1\include\node\node.h(257): note: could be 'void node::NODE_SET_METHOD(v8::Local<v8::Object>,const char *,v8::FunctionCallback)' (compiling source file ..\src\codec.cc)
C:\Users\Rene\.node-gyp\6.3.1\include\node\node.h(244): note: or 'void node::NODE_SET_METHOD(v8::Local<v8::Template>,const char *,v8::FunctionCallback)' (compiling source file ..\src\codec.cc)
..\src\codec.cc(155): note: while trying to match the argument list '(v8::Local<v8::Object>, const char [11], overloaded-function)'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Rene\Desktop\Airtunes\node_modules\airtunes
gyp ERR! node -v v6.3.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Rene\Desktop\Airtunes\package.json'
npm WARN Airtunes No description
npm WARN Airtunes No repository field.
npm WARN Airtunes No README data
npm WARN Airtunes No license field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "airtunes"
npm ERR! node v6.3.1
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the airtunes package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs airtunes
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls airtunes
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Rene\Desktop\Airtunes\npm-debug.log
I'm unable to build the latest release here on Debian ( per #45 ), but I was able to build Rotvig's patched version which appears to address the build issues at https://github.com/Rotvig/node_airtunes . Whenever I try one of the example scripts, however, I get this error:
adding device: 192.168.98.161:5000
dgram.js:165
throw new ERR_SOCKET_ALREADY_BOUND();
^
Error [ERR_SOCKET_ALREADY_BOUND]: Socket is already bound
at Socket.bind (dgram.js:165:11)
at /mnt/md0/home/adam/node_modules/airtunes/lib/udp_servers.js:130:23
at next (/mnt/md0/home/adam/node_modules/async/dist/async.js:5223:28)
at Socket.<anonymous> (/mnt/md0/home/adam/node_modules/airtunes/lib/udp_servers.js:116:11)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at state.handle.lookup (dgram.js:243:14)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
Any suggestions for troubleshooting?
It is possible to have a full AirPlay and AirPlay 2 support?
Please look all codes not integrated:
I to run into an error, the nodejs feeback below:
_stream_readable.js:664
throw new Error('Cannot switch to old mode now.');
img: http://i.imgur.com/x5Czrso.png
Can I should to do?
Thanks.
Hello,
After an album art is set on an AppleTV, there is no way of clearing it. Maybe i am overlooking something, but i read through the code and it doesn't look like it.
I tried passing an empty string, undefined, null and false to device.setAlbumArt, with no luck.
Am i missing something obvious, or is there no way to clear the artwork?
Nice job !
This part adds airtunes detection via crude Bonjour discovery on any platform
/**
* Crude Bonjour discovery service implementation
* Allow detection of airplay devices
*
* Usage :
var airports = [];
var bonjour = new Bonjour();
bonjour.on('error', function(err){console.log(err)});
bonjour.on('data', function(from, msg){
var res = {name:'', ip:'', mac:''};
var lines = msg.split("\n");
lines.forEach(function(line, i){
if (i==2) {
res.name = line.trim();
}
if (/info@model=AirPort/.test(line)){
var match = line.match(/waMA=([0-9A-F\-]+)/);
if (match && match.length > 0){
res.mac = match[1].split('-').join(':');
}
res.ip = from.address;
var found = airports.filter(function(airport){
return airport.mac === res.mac;
});
if (found.length < 1) airports.push(res);
}
});
console.log(JSON.stringify(airports));
});
bonjour.on('ready', function(){
bonjour.seek('_airport');
});
*/
var EventEmitter = require('events').EventEmitter
, sys = require('sys')
, dgram = require('dgram')
;
const MDNS_PORT = 5353;
const MDNS_HOST = '224.0.0.251';
var Bonjour = function(){
EventEmitter.call(this);
var self= this
, server = dgram.createSocket('udp4');
server.on('error', function(err) {self.emit('error', err)});
server.on('message', function(msg, from) {
var res = msg.toString('ascii')
, len=res.length
, str = []
;
// filter bad chars
for (var i=0; i<len; i++){
var code = res.charCodeAt(i);
if (code > 0x1f){
str.push(res[i]);
}
else {
if (code == 0x0c){
str.push("\n");
}
}
}
self.emit('data', from, str.join(''));
});
server.on('listening', function(err){
self.emit('ready');
});
server.bind(MDNS_PORT, '0.0.0.0', function(err){
server.addMembership(MDNS_HOST);
});
self.server = server;
return this;
}
sys.inherits(Bonjour, EventEmitter);
/**
* @param: service name string, the first part of _XXX(._tcp.local)
*/
Bonjour.prototype.seek = function(service){
var msg = [0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08]
, end = [0x04, // .
0x5f,0x74,0x63,0x70,0x05, // _tcp.
0x6c,0x6f,0x63,0x61,0x6c, // local
0x00,0x00,0x0c,0x00,0x01
]
, len = service.length
;
for (var i=0; i<len; i++){
msg.push(service.charCodeAt(i));
}
msg = msg.concat(end);
var buf = new Buffer(msg);
this.server.send(buf, 0, buf.length, MDNS_PORT, MDNS_HOST, function(err,msg){});
}
module.exports = Bonjour;
Hi I have a problem on my Raspberry with Raspbian Jessie, Node v0.10.9 and FFMPEG version 4.9.2-10. When I run play_ffmpeg I get
adding device: 192.168.0.14:5000
status: ready
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
One note: It did work flawlessly before I updated my FFMPEG from version 1.xx something up to 4.9. Seems like the ffmpeg update is somehow conflicting with your script. By debugging, I was able to track down the problem to be most likely the following line
// pipe data to AirTunes
ffmpeg.stdout.pipe(airtunes);
Thanks!
Not having much luck getting this to work with an airport express (model A1264). It gets as far as sending the RECORD request, but never gets a response back from the airport express.
Any thoughts on where to debug this further?
Thanks
Hey everyone,
great code - but how do I add different speaker / devices?
Thanks and cheers
in devices.js:Devices.prototype.stopAll, the async.forEach never calls the stop method on the device object.
This seems to stem from devices.length being undefined.
I'm running a setup of three raspberry pi's with shairport and a central node.js serving the streams via airtunes.
I'm currently running into sync issues because i cannot get my clients to play the audio in sync. The lag between the clients is sometimes up to 2 seconds.
Do you have any clue what's the issue here?
Thanks,
sazz
Hi,
i tried to install airtunes via npm install airtunes
but i only get the following results:
pi@vinylpi:~/airtunes $ npm install airtunes
> [email protected] install /home/pi/airtunes/node_modules/airtunes
> node-gyp rebuild
make: Entering directory '/home/pi/airtunes/node_modules/airtunes/build'
CXX(target) Release/obj.target/airtunes/src/codec.o
In file included from ../src/../alac/ALACEncoder.h:29:0,
from ../src/codec.cc:15:
../src/../alac/ALACAudioTypes.h:64:32: warning: multi-character character constant [-Wmultichar]
kALACFormatAppleLossless = 'alac',
^~~~~~
../src/../alac/ALACAudioTypes.h:65:28: warning: multi-character character constant [-Wmultichar]
kALACFormatLinearPCM = 'lpcm'
^~~~~~
../src/../alac/ALACAudioTypes.h:154:22: warning: multi-character character constant [-Wmultichar]
kALACCodecFormat = 'alac',
^~~~~~
../src/../alac/ALACAudioTypes.h:182:26: warning: multi-character character constant [-Wmultichar]
AudioChannelLayoutAID = 'chan'
^~~~~~
../src/codec.cc: In function 'void nodeairtunes::encoder_weak_callback(v8::Persistent<v8::Value>, void*)':
../src/codec.cc:59:15: error: 'v8::HandleScope::HandleScope()' is protected within this context
HandleScope scope;
^~~~~
In file included from /home/pi/.node-gyp/8.9.4/include/node/node.h:63:0,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:874:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/codec.cc:62:11: error: 'class v8::Persistent<v8::Value>' has no member named 'Dispose'
wrapper.Dispose();
^~~~~~~
../src/codec.cc: At global scope:
../src/codec.cc:67:32: error: 'Arguments' does not name a type
Handle<Value> NewEncoder(const Arguments& args) {
^~~~~~~~~
../src/codec.cc: In function 'v8::Handle<v8::Value> nodeairtunes::NewEncoder(const int&)':
../src/codec.cc:68:15: error: 'v8::HandleScope::HandleScope()' is protected within this context
HandleScope scope;
^~~~~
In file included from /home/pi/.node-gyp/8.9.4/include/node/node.h:63:0,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:874:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/codec.cc:78:97: warning: 'static v8::Local<v8::ObjectTemplate> v8::ObjectTemplate::New()' is deprecated: Use isolate version [-Wdeprecated-declarations]
Persistent<ObjectTemplate> encoderClass = Persistent<ObjectTemplate>::New(ObjectTemplate::New());
^
In file included from /home/pi/.node-gyp/8.9.4/include/node/v8.h:26:0,
from /home/pi/.node-gyp/8.9.4/include/node/node.h:63,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:5656:69: note: declared here
static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New());
^
/home/pi/.node-gyp/8.9.4/include/node/v8config.h:318:3: note: in definition of macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
../src/codec.cc:78:98: error: no matching function for call to 'v8::Persistent<v8::ObjectTemplate>::New(v8::Local<v8::ObjectTemplate>)'
Persistent<ObjectTemplate> encoderClass = Persistent<ObjectTemplate>::New(ObjectTemplate::New());
^
In file included from /home/pi/.node-gyp/8.9.4/include/node/node.h:63:0,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:9114:4: note: candidate: static T* v8::PersistentBase<T>::New(v8::Isolate*, T*) [with T = v8::ObjectTemplate]
T* PersistentBase<T>::New(Isolate* isolate, T* that) {
^~~~~~~~~~~~~~~~~
/home/pi/.node-gyp/8.9.4/include/node/v8.h:9114:4: note: candidate expects 2 arguments, 1 provided
../src/codec.cc:79:15: error: base operand of '->' has non-pointer type 'v8::Persistent<v8::ObjectTemplate>'
encoderClass->SetInternalFieldCount(1);
^~
../src/codec.cc:80:62: error: base operand of '->' has non-pointer type 'v8::Persistent<v8::ObjectTemplate>'
Persistent<Object> o = Persistent<Object>::New(encoderClass->NewInstance());
^~
../src/codec.cc:81:4: error: base operand of '->' has non-pointer type 'v8::Persistent<v8::Object>'
o->SetPointerInInternalField(0, encoder);
^~
../src/codec.cc:82:5: error: 'class v8::Persistent<v8::Object>' has no member named 'MakeWeak'; did you mean 'SetWeak'?
o.MakeWeak(encoder, encoder_weak_callback);
^~~~~~~~
../src/codec.cc:84:16: error: 'class v8::HandleScope' has no member named 'Close'
return scope.Close(o);
^~~~~
../src/codec.cc: At global scope:
../src/codec.cc:87:32: error: 'Arguments' does not name a type
Handle<Value> EncodeALAC(const Arguments& args) {
^~~~~~~~~
../src/codec.cc: In function 'v8::Handle<v8::Value> nodeairtunes::EncodeALAC(const int&)':
../src/codec.cc:88:15: error: 'v8::HandleScope::HandleScope()' is protected within this context
HandleScope scope;
^~~~~
In file included from /home/pi/.node-gyp/8.9.4/include/node/node.h:63:0,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:874:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/codec.cc:90:11: error: request for member 'Length' in 'args', which is of non-class type 'const int'
if(args.Length() < 4) {
^~~~~~
../src/codec.cc:92:18: error: 'class v8::HandleScope' has no member named 'Close'
return scope.Close(Null());
^~~~~
../src/codec.cc:92:29: error: too few arguments to function 'v8::Local<v8::Primitive> v8::Null(v8::Isolate*)'
return scope.Close(Null());
^
In file included from /home/pi/.node-gyp/8.9.4/include/node/node.h:63:0,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:313:27: note: declared here
friend Local<Primitive> Null(Isolate* isolate);
^~~~
../src/codec.cc:95:32: error: invalid types 'const int[int]' for array subscript
Local<Object>wrapper = args[0]->ToObject();
^
../src/codec.cc:96:49: error: 'class v8::Object' has no member named 'GetPointerFromInternalField'; did you mean 'GetAlignedPointerFromInternalField'?
ALACEncoder *encoder = (ALACEncoder*)wrapper->GetPointerFromInternalField(0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/codec.cc:98:34: error: invalid types 'const int[int]' for array subscript
Local<Value> pcmBuffer = args[1];
^
../src/codec.cc:101:35: error: invalid types 'const int[int]' for array subscript
Local<Value> alacBuffer = args[2];
^
../src/codec.cc:104:27: error: invalid types 'const int[int]' for array subscript
int32_t pcmSize = args[3]->Int32Value();
^
../src/codec.cc:113:16: error: 'class v8::HandleScope' has no member named 'Close'
return scope.Close(Integer::New(alacSize));
^~~~~
../src/codec.cc:113:43: error: no matching function for call to 'v8::Integer::New(int32_t&)'
return scope.Close(Integer::New(alacSize));
^
In file included from /home/pi/.node-gyp/8.9.4/include/node/node.h:63:0,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:2914:25: note: candidate: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
static Local<Integer> New(Isolate* isolate, int32_t value);
^~~
/home/pi/.node-gyp/8.9.4/include/node/v8.h:2914:25: note: candidate expects 2 arguments, 1 provided
../src/codec.cc: At global scope:
../src/codec.cc:116:32: error: 'Arguments' does not name a type
Handle<Value> EncryptAES(const Arguments& args) {
^~~~~~~~~
../src/codec.cc: In function 'v8::Handle<v8::Value> nodeairtunes::EncryptAES(const int&)':
../src/codec.cc:117:15: error: 'v8::HandleScope::HandleScope()' is protected within this context
HandleScope scope;
^~~~~
In file included from /home/pi/.node-gyp/8.9.4/include/node/node.h:63:0,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:874:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/codec.cc:119:11: error: request for member 'Length' in 'args', which is of non-class type 'const int'
if(args.Length() < 2) {
^~~~~~
../src/codec.cc:121:18: error: 'class v8::HandleScope' has no member named 'Close'
return scope.Close(Null());
^~~~~
../src/codec.cc:121:29: error: too few arguments to function 'v8::Local<v8::Primitive> v8::Null(v8::Isolate*)'
return scope.Close(Null());
^
In file included from /home/pi/.node-gyp/8.9.4/include/node/node.h:63:0,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:313:27: note: declared here
friend Local<Primitive> Null(Isolate* isolate);
^~~~
../src/codec.cc:124:35: error: invalid types 'const int[int]' for array subscript
Local<Value> alacBuffer = args[0];
^
../src/codec.cc:126:28: error: invalid types 'const int[int]' for array subscript
int32_t alacSize = args[1]->Int32Value();
^
../src/codec.cc:149:16: error: 'class v8::HandleScope' has no member named 'Close'
return scope.Close(Null());
^~~~~
../src/codec.cc:149:27: error: too few arguments to function 'v8::Local<v8::Primitive> v8::Null(v8::Isolate*)'
return scope.Close(Null());
^
In file included from /home/pi/.node-gyp/8.9.4/include/node/node.h:63:0,
from ../src/codec.cc:1:
/home/pi/.node-gyp/8.9.4/include/node/v8.h:313:27: note: declared here
friend Local<Primitive> Null(Isolate* isolate);
^~~~
../src/codec.cc: In function 'void nodeairtunes::InitCodec(v8::Handle<v8::Object>)':
../src/codec.cc:153:51: error: invalid conversion from 'v8::Handle<v8::Value> (*)(const int&) {aka v8::Local<v8::Value> (*)(const int&)}' to 'v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}' [-fpermissive]
NODE_SET_METHOD(target, "encodeALAC", EncodeALAC);
^
In file included from ../src/codec.cc:1:0:
/home/pi/.node-gyp/8.9.4/include/node/node.h:287:13: note: initializing argument 3 of 'void node::NODE_SET_METHOD(v8::Local<v8::Object>, const char*, v8::FunctionCallback)'
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
^~~~~~~~~~~~~~~
../src/codec.cc:154:51: error: invalid conversion from 'v8::Handle<v8::Value> (*)(const int&) {aka v8::Local<v8::Value> (*)(const int&)}' to 'v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}' [-fpermissive]
NODE_SET_METHOD(target, "encryptAES", EncryptAES);
^
In file included from ../src/codec.cc:1:0:
/home/pi/.node-gyp/8.9.4/include/node/node.h:287:13: note: initializing argument 3 of 'void node::NODE_SET_METHOD(v8::Local<v8::Object>, const char*, v8::FunctionCallback)'
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
^~~~~~~~~~~~~~~
../src/codec.cc:155:51: error: invalid conversion from 'v8::Handle<v8::Value> (*)(const int&) {aka v8::Local<v8::Value> (*)(const int&)}' to 'v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}' [-fpermissive]
NODE_SET_METHOD(target, "newEncoder", NewEncoder);
^
In file included from ../src/codec.cc:1:0:
/home/pi/.node-gyp/8.9.4/include/node/node.h:287:13: note: initializing argument 3 of 'void node::NODE_SET_METHOD(v8::Local<v8::Object>, const char*, v8::FunctionCallback)'
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
^~~~~~~~~~~~~~~
airtunes.target.mk:101: recipe for target 'Release/obj.target/airtunes/src/codec.o' failed
make: *** [Release/obj.target/airtunes/src/codec.o] Error 1
make: Leaving directory '/home/pi/airtunes/node_modules/airtunes/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.9.78+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/airtunes/node_modules/airtunes
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/airtunes/package.json'
npm WARN airtunes No description
npm WARN airtunes No repository field.
npm WARN airtunes No README data
npm WARN airtunes No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2018-01-30T20_06_33_920Z-debug.log
I looked into the other issues but i found no solution to this problem!
Yours,
Felix
Hi there, I am running the iOS 9 beta on two different devices (iPhone 6 and iPad Mini 2) and neither device can see node_airtunes anymore. These same devices used to be able to see node_airtunes, but since upgrading they cannot. Another iOS device still on iOS 8, running on the same network has no problem finding node_airtunes, as does iTunes. It looks like something with auto discovery changed in iOS 9 that is preventing node_airtunes from showing up in the list of available AirPlay targets.
I am trying to use airtunes similar to the example using ffmpeg.
Everything works fine but as soon as I want to switch to another music file I am trying to stop ffmpeg using ffmpeg.kill() on the childProcess ass soon as the devices have stopped. I always get the following error as soon as I call ffmpeg.stdout.pipe airtunes on the new instance of ffmpeg:
Error: Cannot write in buffer after closing it
at CircularBuffer.write (../node_modules/airtunes/lib/circular_buffer.js:32:11)
at AirTunes.write (../node_modules/airtunes/lib/index.js:63:25)
How can I recreate the buffer properly after the devices have been stopped? Would i be possible to change the stream without stopping the devices?
I've been successful at connecting to both my Airport Express and Airfoil Speakers, but when I try to connect to my AppleTV2 I get error "Not Acceptable", which I presume is HTTP error code 406.
Hi,
I am trying to get PCM data from FFmpeg. I found your node_airtunes does the same thing. I was wondering if you can help me out with this:
I am running FFmpeg by -i audiofile -f f32be -ar 44100 -ac 1 pipe:1
. So basically I am trying to print the output of ffmpeg in "PCM 32-bit floating-point" format. Then I used the following code to get the data:
var blob = new Blob([stdout_data], {type: 'application/octet-binary'});
var reader = new FileReader();
reader.addEventListener("loadend", function() {
console.error(Float32Array(reader.result))
});
reader.readAsArrayBuffer(blob);
The output I get by running the code does not make sense. The values are not in [-1, 1] limit. I guess I am doing something wrong during the typed array conversion. Any idea what the problem could be?
looks like airtunes is not working with "non-apple" devices :(
I've got a Philips Fidelio Soundring and a Sony SA-NS310 - both Airplay Speakers, that work fine on my iPhone and with the "Whaale-App", but unfortunately they do not work with airtunes :( Only my two AppleTv devices work with airtunes like they should.
Are there any difference in the non-apple products codecs ? They are Apple certified, therefore I thought they should work and should be compliant to the "standard".
Hi,
thanks for this great project. I use the following command:
node play_ffmpeg.js --host 192.168.178.20 --port 5000 --file http://rb-bremenvier-live.cast.addradio.de/rb/bremenvier/live/mp3/128/stream.mp3
Then I receive this logs:
adding device: 192.168.178.20:5000
status: ready
buffer buffering
buffer playing
After a couples of mins I get:
status: stopped
Why is this happening? I am bit confused.
Hello,
Any chance the API of this could be tweaked to allow multiple instances of it to be run?
Currently you export a new instance of Airtunes
https://github.com/lperrin/node_airtunes/blob/master/lib/index.js#L72
If you left it for the end user to do this, it would allow the functionality.
Would you accept a pull request for this change?
Thanks!
These are the errors output but npm:
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 3.18.7-v7+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/node_modules/airtunes
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 3.18.7-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "airtunes"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the airtunes package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls airtunes
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/npm-debug.log
It seems to be an issue with Nodejs 0.12.0 as I've managed to install successfully with Nodejs 0.10.36
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?
After installing the airtunes , when i try to execute the examples i get this errors.. Does anybody know how to solve this or why these errors are occuring..
cat sample.pcm |node play_stdin.js --host 192.168.0.100
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '../build/Release/airtunes'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object. (/Users/karthikbudigere/nodetunes/node_modules/airtunes/lib/device_coreaudio.js:5:16)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
i compile node_airtunes in my RaspberryPI(ArmV5) under Debian 7.0. when i try to connect my airplay device with ./play_ffmpeg example. It's not working fine for me. the airplay device make some noise then stoped. any idea that make it working fine ?
Hi!
It looks like this most acts as a client to send stuff to existing Airplay speakers.
Any idea if it would be possible to do the other way around?
Create a speaker in node which would then receive data from airplay-ready players?
I get several errors when doing a build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Volumes/MacHDD2/Developmemt/Javascript/node_airtunes/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/admin/.node-gyp/4.2.6/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/admin/.node-gyp/4.2.6',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=node.lib',
gyp info spawn args '-Dmodule_root_dir=/Volumes/MacHDD2/Developmemt/Javascript/node_airtunes',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
2016-06-17 10:29:52.386 xcodebuild[13957:8044310] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/airtunes/src/codec.o
../src/codec.cc:59:15: error: calling a protected constructor of class 'v8::HandleScope'
HandleScope scope;
^
/Users/admin/.node-gyp/4.2.6/include/node/v8.h:885:13: note: declared protected here
V8_INLINE HandleScope() {}
^
../src/codec.cc:62:11: error: no member named 'Dispose' in 'v8::Persistent<v8::Value, v8::NonCopyablePersistentTraits<v8::Value> >'
wrapper.Dispose();
~~~~~~~ ^
../src/codec.cc:67:32: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle<Value> NewEncoder(const Arguments& args) {
^~~~~~~~~
v8::internal::Arguments
/Users/admin/.node-gyp/4.2.6/include/node/v8.h:139:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../src/codec.cc:68:15: error: calling a protected constructor of class 'v8::HandleScope'
HandleScope scope;
^
/Users/admin/.node-gyp/4.2.6/include/node/v8.h:885:13: note: declared protected here
V8_INLINE HandleScope() {}
^
../src/codec.cc:78:98: error: too few arguments to function call, expected 2, have 1
Persistent<ObjectTemplate> encoderClass = Persistent<ObjectTemplate>::New(ObjectTemplate::New());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/admin/.node-gyp/4.2.6/include/node/v8.h:639:3: note: 'New' declared here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
/Users/admin/.node-gyp/4.2.6/include/node/v8config.h:301:20: note: expanded from macro 'V8_INLINE'
# define V8_INLINE inline __attribute__((always_inline))
^
../src/codec.cc:78:73: error: 'New' is a private member of 'v8::PersistentBase<v8::ObjectTemplate>'
Persistent<ObjectTemplate> encoderClass = Persistent<ObjectTemplate>::New(ObjectTemplate::New());
^
/Users/admin/.node-gyp/4.2.6/include/node/v8.h:639:23: note: declared private here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
../src/codec.cc:79:15: error: member reference type 'Persistent<v8::ObjectTemplate>' is not a pointer; did you mean to use '.'?
encoderClass->SetInternalFieldCount(1);
~~~~~~~~~~~~^~
.
../src/codec.cc:79:17: error: no member named 'SetInternalFieldCount' in 'v8::Persistent<v8::ObjectTemplate, v8::NonCopyablePersistentTraits<v8::ObjectTemplate> >'
encoderClass->SetInternalFieldCount(1);
~~~~~~~~~~~~ ^
../src/codec.cc:80:62: error: member reference type 'Persistent<v8::ObjectTemplate>' is not a pointer; did you mean to use '.'?
Persistent<Object> o = Persistent<Object>::New(encoderClass->NewInstance());
~~~~~~~~~~~~^~
.
../src/codec.cc:80:64: error: no member named 'NewInstance' in 'v8::Persistent<v8::ObjectTemplate, v8::NonCopyablePersistentTraits<v8::ObjectTemplate> >'
Persistent<Object> o = Persistent<Object>::New(encoderClass->NewInstance());
~~~~~~~~~~~~ ^
../src/codec.cc:80:46: error: 'New' is a private member of 'v8::PersistentBase<v8::Object>'
Persistent<Object> o = Persistent<Object>::New(encoderClass->NewInstance());
^
/Users/admin/.node-gyp/4.2.6/include/node/v8.h:639:23: note: declared private here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
../src/codec.cc:81:4: error: member reference type 'Persistent<v8::Object>' is not a pointer; did you mean to use '.'?
o->SetPointerInInternalField(0, encoder);
~^~
.
../src/codec.cc:81:6: error: no member named 'SetPointerInInternalField' in 'v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
o->SetPointerInInternalField(0, encoder);
~ ^
../src/codec.cc:82:5: error: no member named 'MakeWeak' in 'v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
o.MakeWeak(encoder, encoder_weak_callback);
~ ^
../src/codec.cc:84:16: error: no member named 'Close' in 'v8::HandleScope'
return scope.Close(o);
~~~~~ ^
../src/codec.cc:87:32: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle<Value> EncodeALAC(const Arguments& args) {
^~~~~~~~~
v8::internal::Arguments
/Users/admin/.node-gyp/4.2.6/include/node/v8.h:139:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../src/codec.cc:88:15: error: calling a protected constructor of class 'v8::HandleScope'
HandleScope scope;
^
/Users/admin/.node-gyp/4.2.6/include/node/v8.h:885:13: note: declared protected here
V8_INLINE HandleScope() {}
^
../src/codec.cc:90:10: error: member access into incomplete type 'const v8::internal::Arguments'
if(args.Length() < 4) {
^
/Users/admin/.node-gyp/4.2.6/include/node/v8.h:139:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
^
../src/codec.cc:92:18: error: no member named 'Close' in 'v8::HandleScope'
return scope.Close(Null());
~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/airtunes/src/codec.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "configure" "build"
gyp ERR! cwd /Volumes/MacHDD2/Developmemt/Javascript/node_airtunes
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
Hi, I'm interested in using the ALAC encoder/decoder bindings for a project I'm working on for AirTunes server support. (https://github.com/stephen/nodetunes/).
Would you be able to put your ALAC bindings into a separate npm module available for use?
Hi,
I have installed airtunes.
I have this problem.
Could you help me please ?
[root@DiskStation:/opt/node/lib/node_modules/airtunes/examples]$ node scan_airtunes.js
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'platform'
at Object. (/opt/node/lib/node_modules/airtunes/examples/scan_airtunes.js:5:7)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at Array. (module.js:421:10)
at EventEmitter._tickCallback (node.js:126:26)
Thanks & Regards,
Guismo
Hi,
I am having success with airtunes on my linux machine, but when I run on raspberry pi
var airtunes = require('airtunes');
var device = airtunes.add('192.168.0.105');
it throws exception
dgram.js:265
throw new RangeError('Port should be > 0 and < 65536');
^
RangeError: Port should be > 0 and < 65536
at Socket.send (dgram.js:265:11)
at UDPServers.sendControlSync (/home/pi/air/node_modules/airtunes/lib/udp_servers.js:174:23)
at AirTunesDevice.onSyncNeeded (/home/pi/air/node_modules/airtunes/lib/device_airtunes.js:92:14)
at /home/pi/air/node_modules/airtunes/lib/devices.js:25:13
at Devices.forEach (/home/pi/air/node_modules/airtunes/lib/devices.js:35:5)
at AudioOut.<anonymous> (/home/pi/air/node_modules/airtunes/lib/devices.js:23:10)
at AudioOut.EventEmitter.emit (events.js:95:17)
at sendPacket (/home/pi/air/node_modules/airtunes/lib/audio_out.js:36:12)
at syncAudio [as _onTimeout] (/home/pi/air/node_modules/airtunes/lib/audio_out.js:57:7)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
Apparently the command UDPServers.sendControlSync is executed before controlPort is set on the device.
Any ideas what could be wrong?
Guntis
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.