在 R 中提供音频驱动程序?

发布于 2024-11-25 20:59:35 字数 533 浏览 0 评论 0原文

我正在尝试在 R 中使用以下声音包: http://playitbyr.r-forge.r -project.org/gettingstarted.html

安装软件包及其依赖项后,当我尝试运行

sonify(iris, sonaes(time = Petal.Length, pitch = Petal.Width))

(根据页面上给出的示例)时,出现此错误:

Error in play.default(x, rate, ...) : no audio drivers are available

有人知道我应该做什么吗?我用谷歌搜索了一下,看起来也许我需要调用 set.audio.driver(name),但我不确定该将什么作为参数。

(以防万一,在 Mac OS X Snow Leopard 上。)

I'm trying to use the following sound package in R: http://playitbyr.r-forge.r-project.org/gettingstarted.html

After installing the package and its dependencies, when I try to run

sonify(iris, sonaes(time = Petal.Length, pitch = Petal.Width))

(per the example given on the page), I get this error:

Error in play.default(x, rate, ...) : no audio drivers are available

Anyone know what I should do? I googled around a bit, and it looks like maybe I need to call set.audio.driver(name), but I'm not sure what to put as an argument.

(In case it matters, on Mac OS X Snow Leopard.)

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

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

发布评论

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

评论(3

惟欲睡 2024-12-02 20:59:35

获取 portaudio 标头

sudo apt-get install portaudio19-dev

在 ubuntu 上,您可以使用“然后重新安装音频库” 。确保您看到

checking portaudio.h usability... yes
checking portaudio.h presence... yes

音频包编译期间。

On ubuntu, you can get the portaudio headers with

sudo apt-get install portaudio19-dev

Then, reinstall the audio library. Make sure you see

checking portaudio.h usability... yes
checking portaudio.h presence... yes

During compilation of the audio package.

梦里泪两行 2024-12-02 20:59:35

尝试

library(audio)
audio.drivers()
play(sin((1:10000)/5),10000)

查看您是否有音频驱动程序。如果您没有,或者没有听到任何声音,也许 set.audio.driver(name)load.audio.driver(path) 可以提供帮助。

此页面为 Linux 用户提供了一些建议,但说它有效适用于 Windows 和 OS X。

Try

library(audio)
audio.drivers()
play(sin((1:10000)/5),10000)

to see if you have audio drivers. If you don't, or do not hear anything, perhaps set.audio.driver(name) or load.audio.driver(path) could help.

This page has some advice for Linux users, but says it works for Windows and OS X.

微凉 2024-12-02 20:59:35

在 Linux 上,您只需先安装 Portaudio 即可。下载并解压,然后按照安装说明进行操作。之后,您需要重新安装音频包(需要重新编译才能看到新的驱动程序),只需在 R 下再次键入 install.packages('audio') 即可。

On Linux you simply need to install the Portaudio first. Download it, extract, and then follow the installation instructions. After that you need to reinstall the audio package (it needs to be recompiled to see new drivers) with simply typing install.packages('audio') again under R.

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