initialization.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <html>
  2. <head>
  3. <title>Tremor - Setup/Teardown</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>Tremor documentation</p></td>
  10. <td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
  11. </tr>
  12. </table>
  13. <H1>Setup/Teardown</h1> <p>In order to decode audio using
  14. libvorbisidec, a bitstream containing Vorbis audio must be properly
  15. initialized before decoding and cleared when decoding is finished.
  16. The simplest possible case is to use <tt>fopen()</tt> to open a Vorbis
  17. file and then pass the <tt>FILE *</tt> to an <a
  18. href="ov_open.html">ov_open()</a> call. A successful <a
  19. href="return.html">return code</a> from <a
  20. href="ov_open.html">ov_open()</a> indicates the file is ready for use.
  21. Once the file is no longer needed, <a
  22. href="ov_clear.html">ov_clear()</a> is used to close the file and
  23. deallocate decoding resources. </b>Do not</b> call <tt>fclose()</tt> on the
  24. file; libvorbisidec does this in the <a
  25. href="ov_clear.html">ov_clear()</a> call.
  26. <p>
  27. All libvorbisidec initialization and deallocation routines are declared in "ivorbisfile.h".
  28. <p>
  29. <table border=1 color=black width=50% cellspacing=0 cellpadding=7>
  30. <tr bgcolor=#cccccc>
  31. <td><b>function</b></td>
  32. <td><b>purpose</b></td>
  33. </tr>
  34. <tr valign=top>
  35. <td><a href="ov_open.html">ov_open</a></td>
  36. <td>Initializes the Ogg Vorbis bitstream with a pointer to a bitstream and default values. This must be called before other functions in the library may be
  37. used.</td>
  38. </tr>
  39. <tr valign=top>
  40. <td><a href="ov_open_callbacks.html">ov_open_callbacks</a></td>
  41. <td>Initializes the Ogg Vorbis bitstream with a pointer to a bitstream, default values, and custom file/bitstream manipulation routines. Used instead of <a href="ov_open.html">ov_open()</a> when working with other than stdio based I/O.</td>
  42. </tr>
  43. <tr valign=top>
  44. <td><a href="ov_test.html">ov_test</a></td>
  45. <td>Partially opens a file just far enough to determine if the file
  46. is an Ogg Vorbis file or not. A successful return indicates that the
  47. file appears to be an Ogg Vorbis file, but the <a
  48. href="OggVorbis_File.html">OggVorbis_File</a> struct is not yet fully
  49. initialized for actual decoding. After a <a href="return.html">successful return</a>, the file
  50. may be closed using <a href="ov_clear.html">ov_clear()</a> or fully
  51. opened for decoding using <a
  52. href="ov_test_open.html">ov_test_open()</a>.<p> This call is intended to
  53. be used as a less expensive file open test than a full <a
  54. href="ov_open.html">ov_open()</a>.<p>
  55. Note that libvorbisidec owns the passed in file resource is it returns success; do not <tt>fclose()</tt> files owned by libvorbisidec.</td>
  56. </tr>
  57. <tr valign=top>
  58. <td><a href="ov_test_callbacks.html">ov_test_callbacks</a></td>
  59. <td>As above but allowing application-define I/O callbacks.<p>
  60. Note that libvorbisidec owns the passed in file resource is it returns success; do not <tt>fclose()</tt> files owned by libvorbisidec.</td>
  61. </tr>
  62. <tr valign=top>
  63. <td><a href="ov_test_open.html">ov_test_open</a><td>
  64. Finish opening a file after a successful call to <a href="ov_test.html">ov_test()</a> or <a href="ov_test_callbacks.html">ov_test_callbacks()</a>.</td>
  65. </tr>
  66. <tr valign=top>
  67. <td><a href="ov_clear.html">ov_clear</a></td> <td>Closes the
  68. bitstream and cleans up loose ends. Must be called when
  69. finished with the bitstream. After return, the <a
  70. href="OggVorbis_File.html">OggVorbis_File</a> struct is
  71. invalid and may not be used before being initialized again
  72. before begin reinitialized.
  73. </td>
  74. </tr>
  75. </table>
  76. <br><br>
  77. <hr noshade>
  78. <table border=0 width=100%>
  79. <tr valign=top>
  80. <td><p class=tiny>copyright &copy; 2002 Xiph.org</p></td>
  81. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
  82. </tr><tr>
  83. <td><p class=tiny>Tremor documentation</p></td>
  84. <td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
  85. </tr>
  86. </table>
  87. </body>
  88. </html>