Giter Site home page Giter Site logo

node-red-contrib-speakerpi's People

Contributors

o-hahn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

node-red-contrib-speakerpi's Issues

Problem after changing to Stream.

2 Dec 21:32:03 - [info] Node-RED version: v0.17.5
2 Dec 21:32:03 - [info] Node.js version: v7.10.1
2 Dec 21:32:03 - [info] Linux 4.9.59-v7+ arm LE
2 Dec 21:32:05 - [info] Loading palette nodes
2 Dec 21:32:16 - [info] Settings file : /root/.node-red/settings.js
2 Dec 21:32:16 - [info] User directory : /root/.node-red
2 Dec 21:32:16 - [info] Flows file : /root/.node-red/flows_Rosa.json
2 Dec 21:32:16 - [info] Server now running at http://127.0.0.1:1880/
2 Dec 21:32:16 - [info] Starting flows
2 Dec 21:32:17 - [info] Started flows
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
[../deps/mpg123/src/output/alsa.c:165] error: cannot open device default
node-red: pcm_params.c:2290: snd_pcm_hw_refine: Assertion `pcm && params' failed.
/usr/bin/node-red-start: line 87: 3102 Aborted node-red-pi
root@Rosa:~/.node-red/node_modules#

cant install on node red 3 node js 16

have installed libasound2-dev latest version
this is what i get trying to npm install in the .node-red directory

`3 May 12:17:04 - [info] Node-RED version: v3.0.2
3 May 12:17:04 - [info] Node.js version: v16.20.0
3 May 12:17:04 - [info] Linux 6.1.21-v8+ arm64 LE

