mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
examples/sndfile-info.c : Print out the BEXT time reference in a sensible format.
This commit is contained in:
parent
577345d11d
commit
4d7c4616d3
@ -327,6 +327,7 @@ broadcast_dump (const char *filename)
|
||||
{ SNDFILE *file ;
|
||||
SF_INFO sfinfo ;
|
||||
SF_BROADCAST_INFO bext ;
|
||||
double time_usec ;
|
||||
int got_bext ;
|
||||
|
||||
memset (&sfinfo, 0, sizeof (sfinfo)) ;
|
||||
@ -349,11 +350,27 @@ broadcast_dump (const char *filename)
|
||||
return ;
|
||||
} ;
|
||||
|
||||
/*
|
||||
** From : http://www.ebu.ch/en/technical/publications/userguides/bwf_user_guide.php
|
||||
**
|
||||
** Time Reference:
|
||||
** This field is a count from midnight in samples to the first sample
|
||||
** of the audio sequence.
|
||||
*/
|
||||
|
||||
time_usec = ((pow (2.0, 32) * bext.time_reference_high) + (1.0 * bext.time_reference_low)) / sfinfo.samplerate / 1e6 ;
|
||||
|
||||
printf ("Description : %.*s\n", (int) sizeof (bext.description), bext.description) ;
|
||||
printf ("Originator : %.*s\n", (int) sizeof (bext.originator), bext.originator) ;
|
||||
printf ("Origination ref : %.*s\n", (int) sizeof (bext.originator_reference), bext.originator_reference) ;
|
||||
printf ("Origination date : %.*s\n", (int) sizeof (bext.origination_date), bext.origination_date) ;
|
||||
printf ("Origination time : %.*s\n", (int) sizeof (bext.origination_time), bext.origination_time) ;
|
||||
|
||||
if (bext.time_reference_high == 0 && bext.time_reference_low == 0)
|
||||
printf ("Time ref : 0\n") ;
|
||||
else
|
||||
printf ("Time ref : 0x%x%08x (%.4f microseconds)\n", bext.time_reference_high, bext.time_reference_low, time_usec) ;
|
||||
|
||||
printf ("BWF version : %d\n", bext.version) ;
|
||||
printf ("UMID : %.*s\n", (int) sizeof (bext.umid), bext.umid) ;
|
||||
printf ("Coding history : %.*s\n", bext.coding_history_size, bext.coding_history) ;
|
||||
|
Loading…
Reference in New Issue
Block a user