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