4 <title>vorbisfile - function - ov_read</title>
5 <link rel=stylesheet href="style.css" type="text/css">
8 <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
9 <table border=0 width=100%>
11 <td><p class=tiny>vorbisfile documentation</p></td>
12 <td align=right><p class=tiny>vorbisfile version 1.25 - 20000615</p></td>
18 <p><i>declared in "vorbis/vorbisfile.h";</i></p>
20 <p>This is the main function used to decode a Vorbis file within a loop.
21 <p>This function deals with more complicated bitstream chaining issues. Up to this point, everything could more or less hide the multiple
22 logical bitstream nature of chaining from the toplevel application
23 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
24 have to have the same number of channels or sampling rate.
26 ov_read returns the sequential logical bitstream number currently
27 being decoded along with the PCM data in order that the toplevel
28 application can take action on channel/sample rate changes. This
29 number will be incremented even for streamed (non-seekable) streams
30 For seekable streams, it represents the actual logical bitstream
31 index within the physical bitstream.
35 <table border=0 color=black cellspacing=0 cellpadding=7>
39 long ov_read(<a href="OggVorbis_File.html">OggVorbis_File</a> *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream);
48 <dd>A pointer to the OggVorbis_File structure--this is used for ALL the externally visible vorbisfile
50 <dt><i>buffer</i></dt>
51 <dd>A pointer to an output buffer. The decoded output is inserted into this buffer.</dd>
52 <dt><i>length</i></dt>
53 <dd>Number of bytes to be read into the buffer. Should be the same size as the buffer. A typical value is 4096.</dd>
54 <dt><i>bigendianp</i></dt>
55 <dd>Specifies big or little endian byte packing. 0 for little endian, 1 for big endian. Typical value is 0.</dd>
57 <dd>Specifies word size. Possible arguments are 1 for 8-bit samples, or 2 or 16-bit samples. Typical value is 2.</dd>
59 <dd>Signed or unsigned data. 0 for unsigned, 1 for signed. Typically 1.</dd>
60 <dt><i>bitstream</i></dt>
61 <dd></dd>A pointer to the number of the current logical bitstream.
65 <h3>Return Values</h3>
68 OV_HOLE indicates there was an interruption in the data. (one of: garbage between pages, loss of sync followed by recapture, or a corrupt page)</li>
\r
70 OV_EBADLINK indicates that an invalid stream section was supplied to libvorbisfile,
\r
71 or the requested link is corrupt.
\r
76 <li><i>n</i> indicates actual number of bytes read. Within a logical bitstream, the number should equal <tt>length</tt>. At the end of a logical bitstream, the number of bytes read will equal the remaining number of bytes in the bitstream.</li>
80 <p><b>Typical usage:</b> <tt>bytes_read = ov_read(&vf, buffer, 4096,0,2,1,&current_section)</tt>
81 <br>This reads up to 4096 bytes into a buffer, with signed 16-bit little-endian
86 <table border=0 width=100%>
88 <td><p class=tiny>copyright © 2000 vorbis team</p></td>
89 <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>
91 <td><p class=tiny>vorbisfile documentation</p></td>
92 <td align=right><p class=tiny>vorbisfile version 1.25 - 20000615</p></td>