TooTallNate / node-speaker

Output PCM audio data to the speakers
655 stars 147 forks source link

Importing speaker results in: Aborted (core dumped) #126

Open ghost opened 5 years ago

ghost commented 5 years ago

Installed with npm and I'm getting this error. Installing libasound2-dev doesn't resolve the issue. Ubuntu 18.04

$ node -e "require('speaker')"
ALSA lib conf.c:3523:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so
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: pcm_params.c:2290: snd_pcm_hw_refine: Assertion `pcm && params' failed.
Aborted (core dumped)
yofreke commented 4 years ago

Similar issue here, if I require('speaker') with nothing else I get:

[../deps/mpg123/src/output/alsa.c:165] error: cannot open device default
node: pcm_params.c:2354: snd_pcm_hw_refine: Assertion `pcm && params' failed.

I configured a default alsa device, and heard audio using omxplayer. It seems generally bad that node-speaker is attempting to access the device at a module level. This should probably be moved to a constructor or other instance method.