【问题标题】:Record sound with Qpython使用 Qpython 录制声音
【发布时间】:2017-03-22 17:16:17
【问题描述】:
我正在使用 QPython,我想知道是否有办法从我的手机麦克风录制声音。我无法在 Qpython 中安装 Speech_recognition 或 PyAudio,也找不到任何教程。任何帮助都表示感谢:D
【问题讨论】:
标签:
python
audio
microphone
qpython
【解决方案1】:
这是一个老问题,但我不妨为其他搜索信息的人回答它。
要使用 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