cannam@86
|
1 <html>
|
cannam@86
|
2
|
cannam@86
|
3 <head>
|
cannam@86
|
4 <title>Vorbisfile - Setup/Teardown</title>
|
cannam@86
|
5 <link rel=stylesheet href="style.css" type="text/css">
|
cannam@86
|
6 </head>
|
cannam@86
|
7
|
cannam@86
|
8 <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
|
cannam@86
|
9 <table border=0 width=100%>
|
cannam@86
|
10 <tr>
|
cannam@86
|
11 <td><p class=tiny>Vorbisfile documentation</p></td>
|
cannam@86
|
12 <td align=right><p class=tiny>vorbisfile version 1.3.2 - 20101101</p></td>
|
cannam@86
|
13 </tr>
|
cannam@86
|
14 </table>
|
cannam@86
|
15
|
cannam@86
|
16 <H1>Setup/Teardown</h1> <p>In order to decode audio using
|
cannam@86
|
17 libvorbisfile, a bitstream containing Vorbis audio must be properly
|
cannam@86
|
18 initialized before decoding and cleared when decoding is finished.
|
cannam@86
|
19 The simplest possible case is to use <a
|
cannam@86
|
20 href="ov_fopen.html">ov_fopen()</a> to open the file for access, check
|
cannam@86
|
21 it for Vorbis content, and prepare it for playback. A successful <a
|
cannam@86
|
22 href="../libvorbis/return.html">return code</a> from <a
|
cannam@86
|
23 href="ov_fopen.html">ov_fopen()</a> indicates the file is ready for use.
|
cannam@86
|
24 Once the file is no longer needed, <a
|
cannam@86
|
25 href="ov_clear.html">ov_clear()</a> is used to close the file and
|
cannam@86
|
26 deallocate decoding resources.<p>
|
cannam@86
|
27
|
cannam@86
|
28 On systems other than Windows<a href="ov_open.html#winfoot">[a]</a>, an
|
cannam@86
|
29 application may also open a file itself using <tt>fopen()</tt>, then pass the
|
cannam@86
|
30 <tt>FILE *</tt> to libvorbisfile using <a
|
cannam@86
|
31 href="ov_open.html">ov_open()</a>. </b>Do not</b> call
|
cannam@86
|
32 <tt>fclose()</tt> on a file handle successfully submitted to <a
|
cannam@86
|
33 href="ov_open.html">ov_open()</a>; libvorbisfile does this in the <a
|
cannam@86
|
34 href="ov_clear.html">ov_clear()</a> call.<p>
|
cannam@86
|
35
|
cannam@86
|
36 An application that requires more setup flexibility may open a data
|
cannam@86
|
37 stream using <a href="ov_open_callbacks.html">ov_open_callbacks()</a>
|
cannam@86
|
38 to change default libvorbis behavior or specify non-stdio data access
|
cannam@86
|
39 mechanisms.<p>
|
cannam@86
|
40
|
cannam@86
|
41 <p>
|
cannam@86
|
42 All libvorbisfile initialization and deallocation routines are declared in "vorbis/vorbisfile.h".
|
cannam@86
|
43 <p>
|
cannam@86
|
44
|
cannam@86
|
45 <table border=1 color=black width=50% cellspacing=0 cellpadding=7>
|
cannam@86
|
46 <tr bgcolor=#cccccc>
|
cannam@86
|
47 <td><b>function</b></td>
|
cannam@86
|
48 <td><b>purpose</b></td>
|
cannam@86
|
49 </tr>
|
cannam@86
|
50 <tr valign=top>
|
cannam@86
|
51 <td><a href="ov_fopen.html">ov_fopen</a></td>
|
cannam@86
|
52 <td>Opens a file and initializes the Ogg Vorbis bitstream with default values. This must be called before other functions in the library may be
|
cannam@86
|
53 used.</td>
|
cannam@86
|
54 </tr>
|
cannam@86
|
55 <tr valign=top>
|
cannam@86
|
56 <td><a href="ov_open.html">ov_open</a></td>
|
cannam@86
|
57 <td>Initializes the Ogg Vorbis bitstream with default values from a passed in file handle. This must be called before other functions in the library may be
|
cannam@86
|
58 used. <a href="#winfoot"><em>Do not use this call under Windows [a];</em></a> Use <a href="ov_fopen.html">ov_fopen()</a> or <a href="ov_open_callbacks.html">ov_open_callbacks()</a> instead.</td>
|
cannam@86
|
59 </tr>
|
cannam@86
|
60 <tr valign=top>
|
cannam@86
|
61 <td><a href="ov_open_callbacks.html">ov_open_callbacks</a></td>
|
cannam@86
|
62 <td>Initializes the Ogg Vorbis bitstream from a file handle and custom file/bitstream manipulation routines. Used instead of <a href="ov_open.html">ov_open()</a> or <a href="ov_fopen.html">ov_fopen()</a> when altering or replacing libvorbis's default stdio I/O behavior, or when a bitstream must be initialized from a <tt>FILE *</tt> under Windows.</td>
|
cannam@86
|
63 </tr>
|
cannam@86
|
64
|
cannam@86
|
65 <tr valign=top>
|
cannam@86
|
66 <td><a href="ov_test.html">ov_test</a></td>
|
cannam@86
|
67
|
cannam@86
|
68 <td>Partially opens a file just far enough to determine if the file
|
cannam@86
|
69 is an Ogg Vorbis file or not. A successful return indicates that the
|
cannam@86
|
70 file appears to be an Ogg Vorbis file, but the <a
|
cannam@86
|
71 href="OggVorbis_File.html">OggVorbis_File</a> struct is not yet fully
|
cannam@86
|
72 initialized for actual decoding. After a <a href="../libvorbis/return.html">successful return</a>, the file
|
cannam@86
|
73 may be closed using <a href="ov_clear.html">ov_clear()</a> or fully
|
cannam@86
|
74 opened for decoding using <a
|
cannam@86
|
75 href="ov_test_open.html">ov_test_open()</a>.<p> This call is intended to
|
cannam@86
|
76 be used as a less expensive file open test than a full <a
|
cannam@86
|
77 href="ov_open.html">ov_open()</a>.<p>
|
cannam@86
|
78 Note that libvorbisfile owns the passed in file resource is it returns success; do not <tt>fclose()</tt> files owned by libvorbisfile.</td>
|
cannam@86
|
79
|
cannam@86
|
80 </tr>
|
cannam@86
|
81 <tr valign=top>
|
cannam@86
|
82 <td><a href="ov_test_callbacks.html">ov_test_callbacks</a></td>
|
cannam@86
|
83 <td>As above but allowing application-define I/O callbacks.<p>
|
cannam@86
|
84 Note that libvorbisfile owns the passed in file resource is it returns success; do not <tt>fclose()</tt> files owned by libvorbisfile.</td>
|
cannam@86
|
85
|
cannam@86
|
86 </tr>
|
cannam@86
|
87 <tr valign=top>
|
cannam@86
|
88 <td><a href="ov_test_open.html">ov_test_open</a><td>
|
cannam@86
|
89 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>
|
cannam@86
|
90 </tr>
|
cannam@86
|
91 <tr valign=top>
|
cannam@86
|
92 <td><a href="ov_clear.html">ov_clear</a></td> <td>Closes the
|
cannam@86
|
93 bitstream and cleans up loose ends. Must be called when
|
cannam@86
|
94 finished with the bitstream. After return, the <a
|
cannam@86
|
95 href="OggVorbis_File.html">OggVorbis_File</a> struct is
|
cannam@86
|
96 invalid and may not be used before being initialized again
|
cannam@86
|
97 before begin reinitialized.
|
cannam@86
|
98
|
cannam@86
|
99 </td>
|
cannam@86
|
100 </tr>
|
cannam@86
|
101 </table>
|
cannam@86
|
102
|
cannam@86
|
103 <br><br>
|
cannam@86
|
104 <hr noshade>
|
cannam@86
|
105
|
cannam@86
|
106 <table border=0 width=100%>
|
cannam@86
|
107 <tr valign=top>
|
cannam@86
|
108 <td><p class=tiny>copyright © 2000-2010 Xiph.Org</p></td>
|
cannam@86
|
109 <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
|
cannam@86
|
110 </tr><tr>
|
cannam@86
|
111 <td><p class=tiny>Vorbisfile documentation</p></td>
|
cannam@86
|
112 <td align=right><p class=tiny>vorbisfile version 1.3.2 - 20101101</p></td>
|
cannam@86
|
113 </tr>
|
cannam@86
|
114 </table>
|
cannam@86
|
115
|
cannam@86
|
116 </body>
|
cannam@86
|
117
|
cannam@86
|
118 </html>
|