Results 1 to 10 of 17

Thread: MP3 encoder/decoder?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Erm... I've been following this thread quite closely since I find it may be extremely useful for some of my code - so I looked into the above link and can I just say that if you use a platform that has the Windows unit, like windows, all is nice. However, on linux I noticed that by default there is no Libc supplied with FPC (or at least not this version) so i tried a few of the units that are suggested by the FPC wiki to replace it and no luck. Any solutions for us non-windows folk?

    Just a thought but unless I'm missing something here (other than clib) this is quite annoying =p

    Edit: aaahahaaaa... Found the linking error:

    As it happens on fpc 2.4.0, Libc is NOT compiled and its in
    Code:
    /usr/share/fpcsrc/2.4.0/packages/libc/src/
    now thats nice, but that folder is protected - you have to sudo or gksudo to modify stuff there. If you use an IDE such as geany or fp and don't sudo or gksudo then it tries to compile LibC - fails and then tries to read LibC and fails and thus says there is no LibC. Annoying.

    Or alternatively, I'm told you can go to http://sourceforge.net/projects/freeclx/ and get the kylix utils there. They should also contain LibC as part of gLibC... Sorry for the unnecessary post, but some may find this useful.

    Final Edit: And if you sudo it, you still get some errors while linking ending in a super massive epic fail. Solution: Copy ALL files from libc folder to same folder you have lame.pas and compile it. Should work with less complaints... Don't know if you all have to go through this but this seems to be the only solution I have found on Ubuntu 10.10 Maverick with latest updates (all update sources except unsupported)
    Last edited by code_glitch; 10-12-2010 at 07:27 PM.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  2. #2
    code_glitch, are you talking about clib or libc? And in case of libc, are you talking about the legacy Kylix unit libc, or the c runtime library?

    If it's because you need to link to libc, then you shouldn't look for a fpc unit. Then simply write {$l c} in your code, or add -k-lc to the compiler command line, or use dynamic linking
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    I was referring to LibC. As it turns out they are two different things: and I got confused. I just posted all that to clear it up for any other clutsy people like me and cheers for those flags. Will definitely use them rather than my cumbersome procedure.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  4. #4
    Maybe it isn't such a good idea to use an encoder and decoder for this. MP3 is a lossy format, and encoding it again will have bad effects on quality. I only need a lib to read/write MP3's container format. I'll leave the individual frames intact, so no quality is lost.

    I've been looking into the FFmpeg library. I think it has what I need, but there aren't any good tutorials on it.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  5. #5
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Ah, good ol FFMpeg. I wondered if they had a lib with pascal headers?? I only knew it in the video/audio trans/en/de-coding.... Tell me if you find a good tut - dying to play with this in pascal
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  6. #6
    I wrote a small program to parse mp3 files down to frame level. Cutting the file should be just a simple matter of omitting the undesired frames, but I haven't tried it. I hope it'll be helpful: http://imcold.evilhosting.org/files/mp3parse.pas.html

  7. #7
    Last edited by chronozphere; 16-12-2010 at 08:02 PM.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  8. #8
    I have no interest in writing MP3's, however i'd like to use them with OpenAL that i'm exploring. There was a sample application with mpg123 but i wasn't able to find pascal header to it in any of the links in below (mpg123.pas):
    http://www.noeska.com/doal/tutorials.aspx

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
  •