Menu

#27 interleaved 32-bit audio sample processing

None
closed-accepted
libmp3lame (13)
5
2017-08-15
2006-03-14
No

Hi,
I'm using LAME as part of winLAME. For now I use the lame_encode_buffer_interleaved() function that takes 16-bit interleaved samples, but I also want to support 32-bit interleaved sample processing, and so I came up with a patch to implement a lame_encode_buffer_interleaved_int() function to put 32-bit signed interleaved audio samples into LAME. I hope this can be put into LAME, since it's only an extra function, not a change of existing functionality. Thanks in advance!

Discussion

  • Alexander Leidinger

    Logged In: YES
    user_id=90585

    An int may be 64bit on 64bit systems (e.g. Athlon 64). I
    suggest to use a 32bit type like int32_t instead.

     
  • Alexander Leidinger

    • assigned_to: nobody --> aleidinger
    • status: open --> pending
     
  • Michael Fink

    Michael Fink - 2006-06-14

    Logged In: YES
    user_id=124874

    The function lame_encode_buffer_int also uses int as data
    type for the samples and would suffer from the same error. I
    don't want need to depend that int is a 32-bit value, but I
    want to put samples into LAME that come interleaved "int"
    values. So I consider the patch ok in that sense.

     
  • Michael Fink

    Michael Fink - 2006-06-14
    • status: pending --> open
     
  • gregTelevirtual

    gregTelevirtual - 2006-10-03

    Logged In: YES
    user_id=1612121

    Hi,

    this isn't really gonna help you guys, but from reading
    this i think you guys may be able to help me, as you know
    about the things i'm having trouble with.

    The pcm I'm creating is a mono file, I believe that to get
    around this issue I need to copy my buffer so I have two
    channels, left and right and feed them into
    lame_encode_buffer() the main problem is however, using
    Microsoft visual Studio. NET 2003 I get link error 2019:
    unresolved symbol 'lame_encode_buffer()' reference in
    function 'Our sound encode function'. I've tried using
    all the other lame_encode functions and are having to make
    do with lame_encode_buffer_interleaved() but this appears
    to half the quality of the file output. In short, we need
    to know a) the best way to encode a mono pcm file and b)if
    this method doesn't use the interleaved function what
    might cause the rest of them to generate the link error.

    sorry for hijacking your thread but i'm in desperate need
    of some help.

    regards

    Greg

     
  • Michael Fink

    Michael Fink - 2008-02-26

    updated patch for lame.c to add function lame_encode_buffer_interleaved_int32_t()

     
  • Michael Fink

    Michael Fink - 2008-02-26

    Logged In: YES
    user_id=124874
    Originator: YES

    I updated the patch for the latest CVS HEAD version, lame.c revision 1.319. I also changed the type from int to int32_t as suggested. I hope the patch can be applied to CVS. Many thanks!
    File Added: lame.c-lame_encode_buffer_interleaved_int32_t.patch

     
  • Michael Fink

    Michael Fink - 2008-02-26

    updated patch for lame.h to add function lame_encode_buffer_interleaved_int32_t()

     
  • Michael Fink

    Michael Fink - 2008-02-26

    Logged In: YES
    user_id=124874
    Originator: YES

    File Added: lame.h-lame_encode_buffer_interleaved_int32_t.patch

     
  • Michael Fink

    Michael Fink - 2014-05-06

    Hi,
    This patch is the only change to LAME that is needed so that I can use the libmp3lame.dll that can be compiled from source or that can be downloaded from Rarewares. After 6 years I got the latest LAME sources, re-applied the changes and tested it with winLAME. The result is that mp3 to mp3 (and other conversions) can use 32-bit samples, losing fewer bits than using 16-bit short int samples. I hope the patch can go into LAME at some point. Thanks!
    Michael

     
  • Alexander Leidinger

    • status: open --> closed-accepted
    • Group: -->
     
  • Alexander Leidinger

    committed to CVS

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.