rasmusab / beepr

The package that sounds as it is called.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot play some files on OSX

romainfrancois opened this issue · comments

> beepr::beep( "http://www.wavsource.com/snds_2014-07-06_8028356563048763/sfx/ocean.wav" )
Message d'avis :
In value[[3L]](cond) :
  beep() could not play the sound due to the following error:
Error in load.wave(fname): incomplete file

Seems to be related to the audio package which does not think the file is fine.

I can get this to work

download.file( "http://www.wavsource.com/snds_2014-07-06_8028356563048763/sfx/ocean.wav", 
  "/tmp/ocean.wav" )
system( "open /tmp/ocean.wav" )

This uses iTunes which you can definitely assume is available. Otherwise we could use vlc, but it might not be on the PATH which is what nchar(Sys.which("vlc")) >= 1 cares about. Could do e.g. :

system( "open -a vlc /tmp/ocean.wav" )

Perhaps I should report the audio issue to @s-u

There is something strange with that wav file, vlc can play it but neither paplay or aplay can (which usually plays wav-files on Linux...):

> aplay /home/rasmus/Desktop/vykort/ocean.wav
aplay: test_wavefile:898: can't play WAVE-file format 0x0055 which is not PCM or FLOAT encoded
> paplay  /home/rasmus/Desktop/vykort/ocean.wav
Failed to open audio file.

I could probe for and always use vlc, but then I get a couple of seconds of lag when playing the sound (at least the first time) which is not that nice. Will have to think about this for a bit...

The following does work though:
beep("http://www.wavsource.com/snds_2014-07-06_8028356563048763/animals/cat_meow_x.wav")
?

It kind of works, but the sound is different. Here is what I hear:
https://soundcloud.com/romain-fran-ois-1/meow-through-beepr-audio
not quite a cat meow anymore.

AFAICT that is only using the WAV wrapper around a MP3 file - that is not supported by audio since it has no specialized decoders (like MP3, AAC, etc.) - it only handles pure (uncompressed) audio files.