Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/libvorbis-1.2.0/doc/vorbisfile/decoding.html @ 16

Last change on this file since 16 was 16, checked in by landauf, 16 years ago

added libvorbis

File size: 2.9 KB
Line 
1<html>
2
3<head>
4<title>Vorbisfile - Decoding</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>vorbisfile version 1.2.0 - 20070723</p></td>
13</tr>
14</table>
15
16<h1>Decoding</h1>
17
18<p>
19All libvorbisfile decoding routines are declared in "vorbis/vorbisfile.h".
20<p>
21
22After <a href="initialization.html">initialization</a>, decoding audio
23is as simple as calling <a href="ov_read.html">ov_read()</a>. This
24function works similarly to reading from a normal file using
25<tt>read()</tt>.<p>
26
27However, a few differences are worth noting:
28
29<h2>multiple stream links</h2>
30
31A Vorbis stream may consist of multiple sections (called links) that
32encode differing numbers of channels or sample rates.  It is vitally
33important to pay attention to the link numbers returned by <a
34href="ov_read.html">ov_read</a> and handle audio changes that may
35occur at link boundaries.  Such multi-section files do exist in the
36wild and are not merely a specification curiosity.
37
38<h2>returned data amount</h2>
39
40<a href="ov_read.html">ov_read</a> does not attempt to completely fill
41a large, passed in data buffer; it merely guarantees that the passed
42back data does not overflow the passed in buffer size.  Large buffers
43may be filled by iteratively looping over calls to <a
44href="ov_read.html">ov_read</a> (incrementing the buffer pointer)
45until the original buffer is filled.
46
47<h2>file cursor position</h2>
48
49Vorbis files do not necessarily start at a sample number or time offset
50of zero.  Do not be surprised if a file begins at a positive offset of
51several minutes or hours, such as would happen if a large stream (such
52as a concert recording) is chopped into multiple seperate files.
53
54<p>
55<table border=1 color=black width=50% cellspacing=0 cellpadding=7>
56<tr bgcolor=#cccccc>
57        <td><b>function</b></td>
58        <td><b>purpose</b></td>
59</tr>
60<tr valign=top>
61        <td><a href="ov_read.html">ov_read</a></td>
62        <td>This function makes up the main chunk of a decode loop. It takes an
63OggVorbis_File structure, which must have been initialized by a previous
64call to <a href="ov_open.html"><tt>ov_open()</tt></a>, <a href="ov_fopen.html"><tt>ov_fopen()</tt></a>,
65or <a href="ov_open_callbacks.html"><tt>ov_open_callbacks()</tt></a>.</td>
66</tr>
67<tr valign=top>
68        <td><a href="ov_read_float.html">ov_read_float</a></td>
69        <td>This function decodes to floats instead of integer samples.</td>
70</tr>
71</table>
72
73<br><br>
74<hr noshade>
75<table border=0 width=100%>
76<tr valign=top>
77<td><p class=tiny>copyright &copy; 2007 Xiph.org</p></td>
78<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
79</tr><tr>
80<td><p class=tiny>Vorbisfile documentation</p></td>
81<td align=right><p class=tiny>vorbisfile version 1.2.0 - 20070723</p></td>
82</tr>
83</table>
84
85</body>
86
87</html>
Note: See TracBrowser for help on using the repository browser.