Ruby Forum Ruby-Gnome 2 > play music on ruby gnome2??

Posted by Pat Kiatchaipipat (blitzer)
on 28.05.2008 05:46
How can I do this?? ruby gnome has fuction to play it??
Posted by Marc Heiler (shevegen)
on 29.05.2008 17:41
Pat Kiatchaipipat wrote:
> How can I do this?? ruby gnome has fuction to play it??

There are gstreamer bindings. I am not sure about their status, but IMO 
the biggest problem with gstreamer is that it is overdesigned for such 
simple tasks :D

By the way, I think there is no need to use '??'.
A simple '?' should suffice.
Posted by Philipp Götzinger (Guest)
on 29.05.2008 18:33
(Received via mailing list)
check samples on the trunk ...
and the tutorial ..

http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gst

pgoetzin@pgoetzin-nc6000:~/Desktop/ruby-gnome2/ruby-gnome2/tags/0.9.1/gstreamer/sample$
more mp3-player.rb

require 'gst'

def usage
    puts "Usage: #{__FILE__} mp3-file"
    exit
end

def main
    usage if ARGV.length != 1
    file = ARGV[0]

    # Create a pipeline to hold the elements
    pipeline = Gst::Pipeline.new("my_pipeline")

    # Create a disk reader
    filesrc = Gst::ElementFactory.make("filesrc", "my_disk_source")
    filesrc.location = file

    # Now it's time to get the MP3 decoder
    decoder = Gst::ElementFactory.make("mad", "my_decoder")

    # And an audio sink
    audiosink = Gst::ElementFactory.make("osssink", "my_audio_player")

    # Add objects to the main pipeline
    pipeline.add(filesrc, decoder, audiosink)

    # Link disk source => decoder => audio player
    filesrc >> decoder >> audiosink

    # Start playing
    puts "Playing #{file}..."
    pipeline.play

    begin
        # Wait until the file is played
        while pipeline.iterate do end
    rescue Interrupt
    ensure
        # Stop the pipeline
        pipeline.stop
    end
end

Gst.init
main

pgoetzin@pgoetzin-nc6000
:~/Desktop/ruby-gnome2/ruby-gnome2/tags/0.9.1/gstreamer/sample$





2008/5/29 Marc Heiler <ruby-forum-incoming@andreas-s.net>:
Posted by Pat Kiatchaipipat (blitzer)
on 31.05.2008 04:56
thank you I will try this :)
Posted by Pat Kiatchaipipat (blitzer)
on 31.05.2008 07:00
I have problem when install gstream it support window?
Posted by Shin guey Wong (sgwong)
on 31.05.2008 09:31
Pat Kiatchaipipat wrote:
> I have problem when install gstream it support window?

I just compile the latest trunk with gstream for windows. Fortunately, 
the latest trunk src able to play mp3. But I get some warning 
message...Although it shows the warning but I still able to listen to 
the music.

Here is the output:
C:\Devel\installer3\sandbox\ruby-gnome2-trunk-latest\trunk\gstreamer\sample>ruby 
audio-player.rb xy.mp3
OIL: ERROR liboilcpu.c 282: oil_cpu_i386_kernel_restrict_flags(): 
Operating system is not known to support SSE.  Assuming it does, which 
might cause problems
Posted by Shin guey Wong (sgwong)
on 31.05.2008 09:33
Shin guey Wong wrote:
> Pat Kiatchaipipat wrote:
>> I have problem when install gstream it support window?
> 
> I just compile the latest trunk with gstream for windows. Fortunately, 
> the latest trunk src able to play mp3. But I get some warning 
> message...Although it shows the warning but I still able to listen to 
> the music.
> 
> Here is the output:
> C:\Devel\installer3\sandbox\ruby-gnome2-trunk-latest\trunk\gstreamer\sample>ruby 
> audio-player.rb xy.mp3
> OIL: ERROR liboilcpu.c 282: oil_cpu_i386_kernel_restrict_flags(): 
> Operating system is not known to support SSE.  Assuming it does, which 
> might cause problems

the audio-player.rb hang after the song finish...I have to kill it in 
order to exit from the application....
Posted by Pat Kiatchaipipat (blitzer)
on 31.05.2008 12:47
Shin guey Wong wrote:
> Pat Kiatchaipipat wrote:
>> I have problem when install gstream it support window?
> 
> I just compile the latest trunk with gstream for windows. Fortunately, 
> the latest trunk src able to play mp3. But I get some warning 
> message...Although it shows the warning but I still able to listen to 
> the music.
> 
> Here is the output:
> C:\Devel\installer3\sandbox\ruby-gnome2-trunk-latest\trunk\gstreamer\sample>ruby 
> audio-player.rb xy.mp3
> OIL: ERROR liboilcpu.c 282: oil_cpu_i386_kernel_restrict_flags(): 
> Operating system is not known to support SSE.  Assuming it does, which 
> might cause problems

where can I download latest trunk with gstream for windows? I download 
ruby-gstreamer0.10-0.2.0.tar and when I click extconf.rb it has error 
:'(
Posted by Shin guey Wong (sgwong)
on 01.06.2008 17:20
Pat Kiatchaipipat wrote:
> where can I download latest trunk with gstream for windows? I download 
> ruby-gstreamer0.10-0.2.0.tar and when I click extconf.rb it has error 
> :'(

There is no binary package for the gstream yet. I compiled it myself 
using the mingw ruby. You have to download all the require dll urself 
and use mingw gcc to compile it. I only able to get the .lib file for 
gstream and has to use other tool to convert it into the gcc share 
library libxx.a file.

Regards,
Shin Guey
Posted by Marc Heiler (shevegen)
on 03.06.2008 16:03
> There is no binary package for the gstream yet. I compiled it myself 
> using the mingw ruby. You have to download all the require dll urself 
> and use mingw gcc to compile it. I only able to get the .lib file for 
> gstream and has to use other tool to convert it into the gcc share 
> library libxx.a file.
> 
> Regards,
> Shin Guey


Do you think this info is important for users, and is it missing on the 
wiki?

If so would you mind to do this again :)) or otherwise provide the info?
If I have the info I can put it onto the wiki, so that windows users at 
least
have the necessary information on the ruby-gtk wiki available