<html>
<head>
-<title>vorbisfile - function - ov_read</title>
+<title>Vorbisfile - function - ov_read</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>vorbisfile documentation</p></td>
-<td align=right><p class=tiny>vorbisfile version 1.25 - 20000615</p></td>
+<td><p class=tiny>Vorbisfile documentation</p></td>
+<td align=right><p class=tiny>vorbisfile version 1.3.2 - 20101101</p></td>
</tr>
</table>
<p><i>declared in "vorbis/vorbisfile.h";</i></p>
<p>
- This is the main function used to decode a Vorbis file within a loop.
-</p><p>
- This function deals with more complicated bitstream chaining issues.
- Up to this point, everything could more or less hide the multiple
- logical bitstream nature of chaining from the toplevel application
- if the toplevel application didn't particularly care. However, when we actually read audio back, we must be aware that multiple bitstream sections do not necessarily
- have to have the same number of channels or sampling rate.
-</p><p>
- <tt>ov_read()</tt> passes back the index of the sequential logical
- bitstream currently being decoded along with the PCM data in order
- that the toplevel application can take action on channel/sample rate
- changes. This number will be incremented at chaining boundaries even
- for non-seekable streams. For seekable streams, it represents the
- actual chaining index within the physical bitstream.
-<tt>ov_read()</tt> passes back the logical bitstream number currently
- being decoded along with the PCM data in order that the toplevel
- application can take action on channel/sample rate changes.
-</p>
+ This is the main function used to decode a Vorbis file within a
+ loop. It returns up to the specified number of bytes of decoded PCM audio
+ in the requested endianness, signedness, and word size. If the audio is
+ multichannel, the channels are interleaved in the output buffer.
+ If the passed in buffer is large, <tt>ov_read()</tt> will not fill
+ it; the passed in buffer size is treated as a <em>limit</em> and
+ not a request.
+
+<p>The output channels are in stream order and not remapped. Vorbis I
+defines channel order as follows:
+
+<ul>
+<li>one channel - the stream is monophonic
+<li>two channels - the stream is stereo. channel order: left, right
+<li>three channels - the stream is a 1d-surround encoding. channel order: left,
+center, right
+<li>four channels - the stream is quadraphonic surround. channel order: front left,
+front right, rear left, rear right
+<li>five channels - the stream is five-channel surround. channel order: front left,
+center, front right, rear left, rear right
+<li>six channels - the stream is 5.1 surround. channel order: front left, center,
+front right, rear left, rear right, LFE
+<li>seven channels - the stream is 6.1 surround. channel order: front left, center,
+front right, side left, side right, rear center, LFE
+<li>eight channels - the stream is 7.1 surround. channel order: front left, center,
+front right, side left, side right, rear left, rear right,
+LFE
+<li>greater than eight channels - channel use and order is undefined
+</ul>
+
+<p>Note that up to this point, the Vorbisfile API could more or less hide the
+ multiple logical bitstream nature of chaining from the toplevel
+ application if the toplevel application didn't particularly care.
+ However, when reading audio back, the application must be aware
+ that multiple bitstream sections do not necessarily use the same
+ number of channels or sampling rate. <p> <tt>ov_read()</tt> passes
+ back the index of the sequential logical bitstream currently being
+ decoded (in <tt>*bitstream</tt>) along with the PCM data in order
+ that the toplevel application can handle channel and/or sample
+ rate changes. This number will be incremented at chaining
+ boundaries even for non-seekable streams. For seekable streams, it
+ represents the actual chaining index within the physical bitstream.
+<p>
<br><br>
<table border=0 color=black cellspacing=0 cellpadding=7>
<h3>Parameters</h3>
<dl>
<dt><i>vf</i></dt>
-<dd>A pointer to the OggVorbis_File structure--this is used for ALL the externally visible vorbisfile
+<dd>A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisfile
functions.</dd>
<dt><i>buffer</i></dt>
<dd>A pointer to an output buffer. The decoded output is inserted into this buffer.</dd>
<dt><i>length</i></dt>
<dd>Number of bytes to be read into the buffer. Should be the same size as the buffer. A typical value is 4096.</dd>
<dt><i>bigendianp</i></dt>
-<dd>Specifies big or little endian byte packing. 0 for little endian, 1 for big endian. Typical value is 0.</dd>
+<dd>Specifies big or little endian byte packing. 0 for little endian, 1 for b
+ig endian. Typical value is 0.</dd>
<dt><i>word</i></dt>
-<dd>Specifies word size. Possible arguments are 1 for 8-bit samples, or 2 or 16-bit samples. Typical value is 2.</dd>
+<dd>Specifies word size. Possible arguments are 1 for 8-bit samples, or 2 or
+16-bit samples. Typical value is 2.</dd>
<dt><i>sgned</i></dt>
<dd>Signed or unsigned data. 0 for unsigned, 1 for signed. Typically 1.</dd>
<dt><i>bitstream</i></dt>
<dt>OV_EBADLINK</dt>
<dd>indicates that an invalid stream section was supplied to
libvorbisfile, or the requested link is corrupt.</dd>
+<dt>OV_EINVAL</dt>
+ <dd>indicates the initial file headers couldn't be read or
+ are corrupt, or that the initial open call for <i>vf</i>
+ failed.</dd>
<dt>0</dt>
<dd>indicates EOF</dd>
<dt><i>n</i></dt>
little-endian samples.
</p>
-<br>
+
+
<br><br>
<hr noshade>
<table border=0 width=100%>
<tr valign=top>
-<td><p class=tiny>copyright © 2000 vorbis team</p></td>
-<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/index.html">Ogg Vorbis</a><br><a href="mailto:team@vorbis.org">team@vorbis.org</a></p></td>
+<td><p class=tiny>copyright © 2000-2010 Xiph.Org</p></td>
+<td align=right><p class=tiny><a href="https://xiph.org/vorbis/">Ogg Vorbis</a></p></td>
</tr><tr>
-<td><p class=tiny>vorbisfile documentation</p></td>
-<td align=right><p class=tiny>vorbisfile version 1.25 - 20000615</p></td>
+<td><p class=tiny>Vorbisfile documentation</p></td>
+<td align=right><p class=tiny>vorbisfile version 1.3.2 - 20101101</p></td>
</tr>
</table>
-
</body>
</html>