Shaggy Glitch
Shaggy Glitch

Reputation: 89

Permission Denied when trying to play audio- R

I'm trying to play a soundfile using seewave's listen option, and getting a permission denied error

library(seewave)
v.sound <-sin(2*pi*440 * seq(0,1,length.out = 8000))
f <- 8000
seewave::listen(v.sound, f= f)
sh: /var/folders/gg/5v7wvcts2jg4zm40s7r9fgqc0000gn/T//RtmpDWOqTa/tuneRtemp.wav: Permission denied

I get the same result using when using tuneR's play() function to read .wav files. I tried the suggestion here to and got the same results.

I'm using macOS High Sierra 10.13.6

Upvotes: 1

Views: 716

Answers (1)

Shaggy Glitch
Shaggy Glitch

Reputation: 89

So it turns out the packages 'sound' and 'tuneR' both use the setWavePlayer() function. I was able to solve this pretty easily with this quick fix

tuneR::setWavPlayer('/usr/bin/afplay')

Upvotes: 3

Related Questions