]> git.jsancho.org Git - lugaru.git/blob - libvorbis-1.0.1/doc/vorbisfile/decoding.html
Renamed old Makefile, updated .hgignore, and made changes to png functions to remove...
[lugaru.git] / libvorbis-1.0.1 / doc / vorbisfile / decoding.html
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.68 - 20030307</p></td>
13 </tr>
14 </table>
15
16 <h1>Decoding</h1>
17
18 <p>
19 All libvorbisfile decoding routines are declared in "vorbis/vorbisfile.h".
20 <p>
21
22 After <a href="initialization.html">initialization</a>, decoding audio
23 is as simple as calling <a href="ov_read.html">ov_read()</a>. This
24 function works similarly to reading from a normal file using
25 <tt>read()</tt>.<p>
26
27 However, a few differences are worth noting:
28
29 <h2>multiple stream links</h2>
30
31 A Vorbis stream may consist of multiple sections (called links) that
32 encode differing numbers of channels or sample rates.  It is vitally
33 important to pay attention to the link numbers returned by <a
34 href="ov_read.html">ov_read</a> and handle audio changes that may
35 occur at link boundaries.  Such multi-section files do exist in the
36 wild 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
41 a large, passed in data buffer; it merely guarantees that the passed
42 back data does not overflow the passed in buffer size.  Large buffers
43 may be filled by iteratively looping over calls to <a
44 href="ov_read.html">ov_read</a> (incrementing the buffer pointer)
45 until the original buffer is filled.
46
47 <h2>file cursor position</h2>
48
49 Vorbis files do not necessarily start at a sample number or time offset
50 of zero.  Do not be surprised if a file begins at a positive offset of
51 several minutes or hours, such as would happen if a large stream (such
52 as 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
63 OggVorbis_File structure, which must have been initialized by a previous
64 call to <a href="ov_open.html"><tt>ov_open()</tt></a>.</td>
65 </tr>
66 <tr valign=top>
67         <td><a href="ov_read_float.html">ov_read_float</a></td>
68         <td>This function decodes to floats instead of integer samples.</td>
69 </tr>
70 </table>
71
72 <br><br>
73 <hr noshade>
74 <table border=0 width=100%>
75 <tr valign=top>
76 <td><p class=tiny>copyright &copy; 2003 Xiph.org</p></td>
77 <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
78 </tr><tr>
79 <td><p class=tiny>Vorbisfile documentation</p></td>
80 <td align=right><p class=tiny>vorbisfile version 1.68 - 20030307</p></td>
81 </tr>
82 </table>
83
84 </body>
85
86 </html>