Results 1 to 10 of 17

Thread: MP3 encoder/decoder?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    I'm not aware of any newer units, but it looks like those are newer versions of some lame_decode_* functions

    But should be easy enough

    Code:
    type
     lameInt = longint; // Use cint from ctypes in fpc, or smallint on linux
     
     mp3data_struct = packed record
      header_parsed,
      stereo,
      samplerate,
      bitrate,
      mode,
      mode_ext,
      framesize: lameInt;
      
      nsamp: longword;
      
      totalframes,
      framenum: lameInt;
     end;
    
    function hip_decode_init: pointer; cdecl; external 'Lame_enc.dll';
    function hip_decode_exit(gfp: pointer): longint; cdecl; external 'Lame_enc.dll';
    function hip_decode(gfp: pointer; mp3buf: pointer; len: longint; PcmL, PcmR: pword): longint; cdecl; external 'Lame_enc.dll';
    function hip_decode_headers(gfp: pointer; mp3buf: pointer; len: longint; PcmL, PcmR: pword; var mp3data: mp3data_struct): longint; cdecl; external 'Lame_enc.dll';
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  2. #2
    Thanks.

    I'm not very good at porting C(++) yet. I'm afraid to make subtle mistakes that will cost me hours of my precious time to fix. Well, maybe I should just try it someday.

    As you may expect: The actual header is way bigger that that sample. About 1200 lines. It might be good to have a pascal version of it. However, the decode functionality of LAME is based on mpg123 code that was released under GPL, so some people may want to go down other paths instead.

    Thus far, I think that using mpg123 for decoding and LAME for encoding might be "easiest". I can also attempt a header port and use LAME for both encoding and decoding.

    Does anyone know any alternatives? I'm sure I have more options, but I'd like to know more of them.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  3. #3
    You could write a decoder yourself...

    That might be a too big undertaking. I'm not well aware of any other good decoders

    I would write one if it wasn't so hard to get my hands on a real and complete specification. Just for the sake of getting rid of irritating semi-crossplatform dependencies. I got MP1 working, but I haven't even been able to test it since I can't find an encoder for it...
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  4. #4
    lol. This supposed to be a project for a few weeks, so writing my own decoder is out of the question.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  5. #5
    mpg123 is a excellent decoder, but you should stick with lame, it's both a encoder and decoder.
    From brazil (:

    Pascal pownz!

  6. #6
    I agree. Using one lib is nicer. But do you have those headers that let me use the encode functionality of LAME?
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  7. #7

Bookmarks

Posting Permissions

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