使用 SL4A 在 Python 中获取声音振幅

发布于 2025-01-07 10:30:05 字数 112 浏览 3 评论 0原文

我想使用 SL4A 的 Python 编写的应用程序录制 1 秒的声音,然后找到声音的最大幅度。

是否有我可以使用的 SL4A API 的任何部分或可以使用的 Python API 的任何部分?

I want to record sound for 1 second using a Python written app for SL4A and then find the max amplitude of the sound.

Is there any part of the SL4A API I can use or part of the Python APIs that can be used?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱格式化 2025-01-14 10:30:05

您可以使用 MediaRecorderFacade

http://www.mithril.com.au/android 进行录制/doc/MediaRecorderFacade.html

你可以试试这个

droid.recorderStartMicrophone("/sdcard/myfile.wav")
sleep(1)
droid.recorderStop()

我希望有一个模块可以在python中对wave文件进行一些处理。

如果找到,就可以编译并安装。

这是一个执行此操作的文档:http://code.google.com /p/android-scripting/wiki/FAQ#Can_I_install_other_Python_modules

You can record using the MediaRecorderFacade

http://www.mithril.com.au/android/doc/MediaRecorderFacade.html

you can try this

droid.recorderStartMicrophone("/sdcard/myfile.wav")
sleep(1)
droid.recorderStop()

I hope there is a module to do some treatment on wave file in python.

If you find one you can compile and install.

Here is a doc to do it: http://code.google.com/p/android-scripting/wiki/FAQ#Can_I_install_other_Python_modules?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文