#27 interleaved 32-bit audio sample processing

open
libmp3lame (13)
5
2006-06-14
2006-03-14
Michael Fink
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

  • 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.

     
    • 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
     
  • 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

    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

    Logged In: YES
    user_id=124874
    Originator: YES

    File Added: lame.h-lame_encode_buffer_interleaved_int32_t.patch