From: kevid on 1 Jul 2010 13:01 hi, Thanks. I just tried the code you gave me but I can't play the output file (output.mp3) i can't figure out why
From: Joel VanderWerf on 1 Jul 2010 13:07 kevid wrote: > hi, > > Thanks. > > I just tried the code you gave me but I can't play the output file > (output.mp3) > > i can't figure out why > Make sure you open the file with "wb" instead of "w" to use binary mode?
From: kevid on 1 Jul 2010 13:23 require 'net/http' url = "http://stream.esvmedia.org/mp3-play/hw/19023001-19023006.mp3" res = Net::HTTP.get_response(URI.parse(url)) File.open('out.mp3','wb') do |f| f.print(res.body) end i tried the code above but did not get it work.
From: Josh Cheek on 1 Jul 2010 19:13 [Note: parts of this message were removed to make it a legal post.] On Thu, Jul 1, 2010 at 12:25 PM, kevid <alumsimportant(a)yahoo.ca> wrote: > require 'net/http' > url = "http://stream.esvmedia.org/mp3-play/hw/19023001-19023006.mp3" > res = Net::HTTP.get_response(URI.parse(url)) > File.open('out.mp3','wb') do |f| > f.print(res.body) > end > > > i tried the code above but did not get it work. > > require 'open-uri' File.open 'hannity_and_hitchens.mov' , 'wb' do |file| file.print open(' http://onegoodmovemedia.org/movies/0705/hannity_hitchens_300.mov').read end
From: kevid on 2 Jul 2010 11:29 Thanks bro, I worked perfectly.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Aliasing classes Next: drb problem? ringy-dingy won't answer... |