Creating audio drivers in R?

I am 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)) 

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

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

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

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

+8
r audio driver
source share
3 answers

Try

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

to find out if you have audio drivers. If you don't or don’t hear anything, maybe set.audio.driver(name) or load.audio.driver(path) might help.

This page contains recommendations for Linux users, but says that it works for Windows and OS X.

+2
source share

On Linux, you just need to install Portaudio first. Download it, remove it, and then follow the installation instructions . After that, you need to reinstall the sound package (you need to recompile it to see the new drivers) by simply typing install.packages('audio') again under R.

0
source share

On ubuntu, you can get 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 an audio package.

0
source share

All Articles