pi@raspberrypi:~/.node-red $ npm install node-red-contrib-speakerpi
npm ERR! code 1
npm ERR! path /home/pi/.node-red/node_modules/speaker
npm ERR! command failed
npm ERR! command sh -c -- node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm64
npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/pi/.node-red/node_modules/speaker/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/pi/.cache/node-gyp/16.20.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/home/pi/.cache/node-gyp/16.20.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/pi/.cache/node-gyp/16.20.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/pi/.node-red/node_modules/speaker',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: name 'mpg123_cpu' is not defined while evaluating condition 'mpg123_cpu=="arm_nofpu"' in deps/mpg123/mpg123.gyp while loading dependencies of binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:284:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Linux 6.1.21-v8+
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/pi/.node-red/node_modules/speaker
npm ERR! gyp ERR! node -v v16.20.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2023-05-03T05_07_23_895Z-debug-0.log
pi@raspberrypi:~/.node-red $
`

WAV stream not working but same file saved and file input works

Hi, many thanks for making this node available.

I'm running on a Rasp Pi 3 Jessie and sending text to Watson Speech to Text node. It returns a WAV stream as msg.speech.

If I stream that into Speakerpi then nothing is heard. On the other hand, if I save the file as a WAV file and then feed the file name (Given file) into Speakerpi then I hear the speech. This method gives a playback lag so I would like to get the stream function working.

I've tried the different combinations of bit depth and sample rate though I notice that Windows says the WAV file is 352kbps, but as I said Speakerpi plays the saved file OK. On the debug I noticed that msg.speech is split into 100s of segments.

Any ideas or anything I can do to give more info? Many thanks.

Alan
speech

PS I installed node-red-contrib-speaker and that played the speech OK but aborted Node-Red at the end. The documentation for that node states that Watson delivers 2 audio channels, 16-bit sampling resolution at 11,025 Hz sampling rate which are the default values in that node. Your node does not have 11,025 Hz. Is that the problem? If so, could it be added? But why does the same saved file work?

install node-red-contrib-speakerpi error

Regarding : node-red-contrib-speakerpi
I get errors when I try to install node-red-contrib-speakerpi.

When running command: "npm install node-red-contrib-speakerpi" I get the following message -

Error message:
gyp: name 'mpg123_cpu' is not defined while evaluating condition 'mpg123_cpu=="arm_nofpu"' in deps/mpg123/mpg123.gyp while loading dependencies of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
.....
..

(See link for full message and log file)
h @ttps://drive.google.com/drive/folders/1DFDc43DIVX07Mel_z_CYpD67paaFsWNo?usp=sharing

Hardware & Software used:
Raspberry Pi 4 + Running from External SSD
OS-release    Debian11 (Bullseye) 64Bit
Node-Red v2.2.6
node v14.19.1
Node.js v12.22.5
Linux V5.15
NPM 6.14.16
node-gyp (Looks like node-gyp is NOT installed)

I tried the following with no success-

  1. sudo npm install node-red-contrib-speakerpi
  2. sudo npm install -g --unsafe-perm node-red-contrib-speakerpi    

 Will appreciate any advice or help

Can't compile with Node 6.9.x because of serial port

Installation on Node 6.9.2 and npm 3.10.9 fails because of old Serial Port Dependency.
pi@demopi:~/.node-red $ npm install node-red-contrib-speakerpi

[email protected] install /home/pi/.node-red/node_modules/serialport
node-pre-gyp install --fallback-to-build

make: Entering directory '/home/pi/.node-red/node_modules/serialport/build'
CXX(target) Release/obj.target/serialport/src/serialport.o
In file included from ../../nan/nan.h:182:0,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
../../nan/nan_maybe_43_inl.h: In function 'Nan::MaybeLocalv8::Object Nan::CloneElementAt(v8::Localv8::Array, uint32_t)':
../../nan/nan_maybe_43_inl.h:221:58: warning: 'v8::MaybeLocalv8::Object v8::Array::CloneElementAt(v8::Localv8::Context, uint32_t)' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:3031): Cloning is not supported. [-Wdeprecated-declarations]
return array->CloneElementAt(GetCurrentContext(), index);
^
In file included from ../../nan/nan_new.h:189:0,
from ../../nan/nan.h:188,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
../../nan/nan_implementation_12_inl.h: In static member function 'static Nan::imp::FactoryBasev8::BooleanObject::return_t Nan::imp::Factoryv8::BooleanObject::New(bool)':
../../nan/nan_implementation_12_inl.h:40:38: warning: 'static v8::Localv8::Value v8::BooleanObject::New(bool)' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:4007): Pass an isolate [-Wdeprecated-declarations]
return v8::BooleanObject::New(value).Asv8::BooleanObject();
^
In file included from ../src/serialport.h:5:0,
from ../src/serialport.cpp:3:
../../nan/nan.h: At global scope:
../../nan/nan.h:590:20: error: variable or field 'AddGCEpilogueCallback' declared void
v8::Isolate::GCEpilogueCallback callback
^
../../nan/nan.h:590:7: error: 'GCEpilogueCallback' is not a member of 'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback
^
../../nan/nan.h:591:18: error: expected primary-expression before 'gc_type_filter'
, v8::GCType gc_type_filter = v8::kGCTypeAll) {
^
../../nan/nan.h:596:20: error: variable or field 'RemoveGCEpilogueCallback' declared void
v8::Isolate::GCEpilogueCallback callback) {
^
../../nan/nan.h:596:7: error: 'GCEpilogueCallback' is not a member of 'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback) {
^
../../nan/nan.h:601:20: error: variable or field 'AddGCPrologueCallback' declared void
v8::Isolate::GCPrologueCallback callback
^
../../nan/nan.h:601:7: error: 'GCPrologueCallback' is not a member of 'v8::Isolate'
v8::Isolate::GCPrologueCallback callback
^
../../nan/nan.h:602:18: error: expected primary-expression before 'gc_type_filter'
, v8::GCType gc_type_filter = v8::kGCTypeAll) {
^
../../nan/nan.h:607:20: error: variable or field 'RemoveGCPrologueCallback' declared void
v8::Isolate::GCPrologueCallback callback) {
^
../../nan/nan.h:607:7: error: 'GCPrologueCallback' is not a member of 'v8::Isolate'
v8::Isolate::GCPrologueCallback callback) {
^
../../nan/nan.h: In function 'bool Nan::SetAccessor(v8::Localv8::Object, v8::Localv8::String, Nan::GetterCallback, Nan::SetterCallback, v8::Localv8::Value, v8::AccessControl, v8::PropertyAttribute)':
../../nan/nan.h:1933:16: warning: 'bool v8::Object::SetAccessor(v8::Localv8::Name, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Localv8::Value, v8::AccessControl, v8::PropertyAttribute)' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:2750): Use maybe version [-Wdeprecated-declarations]
, attribute);
^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)':
../src/serialport.cpp:115:116: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
baton->baudRate = Nan::Get(options, Nan::Newv8::String("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
../src/serialport.cpp:116:116: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
baton->dataBits = Nan::Get(options, Nan::Newv8::String("dataBits").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
../src/serialport.cpp:117:120: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
baton->bufferSize = Nan::Get(options, Nan::Newv8::String("bufferSize").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
../src/serialport.cpp:119:131: warning: 'v8::Localv8::Number v8::Value::ToNumber() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8166): Use maybe version [-Wdeprecated-declarations]
baton->stopBits = ToStopBitEnum(Nan::Get(options, Nan::Newv8::String("stopBits").ToLocalChecked()).ToLocalChecked()->ToNumber()->NumberValue());
^
../src/serialport.cpp: In function 'void EIO_AfterOpen(uv_work_t*)':
../src/serialport.cpp:159:31: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
int fd = argv[1]->ToInt32()->Int32Value();
^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)':
../src/serialport.cpp:180:29: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
../src/serialport.cpp:199:116: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
baton->baudRate = Nan::Get(options, Nan::Newv8::String("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
../src/serialport.cpp:200:116: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
baton->dataBits = Nan::Get(options, Nan::Newv8::String("dataBits").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
../src/serialport.cpp:201:120: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
baton->bufferSize = Nan::Get(options, Nan::Newv8::String("bufferSize").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
../src/serialport.cpp:203:131: warning: 'v8::Localv8::Number v8::Value::ToNumber() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8166): Use maybe version [-Wdeprecated-declarations]
baton->stopBits = ToStopBitEnum(Nan::Get(options, Nan::Newv8::String("stopBits").ToLocalChecked()).ToLocalChecked()->ToNumber()->NumberValue());
^
../src/serialport.cpp: In function 'void EIO_AfterUpdate(uv_work_t*)':
../src/serialport.cpp:242:31: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
int fd = argv[1]->ToInt32()->Int32Value();
^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Write(Nan::NAN_METHOD_ARGS_TYPE)':
../src/serialport.cpp:263:29: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)':
../src/serialport.cpp:374:29: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)':
../src/serialport.cpp:493:29: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)':
../src/serialport.cpp:542:29: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)':
../src/serialport.cpp:603:29: warning: 'v8::Localv8::Int32 v8::Value::ToInt32() const' is deprecated (declared at /home/pi/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
serialport.target.mk:94: recipe for target 'Release/obj.target/serialport/src/serialport.o' failed
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
make: Leaving directory '/home/pi/.node-red/node_modules/serialport/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/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:215:12)
gyp ERR! System Linux 4.4.38-v7+
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/.node-red/node_modules/serialport/build/Release/node-v48-linux-arm/serialport.node" "--module_name=serialport" "--module_path=/home/pi/.node-red/node_modules/serialport/build/Release/node-v48-linux-arm"
gyp ERR! cwd /home/pi/.node-red/node_modules/serialport
gyp ERR! node -v v6.9.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/.node-red/node_modules/serialport/build/Release/node-v48-linux-arm/serialport.node --module_name=serialport --module_path=/home/pi/.node-red/node_modules/serialport/build/Release/node-v48-linux-arm' (1)
node-pre-gyp ERR! stack at ChildProcess. (/home/pi/.node-red/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 4.4.38-v7+
node-pre-gyp ERR! command "/usr/bin/nodejs" "/home/pi/.node-red/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/.node-red/node_modules/serialport
node-pre-gyp ERR! node -v v6.9.2
node-pre-gyp ERR! node-pre-gyp -v v0.6.18
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/.node-red/node_modules/serialport/build/Release/node-v48-linux-arm/serialport.node --module_name=serialport --module_path=/home/pi/.node-red/node_modules/serialport/build/Release/node-v48-linux-arm' (1)

fileopt is not defined

Hi!

I just tested this node with the Bluemix Watson Text to Speech Service. The sound is played, but the node-red app crashed after completion. It crashes on line 117 with the message ReferenceError: fileopt is not defined. Not sure if it should be optfile instead?

Regards,

Kjetil Aamodt

RFE - make logging an option

It would be nice to make the logging optional, say an option to turn on logging. This would reduce the volume of messages on the log and if you are using more than one instance of the node, you could turn logging on per instance to help with debugging (if you needed to)

Thanks for the node, I'm using it for a halloween skeleton to talk to my grandsons (5, 4, 3 and 2)

speakerpi throws an error and I can't find any solution online

I am using Raspberry Pi 4B 1GB RAM

  • Node-RED version: v1.1.0
  • Node.js version: v12.18.2
  • Linux 5.4.47-v7l+ arm LE

I tried to play wav file, mp3 file and also raw audio buffer using Node RED but of no use, there is no sound.

I have tested the speakers and audio file using OMXplayer, that works, but speakerpi doesn't.

Here is the error -----------------------------------

Error: Package subpath './v4' is not defined by "exports" in /home/pi/.node-red/node_modules/uuid/package.json

This is my simple flow ----------------------------------

[{"id":"c0bf711f.1c725","type":"speakerpi-output","z":"1b409f87.00788","choose":"givenfile","filename":"/home/pi/music.wav","channels":"1","bitdepth":"16","samplerate":"22050","name":"","x":1610,"y":300,"wires":[[]]},{"id":"fcf87097.2f62","type":"inject","z":"1b409f87.00788","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1330,"y":300,"wires":[["c0bf711f.1c725"]]}]

Please help me out

Installation error on raspberry pi 3

I get an error when installing the node:

  • nodejs v18.2.0.
  • node red v2.2.2

`2022-05-30T18:43:06.940Z Installieren : node-red-contrib-speakerpi 0.0.43

