pyaudio throwing "shared memfd open() failed" error when initialized

2.5k Views Asked by At

I am using pyaudio but I got some error

import pyaudio
 p = pyaudio.PyAudio()

This is my error

shared memfd open() failed: Function not implemented
shared memfd open() failed: Function not implemented
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

shared memfd open() failed: Function not implemented
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

Any help please

1

There are 1 best solutions below

0
user1511417 On

You are using a headless linux-subsystem, which doesn't provide a connection to a PulseAudio server by default. (That's why you get this connection error.)

You have to setup a connection yourself (via tcp for example). This is discussed here and here.