summaryrefslogtreecommitdiff
path: root/doc/initialization.html
blob: f9f68073cfc00234e20d4b7566967cead87b5d51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<html>

<head>
<title>Tremor - Setup/Teardown</title>
<link rel=stylesheet href="style.css" type="text/css">
</head>

<body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
<table border=0 width=100%>
<tr>
<td><p class=tiny>Tremor documentation</p></td>
<td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
</tr>
</table>

<H1>Setup/Teardown</h1> <p>In order to decode audio using
libvorbisidec, a bitstream containing Vorbis audio must be properly
initialized before decoding and cleared when decoding is finished.
The simplest possible case is to use <tt>fopen()</tt> to open a Vorbis
file and then pass the <tt>FILE *</tt> to an <a
href="ov_open.html">ov_open()</a> call.  A successful <a
href="return.html">return code</a> from <a
href="ov_open.html">ov_open()</a> indicates the file is ready for use.
Once the file is no longer needed, <a
href="ov_clear.html">ov_clear()</a> is used to close the file and
deallocate decoding resources.  </b>Do not</b> call <tt>fclose()</tt> on the
file; libvorbisidec does this in the <a
href="ov_clear.html">ov_clear()</a> call.

<p>
All libvorbisidec initialization and deallocation routines are declared in "ivorbisfile.h".
<p>

<table border=1 color=black width=50% cellspacing=0 cellpadding=7>
<tr bgcolor=#cccccc>
	<td><b>function</b></td>
	<td><b>purpose</b></td>
</tr>
<tr valign=top>
	<td><a href="ov_open.html">ov_open</a></td>
	<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
	used.</td>
</tr>
<tr valign=top>
	<td><a href="ov_open_callbacks.html">ov_open_callbacks</a></td>
	<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>
</tr>

<tr valign=top>
<td><a href="ov_test.html">ov_test</a></td> 

<td>Partially opens a file just far enough to determine if the file
is an Ogg Vorbis file or not.  A successful return indicates that the
file appears to be an Ogg Vorbis file, but the <a
href="OggVorbis_File.html">OggVorbis_File</a> struct is not yet fully
initialized for actual decoding.  After a <a href="return.html">successful return</a>, the file
may be closed using <a href="ov_clear.html">ov_clear()</a> or fully
opened for decoding using <a
href="ov_test_open.html">ov_test_open()</a>.<p> This call is intended to
be used as a less expensive file open test than a full <a
href="ov_open.html">ov_open()</a>.<p>
Note that libvorbisidec owns the passed in file resource is it returns success; do not <tt>fclose()</tt> files owned by libvorbisidec.</td>

</tr>
<tr valign=top>
<td><a href="ov_test_callbacks.html">ov_test_callbacks</a></td>
<td>As above but allowing application-define I/O callbacks.<p>
Note that libvorbisidec owns the passed in file resource is it returns success; do not <tt>fclose()</tt> files owned by libvorbisidec.</td>

</tr>
<tr valign=top>
<td><a href="ov_test_open.html">ov_test_open</a><td>
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>
</tr>
<tr valign=top>
	<td><a href="ov_clear.html">ov_clear</a></td> <td>Closes the
	bitstream and cleans up loose ends.  Must be called when
	finished with the bitstream.  After return, the <a
	href="OggVorbis_File.html">OggVorbis_File</a> struct is
	invalid and may not be used before being initialized again
	before begin reinitialized.

</td>
</tr>
</table>

<br><br>
<hr noshade>
<table border=0 width=100%>
<tr valign=top>
<td><p class=tiny>copyright &copy; 2002 Xiph.org</p></td>
<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
</tr><tr>
<td><p class=tiny>Tremor documentation</p></td>
<td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
</tr>
</table>

</body>

</html>