ov_read_float() was missing from this reference to vorbisfile functions, as
[platform/upstream/libvorbis.git] / doc / vorbisfile / chaining_example_c.html
1 <html>
2
3 <head>
4 <title>vorbisfile - chaining_example.c</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>Vorbisfile documentation</p></td>
12 <td align=right><p class=tiny>vorbisfile version 1.68 - 20030307</p></td>
13 </tr>
14 </table>
15
16 <h1>chaining_example.c</h1>
17
18 <p>
19 The example program source:
20
21 <br><br>
22 <table border=0 width=100% color=black cellspacing=0 cellpadding=7>
23 <tr bgcolor=#cccccc>
24         <td>
25 <pre width="80"><b>
26
27 <font color="#A020F0">#include &lt;vorbis/codec.h&gt;</font>
28 <font color="#A020F0">#include &lt;vorbis/vorbisfile.h&gt;</font>
29
30 <strong><font color="#4169E1"><a name="main"></a>int main()</font></strong>{
31   OggVorbis_File ov;
32   int i;
33
34   <font color="#B22222">/* open the file/pipe on stdin */</font>
35   <font color="#4169E1">if</font>(ov_open(stdin,&amp;ov,NULL,-1)&lt;0){
36     printf(<font color="#666666">"Could not open input as an OggVorbis file.\n\n"</font>);
37     exit(1);
38   }
39   
40   <font color="#B22222">/* print details about each logical bitstream in the input */</font>
41   <font color="#4169E1">if</font>(ov_seekable(&amp;ov)){
42     printf(<font color="#666666">"Input bitstream contained %ld logical bitstream section(s).\n"</font>,
43            ov_streams(&amp;ov));
44     printf(<font color="#666666">"Total bitstream playing time: %ld seconds\n\n"</font>,
45            (long)ov_time_total(&amp;ov,-1));
46
47   }<font color="#4169E1">else</font>{
48     printf(<font color="#666666">"Standard input was not seekable.\n"</font>
49            <font color="#666666">"First logical bitstream information:\n\n"</font>);
50   }
51
52   <font color="#4169E1">for</font>(i=0;i&lt;ov_streams(&amp;ov);i++){
53     vorbis_info *vi=ov_info(&amp;ov,i);
54     printf(<font color="#666666">"\tlogical bitstream section %d information:\n"</font>,i+1);
55     printf(<font color="#666666">"\t\t%ldHz %d channels bitrate %ldkbps serial number=%ld\n"</font>,
56            vi-&gt;rate,vi-&gt;channels,ov_bitrate(&amp;ov,i)/1000,
57            ov_serialnumber(&amp;ov,i));
58     printf(<font color="#666666">"\t\tcompressed length: %ld bytes "</font>,(long)(ov_raw_total(&amp;ov,i)));
59     printf(<font color="#666666">" play time: %lds\n"</font>,(long)ov_time_total(&amp;ov,i));
60   }
61
62   ov_clear(&amp;ov);
63   <font color="#4169E1">return</font> 0;
64 }
65
66 </b></pre>
67         </td>
68 </tr>
69 </table>
70
71
72 <br><br>
73 <hr noshade>
74 <table border=0 width=100%>
75 <tr valign=top>
76 <td><p class=tiny>copyright &copy; 2004 Xiph.org</p></td>
77 <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>
78 </tr><tr>
79 <td><p class=tiny>Vorbisfile documentation</p></td>
80 <td align=right><p class=tiny>vorbisfile version 1.68 - 20030307</p></td>
81 </tr>
82 </table>
83
84 </body>
85
86 </html>