| 1 |
<html> |
| 2 |
|
| 3 |
<head> |
| 4 |
<title>Tremor - 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>Tremor documentation</p></td> |
| 12 |
<td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td> |
| 13 |
</tr> |
| 14 |
</table> |
| 15 |
|
| 16 |
<h1>Decoding</h1> |
| 17 |
|
| 18 |
<p> |
| 19 |
All libivorbisdec decoding routines are declared in "ivorbisfile.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 |
</table> |
| 67 |
|
| 68 |
<br><br> |
| 69 |
<hr noshade> |
| 70 |
<table border=0 width=100%> |
| 71 |
<tr valign=top> |
| 72 |
<td><p class=tiny>copyright © 2002 Xiph.org</p></td> |
| 73 |
<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td> |
| 74 |
</tr><tr> |
| 75 |
<td><p class=tiny>Tremor documentation</p></td> |
| 76 |
<td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td> |
| 77 |
</tr> |
| 78 |
</table> |
| 79 |
|
| 80 |
</body> |
| 81 |
|
| 82 |
</html> |