LameDLLInterface.htm 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type"
  4. content="text/html; charset=iso-8859-1">
  5. <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
  6. <title>Lame-</title>
  7. </head>
  8. <body bgcolor="#FFFFFF">
  9. <p align="center">&nbsp; </p>
  10. <p align="center"><font size="7">Lame-enc DLL</font> <br>
  11. <font size="5">Interface version 1.32</font> (and above)<br>
  12. (Lame engine version: 3.93 or higher) <br>
  13. <font size="6">Programmers Manual</font></p>
  14. <p align="center"><i>The lame_enc.dll and this manual is
  15. copyright by Albert L Faber<br>
  16. Originally the the DLL interface is modeled after the BladeEnc
  17. DLL interface<br>
  18. which is copyrighted by Tord Jansson and Jukka Poikolainen<br>
  19. This document and the DLL interface may be distributed freely</i>
  20. <br>
  21. <i>as long as modifications are released under the LGPL license.</i>
  22. </p>
  23. <p align="center">&nbsp; </p>
  24. <p align="center"><b>Homepage</b>: <a
  25. href="http://www.cdex.n3.net">http://www.cdex.n3.net</a><br>
  26. <b>E-mail:</b> mailto: <a
  27. href="mailto:afaber@users.sourceforge.net">afaber@users.sourceforge.net</a>
  28. </p>
  29. <p><br>
  30. <br>
  31. <br>
  32. <br>
  33. </p>
  34. <p><font size="5">Distribution</font> </p>
  35. <p>People and companies&nbsp; who wants to distribute
  36. lame_enc.dll with their commercial products are free to do so as
  37. far as I'm concerned (LGPL license), but should be aware that
  38. lame_enc.dll might infringe certain MP3 related software patents
  39. held by Fraunhofer IIS in certain countries. </p>
  40. <p><br>
  41. &nbsp; </p>
  42. <p><font size="5">Disclaimer</font> </p>
  43. <p>lame_enc.dll and this manual is distributed 'as is' with no
  44. warranty of any kind. The Author is not to be held responsible
  45. for the result of any use or misuse of this product. <br>
  46. &nbsp; <br>
  47. &nbsp; </p>
  48. <p><font size="5">Current Bugs and Limitations</font> </p>
  49. <p>Although the interface is designed to be able to handle
  50. multiple parallel streams it can't be done yet due to limitations
  51. in the engine, only one stream is allowed. <br>
  52. &nbsp; </p>
  53. <p><font size="5">Future Compatibility</font> </p>
  54. <p>This interface should be compatible with all future versions
  55. of lame_enc.DLL without any need to recompile your programs. You
  56. should therefore <b>not</b> check the version number upon start
  57. and prevent users from running your program with a later version
  58. of lame_enc.DLL. <br>
  59. &nbsp; </p>
  60. <hr>
  61. <p><font size="5">How to use the DLL</font> </p>
  62. <p>1. Fill in a <a href="#The BE_CONFIG Structure">BE_CONFIG </a>structure
  63. and send it to <a href="#beInitStream()">beInitStream()</a>. Make
  64. sure that BE_ERR_SUCCESSFUL is returned. </p>
  65. <p>2. Reserve at least the amount of memory returned in
  66. dwBufferSize as your output buffer. </p>
  67. <p>3. Call <a href="#beEncodeChunk()">beEncodeChunk()</a> until
  68. you've encoded everything you want. </p>
  69. <p>4. Call <a href="#beDeinitStream()">beDeinitStream()</a> to
  70. make sure that all encoded data is flushed out before closing the
  71. stream. </p>
  72. <p>5. Close the stream using <a href="#beCloseStream()">beCloseStream()
  73. </a></p>
  74. <p>6. Finally, call the <a href="#beWriteVBRHeader()">beWriteVBRHeader()</a>
  75. functions, to insert the INFO tag MP3 Header. This is an
  76. extension of the Xing VBR tag which is also used for CBR
  77. encodings. This call can only be omitted if the INFO tag was
  78. explicilty disabled in the BE_CONFIG Structure.</p>
  79. <p>A handy feature is the available <a
  80. href="#Lame_enc.dll debug option">Lame_enc.dll debug option</a>,
  81. which will dump the important lame internal settings to a text
  82. file.<br>
  83. &nbsp; </p>
  84. <p>&nbsp;</p>
  85. <p><font size="5">Return Values</font> </p>
  86. <p>See the header-file for a complete list of function return
  87. values. All functions should return BE_ERR_SUCCESSFUL unless
  88. something went wrong. <br>
  89. &nbsp; </p>
  90. <hr>
  91. <h1><a name="Type definitions"><font size="5">Type definitions</font></a></h1>
  92. <p>The DLL is by default compiled with the MS Visual C/C++
  93. compiler, which has the following type definitions:</p>
  94. <table border="0">
  95. <tr>
  96. <td>Type </td>
  97. <td>Description</td>
  98. </tr>
  99. <tr>
  100. <td>CHAR</td>
  101. <td>signed char (8 bits)</td>
  102. </tr>
  103. <tr>
  104. <td>BYTE</td>
  105. <td>unsigned char (8 bits)</td>
  106. </tr>
  107. <tr>
  108. <td>SHORT</td>
  109. <td>signed short (16 bits)</td>
  110. </tr>
  111. <tr>
  112. <td>WORD</td>
  113. <td>unsigned short (16 bits)</td>
  114. </tr>
  115. <tr>
  116. <td>INT</td>
  117. <td>signed long (32 bits)</td>
  118. </tr>
  119. <tr>
  120. <td>LONG</td>
  121. <td>signed long (32 bits)</td>
  122. </tr>
  123. <tr>
  124. <td>BOOL</td>
  125. <td>signed long (32 bits) (YES, 32 bits for a one bit
  126. value)<br>
  127. TRUE = 0<br>
  128. FALSE=-1</td>
  129. </tr>
  130. <tr>
  131. <td>DWORD</td>
  132. <td>unsigned long (32 bits)</td>
  133. </tr>
  134. <tr>
  135. <td>FLOAT</td>
  136. <td>floating point (32 bits)</td>
  137. </tr>
  138. <tr>
  139. <td>DOUBLE</td>
  140. <td>float point (64 bits)</td>
  141. </tr>
  142. <tr>
  143. <td>LPCSTR</td>
  144. <td>const char* (32 bits pointer to zero terminated
  145. character string)</td>
  146. </tr>
  147. </table>
  148. <p>Within the lame_enc.dll All the structure elements are one
  149. byte alligned (due to backwards compatibility with BladEnc.DLL!</p>
  150. <p>&nbsp;</p>
  151. <hr>
  152. <h1><a name="The BE_CONFIG Structure"><font size="5">The
  153. BE_CONFIG Structure </font></a></h1>
  154. <p><font size="3">Currently there the BE_CONFIG structure has to
  155. varians, the old MP3 config structure that is truly compatible
  156. with the old BladeEnc interface, and the new defined LHV1
  157. structure, which can set far more options in the lame encoder</font></p>
  158. <p>&nbsp;</p>
  159. <h2><font size="5">The MP3 BE_CONFIG - structure (OBSOLETE)</font></h2>
  160. <p>This is the old structure as it was originally defined by the
  161. BladeEnc.DLL interface. However, I do highly recommend to use the
  162. new Lame specific config structure, since it gives you more
  163. control over the Lame encoder settings.</p>
  164. <p>These are the members of the BE_CONFIG structure you need to
  165. fill in before you call beInitStream(): <br>
  166. &nbsp; </p>
  167. <table border="0">
  168. <tr>
  169. <td><b>dwConfig</b></td>
  170. <td>Specifies what kind of output you want. Since only
  171. MP3 currently is supported you must set this to <b>BE_CONFIG_MP3</b></td>
  172. </tr>
  173. <tr>
  174. <td><b>format.mp3.dwSampleRate</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  175. <td>Samplerate in Hz for MP3 file. This can be set to
  176. either <b>32000</b>, <b>44100</b> or <b>48000</b>.</td>
  177. </tr>
  178. <tr>
  179. <td><b>format.mp3.byMode</b></td>
  180. <td>Stereomode for MP3 file. This can be either <b>BE_MP3_MODE_STEREO</b>,
  181. <b>BE_MP3_MODE_DUALCHANNEL</b> or <b>BE_MP3_MODE_MONO.</b></td>
  182. </tr>
  183. <tr>
  184. <td><b>format.mp3.bitrate</b></td>
  185. <td>Bitrate (i.e. size) of MP3 file in kBit/s. Allowed
  186. bitrates are: <b>32, 40, 48, 56, 64, 80, 96, 112, 128,
  187. 160, 192, 224, 256</b> and <b>320</b>.</td>
  188. </tr>
  189. <tr>
  190. <td><b>format.mp3.bCopyright</b></td>
  191. <td>If this is set to TRUE the Copyright bit in the MP3
  192. stream will be set.</td>
  193. </tr>
  194. <tr>
  195. <td><b>format.mp3.bCRC</b></td>
  196. <td>Set this to TRUE in order to enable CRC-checksum in
  197. the bitstream.</td>
  198. </tr>
  199. <tr>
  200. <td><b>format.mp3.bOriginal</b></td>
  201. <td>If this is set to TRUE the Original bit in the MP3
  202. stream will be set.</td>
  203. </tr>
  204. <tr>
  205. <td><b>format.mp3.bPrivate</b></td>
  206. <td>If this is set to TRUE the Private bit in the MP3
  207. stream will be set.</td>
  208. </tr>
  209. </table>
  210. <p>&nbsp;</p>
  211. <h2><font size="5">The LHV1 BE_CONFIG - structure (recommended)</font></h2>
  212. <p>These are the members of the LHV1 BE_CONFIG structure, you
  213. need to fill in before you call beInitStream(): <br>
  214. </p>
  215. <table border="0">
  216. <tr>
  217. <td><b>dwConfig</b></td>
  218. <td>Specifies what kind of output you want. Since only
  219. MP3 currently is supported you must set this to <b>BE_CONFIG_LAME</b></td>
  220. </tr>
  221. <tr>
  222. <td>&nbsp;</td>
  223. <td>&nbsp;</td>
  224. </tr>
  225. <tr>
  226. <td><b>format.LHV1.dwStructVersion</b></td>
  227. <td>Indicates the version number of the structure,
  228. current version number is 1</td>
  229. </tr>
  230. <tr>
  231. <td><b>format.LHV1.dwStructSize</b></td>
  232. <td>Specifies the size of the BE_CONFIG structure
  233. (currently 331 bytes)</td>
  234. </tr>
  235. <tr>
  236. <td>&nbsp;</td>
  237. <td>&nbsp;</td>
  238. </tr>
  239. <tr>
  240. <td><b>format.LHV1.dwSampleRate</b>&nbsp;</td>
  241. <td>Samplerate in Hz for MP3 file. This can be set to
  242. either:<br>
  243. <b>32000</b>, <b>44100</b> or <b>48000</b> for MPEG-I<br>
  244. <b>16000</b>, <b>22050</b> or <b>24000</b> for MPEG-I<br>
  245. <b>8000</b>, <b>11025</b> or <b>12000</b> for MPEG-II.5</td>
  246. </tr>
  247. <tr>
  248. <td><b>format.LHV1.dwReSampleRate</b></td>
  249. <td>Specifies to which sample rate the input stream has
  250. to be resampled, if set to 0, the encoder will decide
  251. which ReSample rate to use</td>
  252. </tr>
  253. <tr>
  254. <td><b>format.LHV1.nMode</b></td>
  255. <td>Stereomode for MP3 file. This can be either <b>BE_MP3_MODE_STEREO</b>,
  256. <b>BE_MP3_MODE_JSTEREO, BE_MP3_MODE_DUALCHANNEL</b> or <b>BE_MP3_MODE_MONO.</b></td>
  257. </tr>
  258. <tr>
  259. <td><strong>format.LHV1.dwBitrate</strong></td>
  260. <td>For CBR, this specifies the actual bitrate, for VBR,
  261. it specifies the minimum bitrate<br>
  262. Allowed bitrates are: <b>32, 40, 48, 56, 64, 80, 96, 112,
  263. 128, 160, 192, 224, 256</b> and <b>320</b>.for MPEG-I<br>
  264. Allowed bitrates are: <b>8, 16, 24, 32, 40, 48, 56, 64,
  265. 80, 96, 112, 128, 144 </b>and<b> 160</b>.for MPEG-II<p><strong>Note:</strong>
  266. dwBitrate is used as the minimum bitrate in the case of
  267. using a VBR mode.</p>
  268. </td>
  269. </tr>
  270. <tr>
  271. <td><strong>format.LHV1.dwMaxBitrate</strong></td>
  272. <td>When VBR mode is enabled, it specifies the maximum
  273. allowed bitrate (see also dwBitrate to specify the minium
  274. bitrate), for CBR mode this setting is ignored.</td>
  275. </tr>
  276. <tr>
  277. <td><strong>format.LHV1.nPreset</strong></td>
  278. <td>Keep in mind that the presets can overwrite some of
  279. the other settings, since it is called right before the
  280. encoder is initialized<br>
  281. <table border="0">
  282. <tr>
  283. <td>The nPreset option can be set to one of the
  284. following presets values::</td>
  285. </tr>
  286. </table>
  287. <p>LQP_NOPRESET (don't use any presets)<br>
  288. LQP_NORMAL_QUALITY (quality is set to 5)<br>
  289. LQP_LOW_QUALITY (quality is set to 9)<br>
  290. LQP_HIGH_QUALITY (quality is set to 2)<br>
  291. LQP_VOICE_QUALITY (use for voice encoding)<br>
  292. LQP_R3MIX (r3mix preset option)<br>
  293. LQP_VERYHIGH_QUALITY (quality is set to 0)<br>
  294. LQP_STANDARD (lame command line alt-preset standard)<br>
  295. LQP_FAST_STANDARD (lame command line alt-preset fast
  296. standard)<br>
  297. LQP_EXTREME (lame command line alt-preset extreme)<br>
  298. LQP_FAST_EXTREME (lame command line alt-preset fast
  299. extreme)<br>
  300. LQP_INSANE (lame command line alt-preset insane)<br>
  301. LQP_ABR (lame command line alt-preset abr)<br>
  302. LQP_CBR(lame command line alt-preset cbr)<br>
  303. <br>
  304. <strong>(old lame preset options)</strong><br>
  305. LQP_PHONE <br>
  306. LQP_SW<br>
  307. LQP_AM<br>
  308. LQP_FM<br>
  309. LQP_VOICE<br>
  310. LQP_RADIO<br>
  311. LQP_TAPE<br>
  312. LQP_HIFI<br>
  313. LQP_CD<br>
  314. LQP_STUDIO</p>
  315. </td>
  316. </tr>
  317. <tr>
  318. <td>&nbsp;</td>
  319. </tr>
  320. <tr>
  321. <td><b>format.LHV1.bCopyright</b></td>
  322. <td>If this is set to TRUE the Copyright bit in the MP3
  323. stream will be set.</td>
  324. </tr>
  325. <tr>
  326. <td><b>format.LHV1.bCRC</b></td>
  327. <td>Set this to TRUE in order to enable CRC-checksum in
  328. the bitstream.</td>
  329. </tr>
  330. <tr>
  331. <td><b>format.LHV1.bOriginal</b></td>
  332. <td>If this is set to TRUE the Original bit in the MP3
  333. stream will be set.</td>
  334. </tr>
  335. <tr>
  336. <td><b>format.LHV1.bPrivate</b></td>
  337. <td>If this is set to TRUE the Private bit in the MP3
  338. stream will be set.</td>
  339. </tr>
  340. <tr>
  341. <td>&nbsp;</td>
  342. <td>&nbsp;</td>
  343. </tr>
  344. <tr>
  345. <td><strong>format.LHV1.nVbrMethod</strong></td>
  346. <td>Sepecifes if the VBR method to use, currently the
  347. following settings are supported:<p><font size="3">VBR_METHOD_NONE
  348. (don't use VBR, use CBR encoding instead),<br>
  349. VBR_METHOD_DEFAULT (default VBR method)<br>
  350. VBR_METHOD_OLD (old VBR method, proven to be reliable)<br>
  351. VBR_METHOD_NEW (new VBR method, faster than
  352. VBR_METHOD_OLD)<br>
  353. VBR_METHOD_MTRH (depreciated, same as VBR_METHOD_NEW)<br>
  354. VBR_METHOD_ABR (Average Bitrate Encoding, see also </font><strong>format.LHV1.dwVbrAbr_bps</strong><font
  355. size="3">)</font></p>
  356. </td>
  357. </tr>
  358. <tr>
  359. <td><strong>format.LHV1.bWriteVBRHeader</strong></td>
  360. <td>Sepecifes if the a XING VBR header should be written
  361. or not. When this option is enabled, you have to call the
  362. <font size="3">beWriteVBRHeader function when encoding
  363. has been completed. Keep in mind that the VBR info tag
  364. can also be written for CBR encoded files, the TAG info
  365. can be useful for additional info like encoder delay and
  366. the like.</font></td>
  367. </tr>
  368. <tr>
  369. <td><strong>format.LHV1.bEnableVBR</strong></td>
  370. <td>Specifies if VBR encoding option shall be used or
  371. not, possible values are TRUE/FALSE</td>
  372. </tr>
  373. <tr>
  374. <td><strong>format.LHV1.nVBRQuality</strong></td>
  375. <td>Quality option if VBR is enabled (0=highest quality,
  376. 9 is lowest quality)</td>
  377. </tr>
  378. <tr>
  379. <td><strong>format.LHV1.dwVbrAbr_bps</strong></td>
  380. <td>If the Average Bit Rate is specified, the lame
  381. encoder ignores the nVBRQuality settings (However, <strong>bEnableVBR</strong>
  382. must be set to TRUE and the <strong>format.LHV1.nVbrMethod
  383. </strong>parameter should be set to<strong> </strong><font
  384. size="3"><strong>VBR_METHOD_ABR</strong>). The allowed
  385. range for the </font><strong>format.LHV1.dwVbrAbr_bps </strong>parameter<strong>
  386. </strong>any integer value <font size="3">between:</font><p><strong>MPEG-I:</strong>
  387. 32000 .. 320000 bps<b><br>
  388. </b><strong>MPEG-II:</strong> 8000 .. 160000 bps</p>
  389. </td>
  390. </tr>
  391. <tr>
  392. <td>&nbsp;</td>
  393. <td>&nbsp;</td>
  394. </tr>
  395. <tr>
  396. <td><strong>format.LHV1.bNoBitRes</strong></td>
  397. <td>Disables the bit-resorvoir and disables the insertion
  398. of padded frames</td>
  399. </tr>
  400. <tr>
  401. <td><strong>format.LHV1.nQuality</strong></td>
  402. <td>Quality Setting, HIGH BYTE should be NOT LOW byte,
  403. otherwhise quality is set to 5. This is done to be
  404. backward compatible. So to set quality to 3, you have to
  405. set the nQuality parameter to 0xFC03.</td>
  406. </tr>
  407. <tr>
  408. <td><b>format.mp3.btReserved</b></td>
  409. <td>For future use, set all elements to zero</td>
  410. </tr>
  411. </table>
  412. <p>&nbsp;</p>
  413. <p>&nbsp; </p>
  414. <hr>
  415. <h1><a name="beInitStream()"><font size="5">beInitStream()</font></a>
  416. </h1>
  417. <table border="0" cellspacing="16" width="100%">
  418. <tr>
  419. <td valign="top" width="20%"><b>Synopsis:</b></td>
  420. <td valign="top" width="80%">BE_ERR beInitStream(
  421. PBE_CONFIG <i>pbeConfig</i>, PDWORD <i>dwSamples</i>,
  422. PDWORD <i>dwBufferSize</i>, PHBE_STREAM <i>phbeStream</i>
  423. )</td>
  424. </tr>
  425. <tr>
  426. <td valign="top" width="20%"><b>Parameters:</b></td>
  427. <td valign="top" width="80%"><table border="0"
  428. cellspacing="10" width="100%">
  429. <tr>
  430. <td valign="top" width="20%"><i>pbeConfig</i></td>
  431. <td>Pointer at the struct containing encoder
  432. settings.</td>
  433. </tr>
  434. <tr>
  435. <td valign="top"><i>dwSamples</i></td>
  436. <td>Pointer at double word where number of
  437. samples to send to each <i>beEncodeChunk()</i> is
  438. returned.</td>
  439. </tr>
  440. <tr>
  441. <td valign="top"><i>dwBufferSize</i></td>
  442. <td>Pointer at double word where minimum size in
  443. bytes of output buffer is returned.</td>
  444. </tr>
  445. <tr>
  446. <td valign="top"><i>phbeStream</i></td>
  447. <td>Pointer at integer where Stream handle is
  448. returned.</td>
  449. </tr>
  450. </table>
  451. </td>
  452. </tr>
  453. <tr>
  454. <td valign="top" width="20%"><b>Description:</b></td>
  455. <td valign="top" width="80%">This function is the first
  456. to call before starting an encoding stream.</td>
  457. </tr>
  458. </table>
  459. <hr>
  460. <h1><a name="beEncodeChunk()"><font size="5">beEncodeChunk()</font>
  461. </a></h1>
  462. <table border="0" cellspacing="16" width="100%">
  463. <tr>
  464. <td valign="top" width="20%"><b>Synopsis:</b></td>
  465. <td valign="top" width="80%">BE_ERR beEncodeChunk(
  466. HBE_STREAM <i>hbeStream</i>, DWORD <i>nSamples</i>,
  467. PSHORT <i>pSamples</i>, PBYTE <i>pOutput</i>, PDWORD <i>pdwOutput</i>
  468. )</td>
  469. </tr>
  470. <tr>
  471. <td valign="top" width="20%"><b>Parameters:</b></td>
  472. <td valign="top"><table border="0" cellspacing="10"
  473. width="100%">
  474. <tr>
  475. <td valign="top" width="20%"><i>hbeStream</i></td>
  476. <td width="80%">Handle of the stream.</td>
  477. </tr>
  478. <tr>
  479. <td valign="top" width="90"><i>nSamples</i></td>
  480. <td>Number of samples to be encoded for this
  481. call. This should be identical to what is
  482. returned by <i>beInitStream()</i>, unless you are
  483. encoding the last chunk, which might be smaller.</td>
  484. </tr>
  485. <tr>
  486. <td valign="top" width="90"><i>pSamples</i></td>
  487. <td>Pointer at the 16-bit signed samples to be
  488. encoded. These should be in stereo when encoding
  489. a stereo MP3 and mono when encoding a mono MP3.</td>
  490. </tr>
  491. <tr>
  492. <td valign="top" width="90"><i>pOutput</i></td>
  493. <td>Where to write the encoded data. This buffer
  494. should be at least of the minimum size returned
  495. by <i>beInitStream()</i>.</td>
  496. </tr>
  497. <tr>
  498. <td valign="top" width="90"><i>pdwOutput</i></td>
  499. <td>Where to return number of bytes of encoded
  500. data written. The amount of data written might
  501. vary from chunk to chunk.</td>
  502. </tr>
  503. </table>
  504. </td>
  505. </tr>
  506. <tr>
  507. <td valign="top" width="20%"><b>Description:</b></td>
  508. <td valign="top">Encodes a chunk of samples. <i>Please
  509. note that if you have set the output to generate mono MP3
  510. files you must feed beEncodeChunk() with mono samples!</i></td>
  511. </tr>
  512. </table>
  513. <hr>
  514. <h1><a name="beDeinitStream()"><font size="5">beDeinitStream()</font>
  515. </a></h1>
  516. <table border="0" cellspacing="16" width="100%">
  517. <tr>
  518. <td valign="top" width="20%"><b>Synopsis:</b></td>
  519. <td valign="top" width="80%">BE_ERR beDeinitStream(
  520. HBE_STREAM <i>hbeStream</i>, PBYTE <i>pOutput</i>, PDWORD
  521. <i>pdwOutput</i> )</td>
  522. </tr>
  523. <tr>
  524. <td valign="top" width="20%"><b>Parameters:</b></td>
  525. <td valign="top"><table border="0" cellspacing="10"
  526. width="100%">
  527. <tr>
  528. <td valign="top" width="20%"><i>hbeStream</i></td>
  529. <td width="80%">Handle of the stream.</td>
  530. </tr>
  531. <tr>
  532. <td valign="top"><i>pOutput</i></td>
  533. <td>Where to write the encoded data. This buffer
  534. should be at least of the minimum size returned
  535. by <i>beInitStream()</i>.</td>
  536. </tr>
  537. <tr>
  538. <td><i>pdwOutput</i></td>
  539. <td>Where to return number of bytes of encoded
  540. data written.</td>
  541. </tr>
  542. </table>
  543. </td>
  544. </tr>
  545. <tr>
  546. <td valign="top" width="20%"><b>Description:</b></td>
  547. <td valign="top">This function should be called after
  548. encoding the last chunk in order to flush the encoder. It
  549. writes any encoded data that still might be left inside
  550. the encoder to the output buffer. This function should
  551. NOT be called unless you have encoded all of the chunks
  552. in your stream.</td>
  553. </tr>
  554. </table>
  555. <hr>
  556. <h1><a name="beCloseStream()"><font size="5">beCloseStream()</font></a>
  557. </h1>
  558. <table border="0" cellspacing="16" width="100%">
  559. <tr>
  560. <td valign="top" width="20%"><b>Synopsis:</b></td>
  561. <td valign="top">BE_ERR beCloseStream( HBE_STREAM <i>hbeStream</i>
  562. )</td>
  563. </tr>
  564. <tr>
  565. <td valign="top" width="90"><b>Parameters:</b></td>
  566. <td valign="top"><table border="0" cellspacing="10"
  567. width="100%">
  568. <tr>
  569. <td width="20%"><i>hbeStream</i></td>
  570. <td>Handle of the stream.</td>
  571. </tr>
  572. </table>
  573. </td>
  574. </tr>
  575. <tr>
  576. <td valign="top" width="90"><b>Description:</b></td>
  577. <td valign="top">Last function to be called when finished
  578. encoding a stream. Should unlike <i>beDeinitStream()</i>
  579. also be called if the encoding is canceled.</td>
  580. </tr>
  581. </table>
  582. <hr>
  583. <h1><a name="beVersion()"><font size="5">beVersion()</font> </a></h1>
  584. <table border="0" cellspacing="16" width="100%">
  585. <tr>
  586. <td valign="top" width="20%"><b>Synopsis:</b></td>
  587. <td valign="top">VOID beVersion( PBE_VERSION <i>pbeVersion</i>
  588. )</td>
  589. </tr>
  590. <tr>
  591. <td valign="top"><b>Parameters:</b></td>
  592. <td valign="top"><table border="0" cellspacing="10"
  593. width="100%">
  594. <tr>
  595. <td valign="top" width="20%"><i>pbeVersion</i></td>
  596. <td>Pointer at struct where version number,
  597. release date and URL for homepage is returned.</td>
  598. </tr>
  599. </table>
  600. </td>
  601. </tr>
  602. <tr>
  603. <td valign="top"><b>Description:</b></td>
  604. <td valign="top">Returns information like version numbers
  605. (both of the DLL and encoding engine), release date and
  606. URL for lame_enc's homepage. All this information should
  607. be made available to the user of your product through a
  608. dialog box or something similar.</td>
  609. </tr>
  610. </table>
  611. <p>&nbsp;</p>
  612. <hr>
  613. <p>&nbsp;</p>
  614. <h1><a name="beWriteVBRHeader()"><font size="5">beWriteVBRHeader()</font>
  615. </a></h1>
  616. <table border="0" cellspacing="16" width="100%">
  617. <tr>
  618. <td valign="top" width="20%"><b>Synopsis:</b></td>
  619. <td valign="top">VOID beWriteVBRHeader( LPCSTR <i>pszMP3FileName</i>
  620. )</td>
  621. </tr>
  622. <tr>
  623. <td valign="top"><b>Parameters:</b></td>
  624. <td valign="top"><table border="0" cellspacing="10"
  625. width="100%">
  626. <tr>
  627. <td valign="top" width="20%"><i>pszMP3FileName</i></td>
  628. <td>Const Pointer zero terminated string, that
  629. contains the MP3 file name.</td>
  630. </tr>
  631. </table>
  632. </td>
  633. </tr>
  634. <tr>
  635. <td valign="top"><b>Description:</b></td>
  636. <td valign="top">Writes a Xing Header in front of the MP3
  637. file. Make sure that the MP3 file is closed, and the the
  638. beConfig.format.LHV1.bWriteVBRHeader has been set to
  639. TRUE. In addition, it is always save to call
  640. beWriteVBRHeader after the encoding has been finished,
  641. even when the beConfig.format.LHV1.bWriteVBRHeader is not
  642. set to TRUE</td>
  643. </tr>
  644. </table>
  645. <p>&nbsp;</p>
  646. <p>&nbsp;</p>
  647. <hr>
  648. <p>&nbsp;</p>
  649. <h1><a name="Lame_enc.dll debug option">Lame_enc.dll debug option</a></h1>
  650. <p>The lame_enc.dll has a built-in debug option, that dumps all
  651. the important internal settings to a text file. To enable this
  652. feature, create a text file in the Windows directory which is
  653. named lame_enc.ini, and should contain the following two lines</p>
  654. <p>[debug]<br>
  655. WriteLogFile=1</p>
  656. <p>Save this text file, and each time you encode a file, the
  657. settings are added to a file name lame_enc.txt, that is located
  658. in the same directory as the lame_enc.dll</p>
  659. <p>&nbsp;</p>
  660. <p><br>
  661. &nbsp; </p>
  662. </body>
  663. </html>