在 R 中提供音频驱动程序?
我正在尝试在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
获取 portaudio 标头
在 ubuntu 上,您可以使用“然后重新安装音频库” 。确保您看到
音频包编译期间。
On ubuntu, you can get the portaudio headers with
Then, reinstall the audio library. Make sure you see
During compilation of the audio package.
尝试
查看您是否有音频驱动程序。如果您没有,或者没有听到任何声音,也许
set.audio.driver(name)
或load.audio.driver(path)
可以提供帮助。此页面为 Linux 用户提供了一些建议,但说它有效适用于 Windows 和 OS X。
Try
to see if you have audio drivers. If you don't, or do not hear anything, perhaps
set.audio.driver(name)
orload.audio.driver(path)
could help.This page has some advice for Linux users, but says it works for Windows and OS X.
在 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.