#38 Float32 encode functions

open
nobody
libmp3lame (13)
5
2007-03-12
2007-03-12
Nicholas Humfrey
No

Attached is a patch to add two new encode functions to LAME:

lame_encode_buffer_float32()
lame_encode_buffer_float32_interleaved()

Unlike lame_encode_buffer_float(), these two new encode functions use audio samples in the range +/-1.

This streamlines code that use float32s internally, as many pro-audio APIs do (Jack, Mac OS X's coreaudio, LADSPA etc).

Discussion

  • Logged In: YES
    user_id=1056
    Originator: NO

    I am afraid that having 2 encode_buffer_float with different input ranges would be error-prone.

    Perhaps we should have a look at implementing a generic encode_buffer, with some enums/flags to set input data type, interleaving, range.

     
  • Logged In: YES
    user_id=711618
    Originator: YES

    I don't see that it would be that confusing / error-prone if it was properly documented?

    Having a generic encode_buffer is more like to be error-prone as it won't be possible to do type-checking/number of parameters at compile time...

    It is just a shame that encode_buffer_float didn't use the same range of values as most other audio applications seem to now :(