annotate src/libvorbis-1.3.3/doc/vorbisfile/decoding.html @ 86:98c1576536ae

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