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;-).
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
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);
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 }