mirror of
https://github.com/openharmony/third_party_lame.git
synced 2026-07-01 05:53:58 -04:00
updated documentation (API and DLL)
to clarify that INFO tag must be written unless explicitly disabled.
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
+11
-4
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -96,8 +96,12 @@ stream. </p>
|
||||
<p>5. Close the stream using <a href="#beCloseStream()">beCloseStream()
|
||||
</a></p>
|
||||
|
||||
<p>6. And optionally call the <a href="#beWriteVBRHeader()">beWriteVBRHeader()</a>
|
||||
functions, to insert a Xing MP3 Header</p>
|
||||
<p>6. Finally, call the <a href="#beWriteVBRHeader()">beWriteVBRHeader()</a>
|
||||
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.</p>
|
||||
|
||||
<p>A handy feature is the available <a
|
||||
href="#Lame_enc.dll debug option">Lame_enc.dll debug option</a>,
|
||||
|
||||
Reference in New Issue
Block a user