4 <title>vorbisfile - chaining_example.c</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.68 - 20030307</p></td>
16 <h1>chaining_example.c</h1>
19 The example program source:
22 <table border=0 width=100% color=black cellspacing=0 cellpadding=7>
27 <font color="#A020F0">#include <vorbis/codec.h></font>
28 <font color="#A020F0">#include <vorbis/vorbisfile.h></font>
30 <strong><font color="#4169E1"><a name="main"></a>int main()</font></strong>{
34 <font color="#B22222">/* open the file/pipe on stdin */</font>
35 <font color="#4169E1">if</font>(ov_open(stdin,&ov,NULL,-1)<0){
36 printf(<font color="#666666">"Could not open input as an OggVorbis file.\n\n"</font>);
40 <font color="#B22222">/* print details about each logical bitstream in the input */</font>
41 <font color="#4169E1">if</font>(ov_seekable(&ov)){
42 printf(<font color="#666666">"Input bitstream contained %ld logical bitstream section(s).\n"</font>,
44 printf(<font color="#666666">"Total bitstream playing time: %ld seconds\n\n"</font>,
45 (long)ov_time_total(&ov,-1));
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>);
52 <font color="#4169E1">for</font>(i=0;i<ov_streams(&ov);i++){
53 vorbis_info *vi=ov_info(&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->rate,vi->channels,ov_bitrate(&ov,i)/1000,
57 ov_serialnumber(&ov,i));
58 printf(<font color="#666666">"\t\tcompressed length: %ld bytes "</font>,(long)(ov_raw_total(&ov,i)));
59 printf(<font color="#666666">" play time: %lds\n"</font>,(long)ov_time_total(&ov,i));
63 <font color="#4169E1">return</font> 0;
74 <table border=0 width=100%>
76 <td><p class=tiny>copyright © 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>
79 <td><p class=tiny>Vorbisfile documentation</p></td>
80 <td align=right><p class=tiny>vorbisfile version 1.68 - 20030307</p></td>