<html>
<head>
-<title>vorbisfile - Example Code</title>
+<title>Vorbisfile - Example Code</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>libVorbisfile version 1.65 - 20020702</p></td>
</tr>
</table>
<p>
The following is a run-through of the decoding example program supplied
-with vorbisfile - <a href="vorbisfile_example_c.html">vorbisfile_example.c</a>.
+with libvorbisfile, vorbisfile_example.c.
This program takes a vorbis bitstream from stdin and writes raw pcm to stdout.
<p>
-First, relevant headers, including vorbis-specific "codec.h" and "vorbisfile.h" have to be included.
+First, relevant headers, including vorbis-specific "vorbis/codec.h" and "vorbisfile.h" have to be included.
<br><br>
<table border=0 width=100% color=black cellspacing=0 cellpadding=7>
#include <stdlib.h>
#include <math.h>
#include "vorbis/codec.h"
-#include "vorbis/vorbisfile.h"
+#include "vorbisfile.h"
</b></pre>
</td>
</tr>
++ptr;
}
fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
+ fprintf(stderr,"\nDecoded length: %ld samples\n",
+ (long)ov_pcm_total(&vf,-1));
fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
}
<pre><b>
while(!eof){
- long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,¤t_section);
+ long ret=ov_read(&vf,pcmout,sizeof(pcmout),¤t_section);
if (ret == 0) {
/* EOF */
eof=1;
</table>
<p>
-The full source for vorbisfile_example.c can be found with the vorbis
-distribution in <a href="vorbisfile_example_c.html">vorbisfile_example.c</a>.
<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/">Ogg Vorbis</a><br><a href="mailto:team@vorbis.org">team@vorbis.org</a></p></td>
+<td><p class=tiny>copyright © 2002 Xiph.org</p></td>
+<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/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>libVorbisfile version 1.65 - 20020702</p></td>
</tr>
</table>