我正在使用QPython,我想知道是否有办法从我手机的麦克风录制声音。我无法在Qpython中安装speech_recognition或PyAudio,也找不到任何教程。任何帮助都很感激,伙计们:D
发布于 2017-07-26 21:42:04
这是个老掉牙的问题,但我还是给其他搜索信息的人回答吧。
要使用qpython访问您的手机的功能,您必须首先导入androidhelper()并创建一个对象来表示您的手机。
一旦完成,您就可以访问多个函数,比如您要寻找的函数(recorderStartMicrophone和recorderStop)。
有一个简单的脚本显示了如何使用它:
import androidhelper
droid = androidhelper.Android()
droid.recorderStartMicrophone("Path/To/Where/You/Want/To/Save/The/Audio")
#Do what you want. It might be a timer or another function.
droid.recorderStop()有一个包含在androidhelper中的功能的完整列表:http://kylelk.github.io/html-examples/androidhelper.html
https://stackoverflow.com/questions/42958488
复制相似问题