CODE
#include <vorbis/vorbisfile.h>
int main (int argc, char** argv)
{
FILE* fp;
OggVorbis_File vf;
vorbis_info* vi;
vorbis_comment* vc;
double duration;
long bitrate;
if ( (fp = fopen ( argv[1], "rb" )) == NULL ) {
return 1;
}
if ( ov_open (fp, &vf, NULL, 0 ) != 0 ) {
return 1;
}
vi = ov_info ( &vf, -1 );
duration = ov_time_total ( &vf, -1 );
bitrate = ov_bitrate ( &vf, -1 );
vc = ov_comment ( &vf, -1 );
if ( duration == OV_EINVAL )
duration = 0;
if ( bitrate == OV_EINVAL || bitrate == OV_FALSE )
bitrate = 0;
ov_clear (&vf);
return 0;
}
This small sample may help, it reads bitrate and duration (copy / paste from tag)