download - Downloading sound files using urls in R -


i trying download sound files through r (mostly mp3). i've started off using download.file() below. however, sound files downloaded way sound horrible , it's if they're playing way fast. ideas?

download.file("http://www.mfiles.co.uk/mp3-downloads/frederic-chopin-piano-sonata-2-op35-3-funeral-march.mp3","test.mp3") 

even better if above function work, there way download files without having specify extension? have redirecting page.

thanks!

try explicitly setting binary mode mode="wb":

download.file("http://www.mfiles.co.uk/mp3-downloads/frederic-chopin-piano-sonata-2-op35-3-funeral-march.mp3",                tf <- tempfile(fileext = ".mp3"),                mode="wb") 

(you can view filename cat(tf).)


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -