Open iQuickDev opened 1 year ago
Hi, I have the same problem, do you have find the solution ?
Hi, I have the same problem, do you have find the solution ?
yes, there is a package called speaker-arm64 on npm. Try that one instead
I have the same problem :'(
root@DietPi:/mnt/dietpi_userdata/node-red# npm install speaker-arm64
npm ERR! code 7
npm ERR! path /mnt/dietpi_userdata/node-red/node_modules/speaker-arm64
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 node-gyp@9.4.0
npm ERR! gyp info using node@12.13.0 | linux | arm64
npm ERR! gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
npm ERR! gyp ERR! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack /mnt/dietpi_userdata/node-red/node_modules/minipass-fetch/node_modules/minipass
/dist/commonjs/index.js:286
npm ERR! gyp ERR! stack this.emit('abort', this[SIGNAL]?.reason);
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack SyntaxError: Unexpected token '.'
npm ERR! gyp ERR! stack at Module._compile (internal/modules/cjs/loader.js:892:18)
npm ERR! gyp ERR! stack at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
npm ERR! gyp ERR! stack at Module.load (internal/modules/cjs/loader.js:812:32)
npm ERR! gyp ERR! stack at Function.Module._load (internal/modules/cjs/loader.js:724:14)
npm ERR! gyp ERR! stack at Module.require (internal/modules/cjs/loader.js:849:19)
npm ERR! gyp ERR! stack at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! gyp ERR! stack at Object.<anonymous> (/mnt/dietpi_userdata/node-red/node_modules/minipass-fetch/lib
/index.js:6:22)
npm ERR! gyp ERR! stack at Module._compile (internal/modules/cjs/loader.js:956:30)
npm ERR! gyp ERR! stack at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
npm ERR! gyp ERR! stack at Module.load (internal/modules/cjs/loader.js:812:32)
npm ERR! gyp ERR! System Linux 6.1.21-v8+
npm ERR! gyp ERR! command "/mnt/dietpi_userdata/node-red/node_modules/node/bin/node" "/mnt/dietpi_userdata/node
-red/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /mnt/dietpi_userdata/node-red/node_modules/speaker-arm64
npm ERR! gyp ERR! node -v v12.13.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
`npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-10-25T10_39_08_876Z-debug-0.log`
Same problem, @galaxieof did you find any solution?
Fix from @iQuickDev worked for me.
Running on Raspberry Pi 3B+ with 2023-12-05 Raspberry Pi OS 64 Bit Lite (Bullseye Lite 64 bit).
I did the following:
`sudo apt-get install libasound2-dev
npm install speaker-arm64
Then in my nodejs program: const Speaker = require("speaker-arm64") ` Testing with AWS Polly worked OK.
Thanks for the speaker-arm64 suggestion, worked great with @flat/lame to play mp3s on the raspberry pi 4.
Minimal Code
var fs = require('fs');
var lame = require('@flat/lame');
var Speaker = require('speaker-arm64');
fs.createReadStream(process.argv[2])
.pipe(new lame.Decoder())
.on('format', function (format) {
this.pipe(new Speaker(format));
});
the problem seems to be the following:
i don't know how to fix it but at least i think i found the issue