Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Audio Data IO using Numpy/Scipy and PulseAudio

I've done a little digging and most of the python interfaces to PulseAudio seem to deal with sound server control, not audio data. I want to get data from numpy arrays out to speakers via PulseAudio and get sound from mic inputs into numpy arrays the same way. Any suggestions as to how to approach this?

like image 496
justinzane Avatar asked Oct 22 '22 23:10

justinzane


1 Answers

python-pulseaudio uses ctypes and appears to have everything you need. You'll have to take care with the types of the numpy arrays and use their buffer interfaces but it should be doable.

I think you might be happier using ALSA as a layer above pulseaudio; most apps appear to work that way. PyAlsaAudio appears to have what you need there.

like image 137
GaryBishop Avatar answered Oct 29 '22 23:10

GaryBishop