Microphone access in Python

烈酒焚心 提交于 2019-11-29 01:30:52

问题


Can I access a users microphone in Python?

Sorry I forgot not everyone is a mind reader: Windows at minimum XP but Vista support would be VERY good.


回答1:


Best way to go about it would be to use the ctypes library and use WinMM from that. mixerOpen will open a microphone device and you can read the data easily from there. Should be very straightforward.




回答2:


I got the job done with pyaudio

It comes with a binary installer for windows and there's even an example on how to record through the microphone and save to a wave file. Nice! I used it on Windows XP, not sure how it will do on Vista though, sorry.




回答3:


You might try SWMixer.



来源:https://stackoverflow.com/questions/193789/microphone-access-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!