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