From 74f4b1bc3b627ba4c7e03498234d88cacdfbe97b Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 29 Sep 2021 22:52:49 +0200 Subject: Squashed 'vorbis/' content from commit d22c3ab5f git-subtree-dir: vorbis git-subtree-split: d22c3ab5f633460abc2532feee60ca0892134cbf --- doc/vorbisfile/chaining_example_c.html | 90 ++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 doc/vorbisfile/chaining_example_c.html (limited to 'doc/vorbisfile/chaining_example_c.html') diff --git a/doc/vorbisfile/chaining_example_c.html b/doc/vorbisfile/chaining_example_c.html new file mode 100644 index 0000000..e40689c --- /dev/null +++ b/doc/vorbisfile/chaining_example_c.html @@ -0,0 +1,90 @@ + + + +vorbisfile - chaining_example.c + + + + + + + + + +

Vorbisfile documentation

vorbisfile version 1.3.2 - 20101101

+ +

chaining_example.c

+ +

+The example program source: + +

+ + + + +
+

+
+#include <vorbis/codec.h>
+#include <vorbis/vorbisfile.h>
+
+int main(){
+  OggVorbis_File ov;
+  int i;
+
+#ifdef _WIN32 /* We need to set stdin to binary mode on windows. */
+  _setmode( _fileno( stdin ), _O_BINARY );
+#endif
+
+  /* open the file/pipe on stdin */
+  if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)<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;
+}
+
+
+
+ + +

+


+ + + + + + + + +

copyright © 2000-2010 Xiph.Org

Ogg Vorbis

Vorbisfile documentation

vorbisfile version 1.3.2 - 20101101

+ + + + -- cgit v1.1