]> git.jsancho.org Git - lugaru.git/blob - libvorbis-1.0.1/doc/vorbisfile/chaining_example_c.html
First shot at an OpenAL renderer. Sound effects work, no music.
[lugaru.git] / libvorbis-1.0.1 / 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><b>
26
27 #include <vorbis/codec.h>
28 #include <vorbis/vorbisfile.h>
29
30 int main(){
31   OggVorbis_File ov;
32   int i;
33
34   /* open the file/pipe on stdin */
35   if(ov_open(stdin,&ov,NULL,-1)<0){
36     printf("Could not open input as an OggVorbis file.\n\n");
37     exit(1);
38   }
39   
40   /* print details about each logical bitstream in the input */
41   if(ov_seekable(&ov)){
42     printf("Input bitstream contained %ld logical bitstream section(s).\n",
43            ov_streams(&ov));
44     printf("Total bitstream playing time: %ld seconds\n\n",
45            (long)ov_time_total(&ov,-1));
46
47   }else{
48     printf("Standard input was not seekable.\n"
49            "First logical bitstream information:\n\n");
50   }
51
52   for(i=0;i<ov_streams(&ov);i++){
53     vorbis_info *vi=ov_info(&ov,i);
54     printf("\tlogical bitstream section %d information:\n",i+1);
55     printf("\t\t%ldHz %d channels bitrate %ldkbps serial number=%ld\n",
56            vi->rate,vi->channels,ov_bitrate(&ov,i)/1000,
57            ov_serialnumber(&ov,i));
58     printf("\t\tcompressed length: %ld bytes ",(long)(ov_raw_total(&ov,i)));
59     printf(" play time: %lds\n",(long)ov_time_total(&ov,i));
60   }
61
62   ov_clear(&ov);
63   return 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; 2003 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>