How can I do this?? ruby gnome has fuction to play it??
Pat K. 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
By the way, I think there is no need to use ‘??’.
A simple ‘?’ should suffice.
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 H. [email protected]:
I have problem when install gstream it support window?
thank you I will try this
Shin guey Wong wrote:
Pat K. 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…
Pat K. 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
Shin guey Wong wrote:
Pat K. 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
:’(
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
Pat K. 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