2022-05-30T18:43:07.189Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2022-05-30T18:43:11.291Z [err] npm
2022-05-30T18:43:11.295Z [err]
2022-05-30T18:43:11.295Z [err] WARN config production Use --omit=dev instead.
2022-05-30T18:43:34.839Z [err] npm
2022-05-30T18:43:34.840Z [err] ERR! code 1
2022-05-30T18:43:34.841Z [err] npm
2022-05-30T18:43:34.843Z [err]
2022-05-30T18:43:34.844Z [err] ERR! path /mnt/dietpi_userdata/node-red/node_modules/speaker
2022-05-30T18:43:34.858Z [err] npm
2022-05-30T18:43:34.859Z [err] ERR! command failed
2022-05-30T18:43:34.859Z [err] npm ERR!
2022-05-30T18:43:34.859Z [err] command sh -c node-gyp rebuild
2022-05-30T18:43:34.860Z [err] npm ERR!
2022-05-30T18:43:34.861Z [err] make: Entering directory '/mnt/dietpi_userdata/node-red/node_modules/speaker/build'
2022-05-30T18:43:34.861Z [err] npm ERR! CC(target) Release/obj.target/output/deps/mpg123/src/output/alsa.o
2022-05-30T18:43:34.861Z [err] npm
2022-05-30T18:43:34.861Z [err] ERR! make: Leaving directory '/mnt/dietpi_userdata/node-red/node_modules/speaker/build'
2022-05-30T18:43:34.863Z [err] npm
2022-05-30T18:43:34.864Z [err] ERR! gyp info it worked if it ends with ok
2022-05-30T18:43:34.864Z [err] npm ERR!
2022-05-30T18:43:34.865Z [err] gyp info using [email protected]
2022-05-30T18:43:34.865Z [err] npm ERR! gyp info using [email protected] | linux | arm
2022-05-30T18:43:34.865Z [err] npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
2022-05-30T18:43:34.865Z [err] npm ERR!
2022-05-30T18:43:34.866Z [err] gyp info spawn /usr/bin/python3
2022-05-30T18:43:34.866Z [err] npm ERR! gyp info spawn args [
2022-05-30T18:43:34.866Z [err] npm
2022-05-30T18:43:34.866Z [err] ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2022-05-30T18:43:34.866Z [err] npm ERR!
2022-05-30T18:43:34.867Z [err] gyp info spawn args 'binding.gyp',
2022-05-30T18:43:34.867Z [err] npm ERR! gyp info spawn args '-f',
2022-05-30T18:43:34.867Z [err] npm ERR!
2022-05-30T18:43:34.867Z [err] gyp info spawn args 'make',
2022-05-30T18:43:34.867Z [err] npm ERR! gyp info spawn args '-I',
2022-05-30T18:43:34.867Z [err] npm
2022-05-30T18:43:34.867Z [err] ERR! gyp info spawn args '/mnt/dietpi_userdata/node-red/node_modules/speaker/build/config.gypi',
2022-05-30T18:43:34.867Z [err] npm ERR!
2022-05-30T18:43:34.868Z [err] gyp info spawn args '-I',
2022-05-30T18:43:34.868Z [err] npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2022-05-30T18:43:34.868Z [err] npm ERR! gyp info spawn args '-I',
2022-05-30T18:43:34.868Z [err] npm ERR!
2022-05-30T18:43:34.869Z [err] gyp info spawn args '/mnt/dietpi_userdata/node-red/.cache/node-gyp/18.2.0/include/node/common.gypi',
2022-05-30T18:43:34.869Z [err] npm ERR! gyp info spawn args '-Dlibrary=shared_library',
2022-05-30T18:43:34.869Z [err] npm
2022-05-30T18:43:34.869Z [err] ERR! gyp info spawn args '-Dvisibility=default',
2022-05-30T18:43:34.869Z [err] npm ERR!
2022-05-30T18:43:34.869Z [err] gyp info spawn args '-Dnode_root_dir=/mnt/dietpi_userdata/node-red/.cache/node-gyp/18.2.0',
2022-05-30T18:43:34.869Z [err] npm ERR!
2022-05-30T18:43:34.870Z [err] gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
2022-05-30T18:43:34.870Z [err] npm ERR! gyp info spawn args '-Dnode_lib_file=/mnt/dietpi_userdata/node-red/.cache/node-gyp/18.2.0/<(target_arch)/node.lib',
2022-05-30T18:43:34.870Z [err] npm
2022-05-30T18:43:34.870Z [err] ERR! gyp info spawn args '-Dmodule_root_dir=/mnt/dietpi_userdata/node-red/node_modules/speaker',
2022-05-30T18:43:34.870Z [err] npm ERR! gyp info spawn args '-Dnode_engine=v8',
2022-05-30T18:43:34.871Z [err] npm ERR! gyp info spawn args '--depth=.',
2022-05-30T18:43:34.871Z [err] npm
2022-05-30T18:43:34.871Z [err] ERR! gyp info spawn args '--no-parallel',
2022-05-30T18:43:34.871Z [err] npm ERR!
2022-05-30T18:43:34.871Z [err] gyp info spawn args '--generator-output',
2022-05-30T18:43:34.871Z [err] npm ERR! gyp info spawn args 'build',
2022-05-30T18:43:34.871Z [err] npm
2022-05-30T18:43:34.872Z [err] ERR! gyp info spawn args '-Goutput_dir=.'
2022-05-30T18:43:34.872Z [err] npm ERR!
2022-05-30T18:43:34.873Z [err] gyp info spawn args ]
2022-05-30T18:43:34.873Z [err] npm ERR! gyp info spawn make
2022-05-30T18:43:34.873Z [err] npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
2022-05-30T18:43:34.873Z [err] npm ERR! In file included from ../deps/mpg123/src/libmpg123/compat.h:22,
2022-05-30T18:43:34.873Z [err] npm
2022-05-30T18:43:34.873Z [err] ERR! from ../deps/mpg123/src/mpg123app.h:17,
2022-05-30T18:43:34.873Z [err] npm ERR!
2022-05-30T18:43:34.874Z [err] from ../deps/mpg123/src/output/alsa.c:10:
2022-05-30T18:43:34.874Z [err] npm ERR! /usr/include/stdlib.h:25:10: fatal error: bits/libc-header-start.h: No such file or directory
2022-05-30T18:43:34.874Z [err] npm
2022-05-30T18:43:34.874Z [err] ERR! #include <bits/libc-header-start.h>
2022-05-30T18:43:34.874Z [err] npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~~~
2022-05-30T18:43:34.874Z [err] npm
2022-05-30T18:43:34.875Z [err] ERR! compilation terminated.
2022-05-30T18:43:34.875Z [err] npm ERR!
2022-05-30T18:43:34.875Z [err] make: *** [deps/mpg123/output.target.mk:126: Release/obj.target/output/deps/mpg123/src/output/alsa.o] Error 1
2022-05-30T18:43:34.875Z [err] npm ERR! gyp ERR! build error
2022-05-30T18:43:34.875Z [err] npm ERR! gyp ERR! stack Error: make failed with exit code: 2
2022-05-30T18:43:34.875Z [err] npm
2022-05-30T18:43:34.876Z [err] ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2022-05-30T18:43:34.876Z [err] npm
2022-05-30T18:43:34.876Z [err] ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28)
2022-05-30T18:43:34.876Z [err] npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
2022-05-30T18:43:34.877Z [err] npm ERR! gyp ERR! System Linux 5.10.103-v7+
2022-05-30T18:43:34.877Z [err] npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2022-05-30T18:43:34.877Z [err] npm
2022-05-30T18:43:34.877Z [err] ERR! gyp ERR! cwd /mnt/dietpi_userdata/node-red/node_modules/speaker
2022-05-30T18:43:34.877Z [err] npm
2022-05-30T18:43:34.877Z [err] ERR! gyp ERR! node -v v18.2.0
2022-05-30T18:43:34.877Z [err] npm ERR!
2022-05-30T18:43:34.878Z [err] gyp ERR! node-gyp -v v9.0.0
2022-05-30T18:43:34.878Z [err] npm ERR!
2022-05-30T18:43:34.878Z [err] gyp ERR! not ok
2022-05-30T18:43:34.904Z [err]
2022-05-30T18:43:34.904Z [err] npm ERR! A complete log of this run can be found in:
2022-05-30T18:43:34.904Z [err] npm ERR! /mnt/dietpi_userdata/node-red/.npm/_logs/2022-05-30T18_43_11_083Z-debug-0.log
2022-05-30T18:43:34.945Z rc=1`

Any possible solution?

Feature request: Stop playback

It would be nice to have the possibility of stopping the output after having started it. Especially when working with long files. And an option to prevent the same node playing multiple times at the same time. E.g. with a checkbox.

README nit - code should be on two lines

The following causes an error if a copy/paste is done so this:should be on two lines

Additionally you have to install on the Raspberry Pi
sudo apt-get update sudo apt-get install libasound2-dev
should be this

Additionally you have to install on the Raspberry Pi
sudo apt-get update
sudo apt-get install libasound2-dev

Return a node status when done playing the audio - solution provided

It would be nice to return a node.status when finished playing so users could use the status node to continue processing after waiting for the audio to complete.

This could be done simply by adding:
node.status({text:"done"});
after the three lines calling speakOutputFile(...) lines 172, 181 and 191

This would allow a user to have a status node (pointing at this node) send the output msg to a switch node and check if msg.status.text == 'done' and then continue processing knowing the audio was done.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.