123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <html>
- <head>
- <title>vorbisfile - chaining_example.c</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>
- </tr>
- </table>
- <h1>chaining_example.c</h1>
- <p>
- The example program source:
- <br><br>
- <table border=0 width=100% color=black cellspacing=0 cellpadding=7>
- <tr bgcolor=#cccccc>
- <td>
- <pre><b>
- #include <vorbis/codec.h>
- #include <vorbis/vorbisfile.h>
- int main(){
- OggVorbis_File ov;
- int i;
- /* open the file/pipe on stdin */
- if(ov_open(stdin,&ov,NULL,-1)<0){
- printf("Could not open input as an OggVorbis file.\n\n");
- exit(1);
- }
-
- /* print details about each logical bitstream in the input */
- if(ov_seekable(&ov)){
- printf("Input bitstream contained %ld logical bitstream section(s).\n",
- ov_streams(&ov));
- printf("Total bitstream playing time: %ld seconds\n\n",
- (long)ov_time_total(&ov,-1));
- }else{
- printf("Standard input was not seekable.\n"
- "First logical bitstream information:\n\n");
- }
- for(i=0;i<ov_streams(&ov);i++){
- vorbis_info *vi=ov_info(&ov,i);
- printf("\tlogical bitstream section %d information:\n",i+1);
- printf("\t\t%ldHz %d channels bitrate %ldkbps serial number=%ld\n",
- vi->rate,vi->channels,ov_bitrate(&ov,i)/1000,
- ov_serialnumber(&ov,i));
- printf("\t\tcompressed length: %ld bytes ",(long)(ov_raw_total(&ov,i)));
- printf(" play time: %lds\n",(long)ov_time_total(&ov,i));
- }
- ov_clear(&ov);
- return 0;
- }
- </b></pre>
- </td>
- </tr>
- </table>
- <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/index.html">Ogg Vorbis</a><br><a href="mailto:team@vorbis.org">team@vorbis.org</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>
- </tr>
- </table>
- </body>
- </html>
|