Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
+ updated readme, Rakefile, preparing for 2.2.0
  • Loading branch information
niko committed Sep 5, 2010
1 parent 7783377 commit dff80c8
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 50 deletions.
63 changes: 33 additions & 30 deletions README.textile
@@ -1,56 +1,60 @@
h1. Ruby-Shout

h2. What is this?
h2. Purpose

This is the attempt make the ruby-shout library work for ruby 1.9. Any additions/bugfixes/improvements are highly welcome. Fork me!
ruby-shout lets you send compressed audio over the network to an Icecast streaming media server.

h2. Recent Changes
h2. Requirements

* Included the "ruby 1.9 patch":http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-ruby/ruby-shout/files/ruby-shout-2.1%2Bruby-1.9.patch?revision=1.1&view=markup although it seems to have "some issues":http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-ruby/ruby-shout/files/ruby-shout-2.1%2Bruby-1.9.patch?view=log. I hope to have fixed the issues with this:
* Replaced STR2CSTR for StringValuePtr as STR2CSTR doesn't work for 1.9 any more
* Added format = Shout::MP3 to the example as this is absolutely needed by the latest versions of libshout.
* Added an integration test which builds and installs the gem and plays some sound on a local icecast server. I mainly did that because the old version of ruby-shout didn't even compile for ruby 1.9.
libshout 2.0, available from icecast.org. libshout 2 requires the ogg and vorbis libraries.

h1. State
h2. Summary of usage

I tested this version of ruby-shout to build and run on
This extension follows python-shout fairly closely. You make a Shout object with Shout.new, set its properties, tell it to connect, then send blocks of data, sync and repeat. Disconnect when done.

* ruby-1.8.7-p174 [x86_64] OSX 10.6
* ruby-1.9.1-p378 [x86_64] OSX 10.6
* ruby-1.9.2-rc1 [x86_64] OSX 10.6
* ruby-1.8.7-p299 [i386] ubuntu 2.6.32
* ruby-1.9.2-rc2 [i386] ubuntu 2.6.32
h2. Usage

See example.rb. Run it like

Copyright (c) 2010 Niko Dittmann.
./example.rb test/test.mp3

Old Readme (this doesn't mean, you shouldn't read this, because you should):
h2. Todo

h2. Purpose
* proper unit tests (blush)

ruby-shout lets you send compressed audio over the network to an Icecast
streaming media server.
h2. History & Credits

h2. Requirements
* 2003 - 2005 Jared Jenning built and maintained ruby-shout
* Yauhen Kharuzhy helped with bugfixes and initial metadata support
* 2010 "Overlay" (real name unknown to me) patched ruby-shout for ruby 1.9 support, Diego Elio "Flameeyes" Pettenò "incorporated patch into the gentoo package":http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-ruby/ruby-shout/files/ruby-shout-2.1%2Bruby-1.9.patch?revision=1.1&view=markup. It got removed later on due to "some issues":http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-ruby/ruby-shout/files/ruby-shout-2.1%2Bruby-1.9.patch?view=markup.
* 2010 Niko Dittman re-added the patch and fixed the issues. See "Recent Changes" for details.

libshout 2.0, available from icecast.org. libshout 2 requires the ogg
and vorbis libraries.
h2. Recent Changes

h2. Summary of usage
* Included the "ruby 1.9 patch":http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-ruby/ruby-shout/files/ruby-shout-2.1%2Bruby-1.9.patch?revision=1.1&view=markup although it seems to have "some issues":http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-ruby/ruby-shout/files/ruby-shout-2.1%2Bruby-1.9.patch?view=log. I hope to have fixed the issues with this:
* Replaced STR2CSTR for StringValuePtr as STR2CSTR doesn't work for 1.9 any more
* Added format = Shout::MP3 to the example as this is absolutely needed by the latest versions of libshout.
* Added an integration test which builds and installs the gem and plays some sound on a local icecast server. I mainly did that because the old version of ruby-shout didn't even compile for ruby 1.9. Run with:

rake test:integration

This extension follows python-shout fairly closely. You make a Shout
object with Shout.new, set its properties, tell it to connect, then
send blocks of data, sync and repeat. Disconnect when done. There is
no #open that takes a block, as there is for a File or Socket: maybe later.
h2. State

h2. Contributors
I tested this version of ruby-shout to build and run on

* Yauhen Kharuzhy: bugfixes and initial metadata support
* ruby-1.8.7-p174 [x86_64] OSX 10.6
* ruby-1.9.1-p378 [x86_64] OSX 10.6
* ruby-1.9.2-rc1 [x86_64] OSX 10.6
* ruby-1.9.2-p0 [x86_64] OSX 10.6
* ruby-1.8.7-p299 [i386] ubuntu 2.6.32
* ruby-1.9.2-rc2 [i386] ubuntu 2.6.32

h2. License
This is a BSD license.

Copyright (c) 2003-2005, Jared Jennings
Copyright (c) 2010 Niko Dittmann

All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -77,4 +81,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

11 changes: 10 additions & 1 deletion Rakefile
@@ -1,6 +1,15 @@
require 'rubygems'
require 'rake/gempackagetask'

task :default => [:test]

namespace :test do
desc "run the build integration test"
task :integration do
ruby "test/integration-test.rb"
end
end

begin
require 'jeweler'
Jeweler::Tasks.new do |s|
Expand All @@ -16,5 +25,5 @@ begin

end
rescue LoadError
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
puts "Jeweler not available. Install it with: gem install jeweler"
end
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.1.0
2.2.0.pre1
35 changes: 20 additions & 15 deletions example.rb
@@ -1,7 +1,10 @@
#!/usr/bin/ruby
#!/usr/bin/env ruby

# Stream all the files given on the commandline to the Icecast server on
# localhost.
# Stream all the files given on the commandline to the Icecast server on localhost.
#
# Use the mp3 in the test directory:
#
# ./example.rb test/test.mp3

require 'rubygems'
require 'shout'
Expand All @@ -11,25 +14,27 @@
s = Shout.new
s.host = "localhost"
s.port = 8000
s.mount = "/example.ogg"
s.mount = "/example"
s.user = "source"
s.pass = "hackme"
s.format = Shout::MP3

s.connect

puts "open VLC and open network -> http://localhost:8000/example"

ARGV.each do |filename|
File.open(filename) do |file|
puts "sending data from #{filename}"
m = ShoutMetadata.new
m.add 'filename', filename
s.metadata = m

while data = file.read(BLOCKSIZE)
s.send data
s.sync
end
end
File.open(filename) do |file|
puts "sending data from #{filename}"
m = ShoutMetadata.new
m.add 'filename', filename
s.metadata = m

while data = file.read(BLOCKSIZE)
s.send data
s.sync
end
end
end

s.disconnect
6 changes: 3 additions & 3 deletions ruby-shout.gemspec
Expand Up @@ -5,11 +5,11 @@

Gem::Specification.new do |s|
s.name = %q{ruby-shout}
s.version = "2.1.0"
s.version = "2.2.0.pre1"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Jared Jennings", "Niko Dittmann"]
s.date = %q{2010-08-03}
s.date = %q{2010-09-05}
s.description = %q{Ruby bindings for libshout 2, a "Library which can be used to write a source client like ices" for Icecast (http://www.icecast.org/download.php).}
s.email = %q{mail@niko-dittmann.com}
s.extensions = ["ext/extconf.rb"]
Expand Down

0 comments on commit dff80c8

Please sign in to comment.