mpg123 logo
download : svn :: features :: sf.net project - bug tracker :: news archive
libmpg123 API :: testing :: benchmarking :: faq :: links :: contact
Note: This API doc is automatically generated from the current development version that you can get via Subversion or as a daily snapshot from http://mpg123.org/snapshot. There may be differences (additions) compared to the latest stable release. See NEWS.libmpg123 and the overall NEWS file on libmpg123 versions and important changes between them.
Let me emphasize that the policy for libmpg123 is to always stay backwards compatible -- only additions are planned (and it's not yet planned to change the plans;-).

scan.c

Go to the documentation of this file.
00001 /*
00002         scan: Estimate length (sample count) of a mpeg file and compare to length from exact scan.
00003 
00004         copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
00005         see COPYING and AUTHORS files in distribution or http://mpg123.org
00006         initially written by Thomas Orgis
00007 */
00008 
00009 /* Note the lack of error checking here.
00010    While it would be nicer to inform the user about troubles, libmpg123 is designed _not_ to bite you on operations with invalid handles , etc.
00011   You just jet invalid results on invalid operations... */
00012 
00013 #include <mpg123.h>
00014 #include <stdio.h>
00015 
00016 int main(int argc, char **argv)
00017 {
00018         mpg123_handle *m;
00019         int i;
00020         if(argc < 2)
00021         {
00022                 fprintf(stderr, "\nI will give you the estimated and exact sample lengths of MPEG audio files.\n");
00023                 fprintf(stderr, "\nUsage: %s <mpeg audio file list>\n\n", argv[0]);
00024                 return -1;
00025         }
00026         mpg123_init();
00027         m = mpg123_new(NULL, NULL);
00028         mpg123_param(m, MPG123_RESYNC_LIMIT, -1, 0); /* New in library version 0.0.1 . */
00029         for(i = 1; i < argc; ++i)
00030         {
00031                 off_t a, b;
00032                 mpg123_open(m, argv[i]);
00033                 a = mpg123_length(m);
00034                 mpg123_scan(m);
00035                 b = mpg123_length(m);
00036                 printf("File %i: estimated %li vs. scanned %li\n", i, (long)a, (long)b);
00037         }
00038         mpg123_delete(m);
00039         mpg123_exit();
00040         return 0;
00041 }

Generated on Mon Dec 29 23:37:35 2008 for libmpg123 by  doxygen 1.5.4