There are two problems I have with the lame encoder DLL:

1. there is no way to set the Noise shaping & psycho acoustic algorithms:
   corresponding to the comandline arguments  of Lame
    -q <arg>        <arg> = 0...9.  Default  -q 5 
                    -q 0:  Highest quality, very slow 
                    -q 9:  Poor quality, but fast 
    -h              Same as -q 2.   Recommended.
    -f              Same as -q 7.   Fast, ok quality
  Hence you are stuck with -q 5 (which often is not good enough or not fast 
enough:

2. This is a bug (and I hope someone can fix it for me or explain how I can
    put a fix into the official lame cvs repository myself.)

    If you produce mp3 streaming audio, it is common 
       to use average bitrate (--abr  xxxx) and not have a VBR tag 
      (since it has to be added to the beginning of the stream 
        after all of the stream is written. Impossible) 

    The only place to set the WriteVbrTag is here:
                if ( lameConfig.format.LHV1.bEnableVBR )
                {
                        lame_set_VBR( gfp, vbr_default );

                        lame_set_VBR_q( gfp, lameConfig.format.LHV1.nVBRQuality );

                        if (lameConfig.format.LHV1.bWriteVBRHeader==TRUE)
                        {
                                lame_set_bWriteVbrTag( gfp, 1 );
                        }
                        else
                        {
                                lame_set_bWriteVbrTag( gfp, 0 );
                        }
                }
                else
                {
                        lame_set_VBR( gfp, vbr_off );
                }
it requires EnableVBR==TRUE and WriteVBRHeader==FALSE

To get average bitrate you have to set the average bitrate to a positive 
value:
                // Use ABR?
                if (lameConfig.format.LHV1.dwVbrAbr_bps>0)
                {
                        // set VBR to ABR
                        lame_set_VBR( gfp, vbr_abr );

unfortunately next comes:
                // Use VBR?
                if ( lameConfig.format.LHV1.bEnableVBR )
                {
                        switch ( lameConfig.format.LHV1.nVbrMethod)
                        {
                                case VBR_METHOD_NONE:
                                        lame_set_VBR( gfp, vbr_off );
                                        break;

                                case VBR_METHOD_DEFAULT:
                                        lame_set_VBR( gfp, vbr_default ); 
                                        break;
                . . .
                                case VBR_METHOD_ABR:
                                        lame_set_VBR( gfp, vbr_abr ); 
                                        break;

and sice we have enabled VBR and VbrMethod is an undocumented feature (not 
described in LameDLLInterface.htm) we are stuck with the default VbrMethod==0 
that is VBR_METHOD_DEFAULT and we are back to variable bitrate and not 
average bitrate.

Solutions:
1. Make VbrMethod a documented feature.
2. Remove the test for WriteVBRHeader and the call to lame_set_bWriteVbrTag
   from its nesting inside the EnableVBR test and make it an independent test.

Best use both solutions 1 and 2.


Who can help ?

Martin Ruckert


_______________________________________________
mp3encoder mailing list
[EMAIL PROTECTED]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder

Reply via email to