简体   繁体   English

使用Numpy / Scipy和PulseAudio的音频数据IO

[英]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. 我做了一点挖掘,PulseAudio的大多数python接口似乎都处理声音服务器控制,而不是音频数据。 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. 我希望通过PulseAudio将数据从numpy数组输出到扬声器,并以相同的方式从麦克风输入到numpy数组获取声音。 Any suggestions as to how to approach this? 关于如何处理这个问题的任何建议?

python-pulseaudio uses ctypes and appears to have everything you need. python-pulseaudio使用ctypes ,似乎拥有你需要的一切。 You'll have to take care with the types of the numpy arrays and use their buffer interfaces but it should be doable. 您必须注意numpy数组的类型并使用它们的缓冲区接口,但它应该是可行的。

I think you might be happier using ALSA as a layer above pulseaudio; 我想你可能会更乐意使用ALSA作为一个高于pulseaudio的层; most apps appear to work that way. 大多数应用似乎都是这样工作的。 PyAlsaAudio appears to have what you need there. PyAlsaAudio似乎有你需要的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM