Ruby classes for MP3 de-/encoding

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Ruby classes for MP3 de-/encoding

    Hello folks,

    does anyone know of any Ruby collection of classes / modules for
    decoding / encoding (maybe liblame bindings?) MP3 data?

    I already looked for that on raa, freshmeat & even google, but
    without any luck, so any help would be appreciated ...

    Kind regards,
    Dennis Oelkers


    Dennis Oelkers Guest

  2. Similar Questions and Discussions

    1. Encoding in ruby/tk internals
      Hello ruby-talk peoples, It seems that something is wrong in ruby/tk libraries: I'm trying to work with cp1251 encoding. Everything works fine,...
    2. Inheritence Diagram of Ruby classes...
      Hello All, Has anyone got, or know of a diagram that shows how the ruby classes are ordered in terms of inheritence? Thanks, Thomas Adam ...
    3. [ba-rb] BA-rb ( Bay Area Ruby Users Group ) - 'Generating Code in Ruby' by Jack Herrington.
      Count me in again, too. -- Jos Backus _/ _/_/_/ Sunnyvale, CA _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ jos at...
    4. [ANN] ruby-freedb, ruby-serialport, ruby-mp3info moved to Rubyforge
      http://ruby-freedb.rubyforge.org/ http://ruby-serialport.rubyforge.org/ http://ruby-mp3info.rubyforge.org/ bye! --...
    5. Ruby Character Encoding
      Hi, In message "Ruby Character Encoding" on 03/07/15, Mark Wilson <mwilson13@cox.net> writes: |I'm interested in any (i.e., arbitrary)...
  3. #2

    Default Re: Ruby classes for MP3 de-/encoding

    > does anyone know of any Ruby collection of classes / modules for
    > decoding / encoding (maybe liblame bindings?) MP3 data?
    >
    > I already looked for that on raa, freshmeat & even google, but
    > without any luck, so any help would be appreciated ...
    Might be something in RubyForge here:

    [url]http://rubyforge.org/softwaremap/trove_list.php?form_cat=123[/url]

    or here:

    [url]http://rubyforge.org/projects/ruby-mp3info/[/url]

    Yours,

    tom



    Tom Copeland Guest

  4. #3

    Default Re: Ruby classes for MP3 de-/encoding

    On Sat, 2003-11-22 at 13:07, Dennis Oelkers wrote:
    > Hello folks,
    >
    > does anyone know of any Ruby collection of classes / modules for
    > decoding / encoding (maybe liblame bindings?) MP3 data?
    >
    > I already looked for that on raa, freshmeat & even google, but
    > without any luck, so any help would be appreciated ...
    >
    > Kind regards,
    > Dennis Oelkers
    How about Ruby/GStreamer, rather than using an mp3 specific solution:

    [url]http://ruby-gnome2.sourceforge.jp/[/url]

    You can do metadata extraction with GStreamer as well, though the
    bundled bindings for libgstmediainfo can be slow in certain
    circumstances. I have the extraction code I've been working on up here
    though:

    [url]http://www.gothpoodle.com/~galt/info.rb[/url]

    This should allow you to read id3 or ogg tags at minimum, and i think
    wav riff headers though I haven't tested it on that yet.

    Matt



    Matthew Berg Guest

  5. #4

    Default Re: Ruby classes for MP3 de-/encoding

    On Sun, Nov 23, 2003 at 04:03:55AM +0900, Matthew Berg wrote:
    > You can do metadata extraction with GStreamer as well, though the
    > bundled bindings for libgstmediainfo can be slow in certain
    > circumstances. I have the extraction code I've been working on up here
    > though:
    >
    > [url]http://www.gothpoodle.com/~galt/info.rb[/url]
    >
    > This should allow you to read id3 or ogg tags at minimum, and i think
    > wav riff headers though I haven't tested it on that yet.
    Thanks for all your help, but it seems as if you misunderstood my question
    a bit. I'm not looking for classes to extract metadata information, I want
    to encode/decode MP3 data.

    Kind regards,
    Dennis Oelkers


    Dennis Oelkers Guest

  6. #5

    Default Re: Ruby classes for MP3 de-/encoding

    On Sat, 2003-11-22 at 14:15, Dennis Oelkers wrote:
    > On Sun, Nov 23, 2003 at 04:03:55AM +0900, Matthew Berg wrote:
    > > You can do metadata extraction with GStreamer as well, though the
    > > bundled bindings for libgstmediainfo can be slow in certain
    > > circumstances. I have the extraction code I've been working on up here
    > > though:
    > >
    > > [url]http://www.gothpoodle.com/~galt/info.rb[/url]
    > >
    > > This should allow you to read id3 or ogg tags at minimum, and i think
    > > wav riff headers though I haven't tested it on that yet.
    >
    > Thanks for all your help, but it seems as if you misunderstood my question
    > a bit. I'm not looking for classes to extract metadata information, I want
    > to encode/decode MP3 data.
    I think you misunderstood my answer. The metadata stuff was meant to be
    a "you can do this as well" thing. GStreamer is a full multimedia
    framework, which *does* do encoding and decoding of mp3 data.

    For example, a program to play a music file would look something like
    this: (note, this is off the top of my head, I haven't tested it, but if
    you need example code there's some up on the Ruby-GNOME2 site and
    included with the distribution)

    require 'gst'

    Gst.init

    # element to read a file
    src = Gst::ElementFactory.make("filesrc")
    # element to decode autodetect and decode formats
    spider = Gst::ElementFactory.make("spider")
    # element to output to a media decide
    sink = Gst::ElementFactory.make("osssink")


    # create a pipeline
    pipeline = Gst::Pipeline.new
    # add the elements
    pipeline.add(src, spider, sink)
    # link them together
    src >> spider >> sink

    src.location = ARGV.first

    # reset the pipeline and set the state to playing
    pipeline.clear
    pipeline.play

    # keep processing the pipeline until it's finished
    while pipeline.iterate do end

    exit!

    That example will actually handle any supported media type (mp3, ogg,
    wav, au, flac, etc), but if you wanted to limit it to mp3 data you could
    just use the "mad" element instead of "spider".

    Want to output to a file instead? Use a "filesink" element. Want to
    reencode to ogg maybe? Put a "oggenc" element before the "filesink".

    In other words you can do most anything you want with audio and video
    files you'd ever want to do. :)

    Matt


    Matthew Berg Guest

  7. #6

    Default Re: Ruby classes for MP3 de-/encoding

    On Sun, Nov 23, 2003 at 05:13:01AM +0900, Matthew Berg wrote:
    > I think you misunderstood my answer. The metadata stuff was meant to be
    Seems like I really did! Sorry! :)
    > a "you can do this as well" thing. GStreamer is a full multimedia
    > framework, which *does* do encoding and decoding of mp3 data.
    >
    [snip]
    > In other words you can do most anything you want with audio and video
    > files you'd ever want to do. :)
    This is really great. Thank you very much for that hint! I'll try GStreamer
    ASAP :)

    Kind regards (and have a nice weekend),
    Dennis Oelkers


    Dennis Oelkers Guest

  8. #7

    Default Re: Ruby classes for MP3 de-/encoding

    In article <20031122191549.GB3071@tachyon.bsdgeek.net>,
    Dennis Oelkers <dennis@sgi-powered.de> wrote:
    >On Sun, Nov 23, 2003 at 04:03:55AM +0900, Matthew Berg wrote:
    >> You can do metadata extraction with GStreamer as well, though the
    >> bundled bindings for libgstmediainfo can be slow in certain
    >> circumstances. I have the extraction code I've been working on up here
    >> though:
    >>
    >> [url]http://www.gothpoodle.com/~galt/info.rb[/url]
    >>
    >> This should allow you to read id3 or ogg tags at minimum, and i think
    >> wav riff headers though I haven't tested it on that yet.
    >
    >Thanks for all your help, but it seems as if you misunderstood my question
    >a bit. I'm not looking for classes to extract metadata information, I want
    >to encode/decode MP3 data.
    >
    I would think this would be very compute intensive (all those dicrete
    cosine transforms, which as I recall, are performed would take a lot of
    time in Ruby). If you want to do this from Ruby, wouldn't it be best to
    find an already existing C library and wrap it to create an extension?

    Phil
    Phil Tomson Guest

  9. #8

    Default Re: Ruby classes for MP3 de-/encoding

    On Sun, Nov 23, 2003 at 06:22:16AM +0900, Phil Tomson wrote:
    > In article <20031122191549.GB3071@tachyon.bsdgeek.net>,
    > Dennis Oelkers <dennis@sgi-powered.de> wrote:
    [snip]
    > >Thanks for all your help, but it seems as if you misunderstood my question
    > >a bit. I'm not looking for classes to extract metadata information, I want
    > >to encode/decode MP3 data.
    > >
    >
    > I would think this would be very compute intensive (all those dicrete
    > cosine transforms, which as I recall, are performed would take a lot of
    > time in Ruby). If you want to do this from Ruby, wouldn't it be best to
    > find an already existing C library and wrap it to create an extension?
    Yes, that's what I was looking for, ruby bindings for a C lib doing MP3
    encoding/decoding, but the only thing which is comparable to that is
    ruby-gstreamer. I'll evaluate it intensively, if it isn't sufficient for
    my task I'll probably write liblame/libwhatever bindings on my own. :(
    > Phil
    Kind regards,
    Dennis Oelkers


    Dennis Oelkers Guest

  10. #9

    Default Re: Ruby classes for MP3 de-/encoding

    On Nov 22, 2003, at 2:33 PM, Dennis Oelkers wrote:
    > Yes, that's what I was looking for, ruby bindings for a C lib doing MP3
    > encoding/decoding, but the only thing which is comparable to that is
    > ruby-gstreamer. I'll evaluate it intensively, if it isn't sufficient
    > for
    > my task I'll probably write liblame/libwhatever bindings on my own. :(
    I'm working on bindings for libmp3lame. You can see what I have so far
    at:

    [url]http://dev.faeriemud.org/~deveiant/Lame/[/url]

    It's not yet complete, as I haven't yet figured out what a good Rubyish
    API should look like, but if you're writing your own, it might be a
    good starting point. The current code can create encoders and configure
    them, and passes all its tests, but can't encode anything yet. =:)

    I'd also welcome help if you're so inclined. I don't have this checked
    into CVS yet, but I would do so if you (or anyone else) expressed an
    interest in lending a hand.

    --
    Michael Granger <ged@FaerieMUD.org>
    Rubymage, Believer, Architect
    The FaerieMUD Consortium <http://www.FaerieMUD.org/>



    Michael Granger Guest

  11. #10

    Default Re: Ruby classes for MP3 de-/encoding

    Quoteing [email]ged@FaerieMUD.org[/email], on Mon, Nov 24, 2003 at 12:36:11AM +0900:
    > On Nov 22, 2003, at 2:33 PM, Dennis Oelkers wrote:
    >
    > >Yes, that's what I was looking for, ruby bindings for a C lib doing MP3
    > >encoding/decoding, but the only thing which is comparable to that is
    > >ruby-gstreamer. I'll evaluate it intensively, if it isn't sufficient
    Why do you say "comparable" to that? Gstreamer is a C lib for doing
    audio/video encoding/decoding, and ruby-gsteamer is a ruby binding for
    it, seems like exactly what you need!

    Sam


    Sam Roberts Guest

  12. #11

    Default Re: Ruby classes for MP3 de-/encoding

    On Mon, Nov 24, 2003 at 05:45:59AM +0900, Sam Roberts wrote:
    > Why do you say "comparable" to that? Gstreamer is a C lib for doing
    > audio/video encoding/decoding, and ruby-gsteamer is a ruby binding for
    > it, seems like exactly what you need!
    Yes of course, but I was looking for a smaller lib doing only MP3 en-/decoding,
    not a complete "media framework" like gstream. But in fact after evaluating
    gstreamer it seems to be even better for my purpose because it fulfills some
    features I was looking for too, and offers possibilites to add extra
    functionality to my project I didn't think about before. :)

    Kind regards,
    Dennis Oelkers



    Dennis Oelkers Guest

  13. #12

    Default Re: Ruby classes for MP3 de-/encoding

    On Nov 23, 2003, at 1:45 PM, Sam Roberts wrote:
    > Quoteing [email]ged@FaerieMUD.org[/email], on Mon, Nov 24, 2003 at 12:36:11AM +0900:
    >> On Nov 22, 2003, at 2:33 PM, Dennis Oelkers wrote:
    >>
    >>> Yes, that's what I was looking for, ruby bindings for a C lib doing
    >>> MP3
    >>> encoding/decoding, but the only thing which is comparable to that is
    >>> ruby-gstreamer. I'll evaluate it intensively, if it isn't sufficient
    >
    > Why do you say "comparable" to that? Gstreamer is a C lib for doing
    > audio/video encoding/decoding, and ruby-gsteamer is a ruby binding for
    > it, seems like exactly what you need!
    Erm... I didn't. I quoted someone else who did.

    --
    Michael Granger <ged@FaerieMUD.org>
    Rubymage, Believer, Architect
    The FaerieMUD Consortium <http://www.FaerieMUD.org/>



    Michael Granger Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139