diff --git a/API b/API index 18f92a5c..c850df53 100644 --- a/API +++ b/API @@ -32,7 +32,7 @@ See lame.h for details. lame_global_flags *gfp; gfp = lame_init(); -The default (if you set nothing) is a a J-Stereo, 44.1khz +The default (if you set nothing) is a J-Stereo, 44.1khz 128kbps CBR mp3 file at quality 5. Override various default settings as necessary, for example: @@ -84,11 +84,21 @@ return code = number of bytes output to mp3buffer. This can be 0. int lame_encode_flush(lame_global_flags *,char *mp3buffer, int mp3buffer_size); -7. Write all remaining data to mp3 file. If the file was -encoded using VBR and you want to add a Xing VBR header: +7. Write the Xing VBR/INFO tag to mp3 file. void lame_mp3_tags_fid(lame_global_flags *,FILE* fid); +This adds a valid mp3 frame which contains information about the +bitstream some players may find usefull. It is used for CBR,ABR and +VBR. The routine will attempt to rewind the output stream to the +beginning. If this is not possible, (for example, you are encoding to +stdout) you should specifically disable the tag by calling +lame_set_bWriteVbrTag(gfp,0) in step 3 above, and call +lame_mp3_tags_fid() with fid=NULL. If the rewind fails and +the tag was not disabled, the first mp3 frame in the bitstream +will be all 0's. + + 8. free the internal data structures. diff --git a/Dll/BladeMP3EncDLL.c b/Dll/BladeMP3EncDLL.c index 0807541a..1ebcfe49 100644 --- a/Dll/BladeMP3EncDLL.c +++ b/Dll/BladeMP3EncDLL.c @@ -352,6 +352,15 @@ __declspec(dllexport) BE_ERR beInitStream(PBE_CONFIG pbeConfig, PDWORD dwSamples // Set input sample frequency lame_set_in_samplerate( gfp, lameConfig.format.LHV1.dwSampleRate ); + // disable INFO/VBR tag by default. + // if this tag is used, the calling program must call beWriteVBRTag() + // after encoding. But the original DLL documentation does not + // require the + // app to call beWriteVBRTag() unless they have specifically + // set LHV1.bWriteVBRHeader=TRUE. Thus the default setting should + // be disabled. + lame_set_bWriteVbrTag( gfp, 0 ); + //2001-12-18 Dibrom's ABR preset stuff if(lameConfig.format.LHV1.nPreset == 11) // --ALT-PRESET ABR @@ -559,8 +568,7 @@ now --vbr-mtrh is known as --vbr-new } // check if the VBR tag is required - if ( ( TRUE == lameConfig.format.LHV1.bWriteVBRHeader) && - ( vbr_off != lame_get_VBR( gfp ) ) ) + if ( TRUE == lameConfig.format.LHV1.bWriteVBRHeader) { lame_set_bWriteVbrTag( gfp, 1 ); } @@ -796,8 +804,7 @@ __declspec(dllexport) BE_ERR beWriteVBRHeader(LPCSTR lpszFileName) BE_ERR beResult =BE_ERR_SUCCESSFUL; // Do we have to write the VBR tag? - if ( ( lame_get_bWriteVbrTag( gfp ) ) && - ( vbr_off != lame_get_VBR( gfp ) ) ) + if ( lame_get_bWriteVbrTag( gfp ) { // Try to open the file diff --git a/Dll/Example.cpp b/Dll/Example.cpp index 70b5ffe9..3bd68ed8 100644 --- a/Dll/Example.cpp +++ b/Dll/Example.cpp @@ -284,7 +284,7 @@ int main(int argc, char *argv[]) // Close output file fclose( pFileOut ); - // Write the VBR Tag + // Write the INFO Tag beWriteVBRHeader( strFileOut ); // Were done, return OK result diff --git a/Dll/LameDLLInterface.htm b/Dll/LameDLLInterface.htm index c9ce826d..aaf76557 100644 --- a/Dll/LameDLLInterface.htm +++ b/Dll/LameDLLInterface.htm @@ -96,8 +96,12 @@ stream.

5. Close the stream using beCloseStream()

-

6. And optionally call the beWriteVBRHeader() -functions, to insert a Xing MP3 Header

+

6. Finally, call the beWriteVBRHeader() +functions, to insert the INFO tag MP3 Header. This is an extension +of the Xing VBR tag which is also used for CBR encodings. +This call can only +be omitted if the INFO tag was explicilty disabled in the +BE_CONFIG Structure.

A handy feature is the available Lame_enc.dll debug option,