Laurent Sansonetti wrote:
> Hi,
>
> On 4/3/06, Stupergenius <stupergenius / gmail.com> wrote:
> > Also, the exact source I am using is:
> >
> > require 'gst'
> >
> > Gst.init
> > unless ARGV.length == 1
> >   $stderr.puts "Usage: #{__FILE__} <mp3 filename>"
> >   exit 1
> > end
> >
> > # create a new pipeline to hold the elements
> > pipeline = Gst::Pipeline.new
> >
> > # create a disk reader
> > filesrc = Gst::ElementFactory.make("filesrc")
> > filesrc.location = ARGV.last
> > puts "Using file "+ARGV.last
> >
> > # now it's time to get the decoder
> > decoder = Gst::ElementFactory.make("spider")
> >
> > # and an audio sink
> > audiosink = Gst::ElementFactory.make("alsasink")
> >
> > # add objects to the main pipeline
> > puts filesrc, decoder, audiosink, pipeline
> > pipeline.add(filesrc, decoder, audiosink)
> >
> > # link elements
> > filesrc >> decoder >> audiosink
> >
> > # start playing
> > pipeline.play
> >
> > while pipeline.iterate do end
> >
> > # stop the pipeline
> > pipeline.stop
> >
> > puts "all done"
> >
> >
> >
> > And I am calling it with:
> > ruby gst_test.rb glyn.mp3
> >
>
> What do you get if you use:
>
> $ gst-launch filesrc location=glyn.mp3 ! spider ! alsasink
>
> # syntax not tested :-)
>
> If nothing, then the problem is probably elsewhere.  I suspect you do
> not have a MP3 decoder library on your machine and/or I believe the
> spider just calls the mad plugin (which you do not have).
>
> Laurent

> If nothing, then the problem is probably elsewhere.  I suspect you do
> not have a MP3 decoder library on your machine and/or I believe the
> spider just calls the mad plugin (which you do not have).

Ahh, that seems to be the problem indeed, reading up on spider shows
that it does indeed determine which plugin to use based on the type of
the file.  Still, Ruby-GStreamer should throw an error as well like
gst-launch does.  Converting the mp3 to a wav produces sound perfectly.
 Now off to get more plugins!

Thanks!