vorbis_encode_init.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <html>
  2. <head>
  3. <title>libvorbisenc - function - vorbis_encode_init</title>
  4. <link rel=stylesheet href="style.css" type="text/css">
  5. </head>
  6. <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
  7. <table border=0 width=100%>
  8. <tr>
  9. <td><p class=tiny>libvorbisenc documentation</p></td>
  10. <td align=right><p class=tiny>libvorbisenc release 1.1 - 20040709</p></td>
  11. </tr>
  12. </table>
  13. <h1>vorbis_encode_init</h1>
  14. <p><i>declared in "vorbis/libvorbisenc.h";</i></p>
  15. <p>This is the primary function within libvorbisenc for setting up managed bitrate modes.
  16. <p>Before this function is called, the <a href="vorbis_info.html">vorbis_info</a> struct should be initialized by using vorbis_info_init() from the libvorbis API. After encoding, vorbis_info_clear should be called.
  17. <p>The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set constraints for the encoded file. This function uses these settings to select the appropriate encoding mode and set it up.
  18. <p>
  19. <br><br>
  20. <table border=0 color=black cellspacing=0 cellpadding=7>
  21. <tr bgcolor=#cccccc>
  22. <td>
  23. <pre><b>
  24. extern int vorbis_encode_init(<a href="vorbis_info.html">vorbis_info</a> *vi,
  25. long channels,
  26. long rate,
  27. long max_bitrate,
  28. long nominal_bitrate,
  29. long min_bitrate);
  30. </b></pre>
  31. </td>
  32. </tr>
  33. </table>
  34. <h3>Parameters</h3>
  35. <dl>
  36. <dt><i>vi</i></dt>
  37. <dd>File pointer to an initialized <a href="vorbis_info.html">vorbis_info</a> struct.</dd>
  38. <dt><i>channels</i></dt>
  39. <dd>The number of channels to be encoded.</dd>
  40. <dt><i>rate</i></dt>
  41. <dd>The sampling rate of the source audio.</dd>
  42. <dt><i>max_bitrate</i></dt>
  43. <dd>Desired maximum bitrate (limit). -1 indicates unset.</dd>
  44. <dt><i>nominal_bitrate</i></dt>
  45. <dd>Desired average, or central, bitrate. -1 indicates unset.</dd>
  46. <dt><i>min_bitrate</i></dt>
  47. <dd>Desired minimum bitrate. -1 indicates unset.</dd>
  48. </dl>
  49. <h3>Return Values</h3>
  50. <blockquote>
  51. <li>
  52. 0 for success</li>
  53. <li>less than zero for failure:</li>
  54. <ul>
  55. <li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
  56. <li>OV_EINVAL - Invalid setup request, eg, out of range argument. </li>
  57. <li>OV_EIMPL - Unimplemented mode; unable to comply with bitrate request.</li>
  58. </ul>
  59. </blockquote>
  60. <p>
  61. <br><br>
  62. <hr noshade>
  63. <table border=0 width=100%>
  64. <tr valign=top>
  65. <td><p class=tiny>copyright &copy; 2004 xiph.org</p></td>
  66. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/index.html">Ogg Vorbis</a><br><a href="mailto:team@vorbis.org">team@vorbis.org</a></p></td>
  67. </tr><tr>
  68. <td><p class=tiny>libvorbisenc documentation</p></td>
  69. <td align=right><p class=tiny>libvorbisenc release 1.1 - 20040709</p></td>
  70. </tr>
  71. </table>
  72. </body>
  73. </html>