sndfile-info.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. /*
  2. ** Copyright (C) 1999-2019 Erik de Castro Lopo <[email protected]>
  3. **
  4. ** All rights reserved.
  5. **
  6. ** Redistribution and use in source and binary forms, with or without
  7. ** modification, are permitted provided that the following conditions are
  8. ** met:
  9. **
  10. ** * Redistributions of source code must retain the above copyright
  11. ** notice, this list of conditions and the following disclaimer.
  12. ** * Redistributions in binary form must reproduce the above copyright
  13. ** notice, this list of conditions and the following disclaimer in
  14. ** the documentation and/or other materials provided with the
  15. ** distribution.
  16. ** * Neither the author nor the names of any contributors may be used
  17. ** to endorse or promote products derived from this software without
  18. ** specific prior written permission.
  19. **
  20. ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  22. ** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  23. ** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  24. ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. ** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  26. ** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  27. ** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. ** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  30. ** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. #include <stdio.h>
  33. #include <stdlib.h>
  34. #include <string.h>
  35. #include <inttypes.h>
  36. #include <ctype.h>
  37. #include <math.h>
  38. #include <sndfile.h>
  39. #include "common.h"
  40. #define BUFFER_LEN (1 << 16)
  41. #if (defined (WIN32) || defined (_WIN32))
  42. #include <windows.h>
  43. #endif
  44. static void usage_exit (const char *progname) ;
  45. static void info_dump (const char *filename) ;
  46. static int instrument_dump (const char *filename) ;
  47. static int broadcast_dump (const char *filename) ;
  48. static int chanmap_dump (const char *filename) ;
  49. static int cart_dump (const char *filename) ;
  50. static void total_dump (void) ;
  51. static double total_seconds = 0.0 ;
  52. int
  53. main (int argc, char *argv [])
  54. { int k ;
  55. if (argc < 2 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0)
  56. usage_exit (program_name (argv [0])) ;
  57. if (strcmp (argv [1], "--instrument") == 0)
  58. { int error = 0 ;
  59. for (k = 2 ; k < argc ; k++)
  60. error += instrument_dump (argv [k]) ;
  61. return error ;
  62. } ;
  63. if (strcmp (argv [1], "--broadcast") == 0)
  64. { int error = 0 ;
  65. for (k = 2 ; k < argc ; k++)
  66. error += broadcast_dump (argv [k]) ;
  67. return error ;
  68. } ;
  69. if (strcmp (argv [1], "--channel-map") == 0)
  70. { int error = 0 ;
  71. for (k = 2 ; k < argc ; k++)
  72. error += chanmap_dump (argv [k]) ;
  73. return error ;
  74. } ;
  75. if (strcmp (argv [1], "--cart") == 0)
  76. { int error = 0 ;
  77. for (k = 2 ; k < argc ; k++)
  78. error += cart_dump (argv [k]) ;
  79. return error ;
  80. } ;
  81. for (k = 1 ; k < argc ; k++)
  82. info_dump (argv [k]) ;
  83. if (argc > 2)
  84. total_dump () ;
  85. return 0 ;
  86. } /* main */
  87. /*==============================================================================
  88. ** Print version and usage.
  89. */
  90. static void
  91. usage_exit (const char *progname)
  92. { printf ("Usage :\n %s <file> ...\n", progname) ;
  93. printf (" Prints out information about one or more sound files.\n\n") ;
  94. printf (" %s --instrument <file>\n", progname) ;
  95. printf (" Prints out the instrument data for the given file.\n\n") ;
  96. printf (" %s --broadcast <file>\n", progname) ;
  97. printf (" Prints out the broadcast WAV info for the given file.\n\n") ;
  98. printf (" %s --channel-map <file>\n", progname) ;
  99. printf (" Prints out the channel map for the given file.\n\n") ;
  100. printf (" %s --cart <file>\n", progname) ;
  101. printf (" Prints out the cart chunk WAV info for the given file.\n\n") ;
  102. printf ("Using %s.\n\n", sf_version_string ()) ;
  103. #if (defined (_WIN32) || defined (WIN32))
  104. printf ("This is a Unix style command line application which\n"
  105. "should be run in a MSDOS box or Command Shell window.\n\n") ;
  106. printf ("Sleeping for 5 seconds before exiting.\n\n") ;
  107. fflush (stdout) ;
  108. Sleep (5 * 1000) ;
  109. #endif
  110. exit (1) ;
  111. } /* usage_exit */
  112. /*==============================================================================
  113. ** Dumping of sndfile info.
  114. */
  115. static double data [BUFFER_LEN] ;
  116. static double
  117. calc_decibels (SF_INFO * sfinfo, double max)
  118. { double decibels ;
  119. switch (sfinfo->format & SF_FORMAT_SUBMASK)
  120. { case SF_FORMAT_PCM_U8 :
  121. case SF_FORMAT_PCM_S8 :
  122. decibels = max / 0x80 ;
  123. break ;
  124. case SF_FORMAT_PCM_16 :
  125. decibels = max / 0x8000 ;
  126. break ;
  127. case SF_FORMAT_PCM_24 :
  128. decibels = max / 0x800000 ;
  129. break ;
  130. case SF_FORMAT_PCM_32 :
  131. decibels = max / 0x80000000 ;
  132. break ;
  133. case SF_FORMAT_FLOAT :
  134. case SF_FORMAT_DOUBLE :
  135. case SF_FORMAT_VORBIS :
  136. case SF_FORMAT_OPUS :
  137. decibels = max / 1.0 ;
  138. break ;
  139. default :
  140. decibels = max / 0x8000 ;
  141. break ;
  142. } ;
  143. return 20.0 * log10 (decibels) ;
  144. } /* calc_decibels */
  145. static const char *
  146. format_duration_str (double seconds)
  147. { static char str [128] ;
  148. int hrs, min ;
  149. double sec ;
  150. memset (str, 0, sizeof (str)) ;
  151. hrs = (int) (seconds / 3600.0) ;
  152. min = (int) ((seconds - (hrs * 3600.0)) / 60.0) ;
  153. sec = seconds - (hrs * 3600.0) - (min * 60.0) ;
  154. snprintf (str, sizeof (str) - 1, "%02d:%02d:%06.3f", hrs, min, sec) ;
  155. return str ;
  156. } /* format_duration_str */
  157. static const char *
  158. generate_duration_str (SF_INFO *sfinfo)
  159. {
  160. double seconds ;
  161. if (sfinfo->samplerate < 1)
  162. return NULL ;
  163. if (sfinfo->frames / sfinfo->samplerate > 0x7FFFFFFF)
  164. return "unknown" ;
  165. seconds = (1.0 * sfinfo->frames) / sfinfo->samplerate ;
  166. /* Accumulate the total of all known file durations */
  167. total_seconds += seconds ;
  168. return format_duration_str (seconds) ;
  169. } /* generate_duration_str */
  170. static void
  171. info_dump (const char *filename)
  172. { static char strbuffer [BUFFER_LEN] ;
  173. SNDFILE *file ;
  174. SF_INFO sfinfo ;
  175. double signal_max, decibels ;
  176. memset (&sfinfo, 0, sizeof (sfinfo)) ;
  177. if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
  178. { printf ("Error : Not able to open input file %s.\n", filename) ;
  179. fflush (stdout) ;
  180. memset (data, 0, sizeof (data)) ;
  181. sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ;
  182. puts (strbuffer) ;
  183. puts (sf_strerror (NULL)) ;
  184. return ;
  185. } ;
  186. printf ("========================================\n") ;
  187. sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ;
  188. puts (strbuffer) ;
  189. printf ("----------------------------------------\n") ;
  190. printf ("Sample Rate : %d\n", sfinfo.samplerate) ;
  191. if (sfinfo.frames == SF_COUNT_MAX)
  192. printf ("Frames : unknown\n") ;
  193. else
  194. printf ("Frames : %" PRId64 "\n", sfinfo.frames) ;
  195. printf ("Channels : %d\n", sfinfo.channels) ;
  196. printf ("Format : 0x%08X\n", sfinfo.format) ;
  197. printf ("Sections : %d\n", sfinfo.sections) ;
  198. printf ("Seekable : %s\n", (sfinfo.seekable ? "TRUE" : "FALSE")) ;
  199. printf ("Duration : %s\n", generate_duration_str (&sfinfo)) ;
  200. if (sfinfo.frames < 100 * 1024 * 1024)
  201. { /* Do not use sf_signal_max because it doesn't work for non-seekable files . */
  202. sf_command (file, SFC_CALC_SIGNAL_MAX, &signal_max, sizeof (signal_max)) ;
  203. decibels = calc_decibels (&sfinfo, signal_max) ;
  204. printf ("Signal Max : %g (%4.2f dB)\n", signal_max, decibels) ;
  205. } ;
  206. putchar ('\n') ;
  207. sf_close (file) ;
  208. } /* info_dump */
  209. /*==============================================================================
  210. ** Dumping of SF_INSTRUMENT data.
  211. */
  212. static const char *
  213. str_of_type (int mode)
  214. { switch (mode)
  215. { case SF_LOOP_NONE : return "none" ;
  216. case SF_LOOP_FORWARD : return "fwd " ;
  217. case SF_LOOP_BACKWARD : return "back" ;
  218. case SF_LOOP_ALTERNATING : return "alt " ;
  219. default : break ;
  220. } ;
  221. return "????" ;
  222. } /* str_of_mode */
  223. static int
  224. instrument_dump (const char *filename)
  225. { SNDFILE *file ;
  226. SF_INFO sfinfo ;
  227. SF_INSTRUMENT inst ;
  228. int got_inst, k ;
  229. memset (&sfinfo, 0, sizeof (sfinfo)) ;
  230. if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
  231. { printf ("Error : Not able to open input file %s.\n", filename) ;
  232. fflush (stdout) ;
  233. memset (data, 0, sizeof (data)) ;
  234. puts (sf_strerror (NULL)) ;
  235. return 1 ;
  236. } ;
  237. got_inst = sf_command (file, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) ;
  238. sf_close (file) ;
  239. if (got_inst == SF_FALSE)
  240. { printf ("Error : File '%s' does not contain instrument data.\n\n", filename) ;
  241. return 1 ;
  242. } ;
  243. printf ("Instrument : %s\n\n", filename) ;
  244. printf (" Gain : %d\n", inst.gain) ;
  245. printf (" Base note : %d\n", inst.basenote) ;
  246. printf (" Velocity : %d - %d\n", (int) inst.velocity_lo, (int) inst.velocity_hi) ;
  247. printf (" Key : %d - %d\n", (int) inst.key_lo, (int) inst.key_hi) ;
  248. printf (" Loop points : %d\n", inst.loop_count) ;
  249. for (k = 0 ; k < inst.loop_count ; k++)
  250. printf (" %-2d Mode : %s Start : %6" PRIu32 " End : %6" PRIu32
  251. " Count : %6" PRIu32 "\n", k, str_of_type (inst.loops [k].mode),
  252. inst.loops [k].start, inst.loops [k].end, inst.loops [k].count) ;
  253. putchar ('\n') ;
  254. return 0 ;
  255. } /* instrument_dump */
  256. static int
  257. broadcast_dump (const char *filename)
  258. { SNDFILE *file ;
  259. SF_INFO sfinfo ;
  260. SF_BROADCAST_INFO_2K bext ;
  261. double time_ref_sec ;
  262. int got_bext ;
  263. memset (&sfinfo, 0, sizeof (sfinfo)) ;
  264. if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
  265. { printf ("Error : Not able to open input file %s.\n", filename) ;
  266. fflush (stdout) ;
  267. memset (data, 0, sizeof (data)) ;
  268. puts (sf_strerror (NULL)) ;
  269. return 1 ;
  270. } ;
  271. memset (&bext, 0, sizeof (SF_BROADCAST_INFO_2K)) ;
  272. got_bext = sf_command (file, SFC_GET_BROADCAST_INFO, &bext, sizeof (bext)) ;
  273. sf_close (file) ;
  274. if (got_bext == SF_FALSE)
  275. { printf ("Error : File '%s' does not contain broadcast information.\n\n", filename) ;
  276. return 1 ;
  277. } ;
  278. /*
  279. ** From : http://www.ebu.ch/en/technical/publications/userguides/bwf_user_guide.php
  280. **
  281. ** Time Reference:
  282. ** This field is a count from midnight in samples to the first sample
  283. ** of the audio sequence.
  284. */
  285. time_ref_sec = ((pow (2.0, 32) * bext.time_reference_high) + (1.0 * bext.time_reference_low)) / sfinfo.samplerate ;
  286. printf ("Description : %.*s\n", (int) sizeof (bext.description), bext.description) ;
  287. printf ("Originator : %.*s\n", (int) sizeof (bext.originator), bext.originator) ;
  288. printf ("Origination ref : %.*s\n", (int) sizeof (bext.originator_reference), bext.originator_reference) ;
  289. printf ("Origination date : %.*s\n", (int) sizeof (bext.origination_date), bext.origination_date) ;
  290. printf ("Origination time : %.*s\n", (int) sizeof (bext.origination_time), bext.origination_time) ;
  291. if (bext.time_reference_high == 0 && bext.time_reference_low == 0)
  292. printf ("Time ref : 0\n") ;
  293. else
  294. printf ("Time ref : 0x%x%08x (%.6f seconds)\n", bext.time_reference_high, bext.time_reference_low, time_ref_sec) ;
  295. printf ("BWF version : %d\n", bext.version) ;
  296. if (bext.version >= 1)
  297. printf ("UMID : %.*s\n", (int) sizeof (bext.umid), bext.umid) ;
  298. if (bext.version >= 2)
  299. { /* 0x7fff shall be used to designate an unused value */
  300. /* valid range: -99.99 .. 99.99 */
  301. printf ("Loudness value : %6.2f LUFS\n", bext.loudness_value / 100.0) ;
  302. /* valid range: 0.00 .. 99.99 */
  303. printf ("Loudness range : %6.2f LU\n", bext.loudness_range / 100.0) ;
  304. /* valid range: -99.99 .. 99.99 */
  305. printf ("Max. true peak level : %6.2f dBTP\n", bext.max_true_peak_level / 100.0) ;
  306. printf ("Max. momentary loudness : %6.2f LUFS\n", bext.max_momentary_loudness / 100.0) ;
  307. printf ("Max. short term loudness : %6.2f LUFS\n", bext.max_shortterm_loudness / 100.0) ;
  308. } ;
  309. printf ("Coding history : %.*s\n", bext.coding_history_size, bext.coding_history) ;
  310. return 0 ;
  311. } /* broadcast_dump */
  312. static int
  313. chanmap_dump (const char *filename)
  314. { SNDFILE *file ;
  315. SF_INFO sfinfo ;
  316. int * channel_map ;
  317. int got_chanmap, k ;
  318. memset (&sfinfo, 0, sizeof (sfinfo)) ;
  319. if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
  320. { printf ("Error : Not able to open input file %s.\n", filename) ;
  321. fflush (stdout) ;
  322. memset (data, 0, sizeof (data)) ;
  323. puts (sf_strerror (NULL)) ;
  324. return 1 ;
  325. } ;
  326. if ((channel_map = calloc (sfinfo.channels, sizeof (int))) == NULL)
  327. { printf ("Error : malloc failed.\n\n") ;
  328. return 1 ;
  329. } ;
  330. got_chanmap = sf_command (file, SFC_GET_CHANNEL_MAP_INFO, channel_map, sfinfo.channels * sizeof (int)) ;
  331. sf_close (file) ;
  332. if (got_chanmap == SF_FALSE)
  333. { printf ("Error : File '%s' does not contain channel map information.\n\n", filename) ;
  334. free (channel_map) ;
  335. return 1 ;
  336. } ;
  337. printf ("File : %s\n\n", filename) ;
  338. puts (" Chan Position") ;
  339. for (k = 0 ; k < sfinfo.channels ; k ++)
  340. { const char * name ;
  341. #define CASE_NAME(x) case x : name = #x ; break ;
  342. switch (channel_map [k])
  343. { CASE_NAME (SF_CHANNEL_MAP_INVALID) ;
  344. CASE_NAME (SF_CHANNEL_MAP_MONO) ;
  345. CASE_NAME (SF_CHANNEL_MAP_LEFT) ;
  346. CASE_NAME (SF_CHANNEL_MAP_RIGHT) ;
  347. CASE_NAME (SF_CHANNEL_MAP_CENTER) ;
  348. CASE_NAME (SF_CHANNEL_MAP_FRONT_LEFT) ;
  349. CASE_NAME (SF_CHANNEL_MAP_FRONT_RIGHT) ;
  350. CASE_NAME (SF_CHANNEL_MAP_FRONT_CENTER) ;
  351. CASE_NAME (SF_CHANNEL_MAP_REAR_CENTER) ;
  352. CASE_NAME (SF_CHANNEL_MAP_REAR_LEFT) ;
  353. CASE_NAME (SF_CHANNEL_MAP_REAR_RIGHT) ;
  354. CASE_NAME (SF_CHANNEL_MAP_LFE) ;
  355. CASE_NAME (SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER) ;
  356. CASE_NAME (SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER) ;
  357. CASE_NAME (SF_CHANNEL_MAP_SIDE_LEFT) ;
  358. CASE_NAME (SF_CHANNEL_MAP_SIDE_RIGHT) ;
  359. CASE_NAME (SF_CHANNEL_MAP_TOP_CENTER) ;
  360. CASE_NAME (SF_CHANNEL_MAP_TOP_FRONT_LEFT) ;
  361. CASE_NAME (SF_CHANNEL_MAP_TOP_FRONT_RIGHT) ;
  362. CASE_NAME (SF_CHANNEL_MAP_TOP_FRONT_CENTER) ;
  363. CASE_NAME (SF_CHANNEL_MAP_TOP_REAR_LEFT) ;
  364. CASE_NAME (SF_CHANNEL_MAP_TOP_REAR_RIGHT) ;
  365. CASE_NAME (SF_CHANNEL_MAP_TOP_REAR_CENTER) ;
  366. CASE_NAME (SF_CHANNEL_MAP_MAX) ;
  367. default : name = "default" ;
  368. break ;
  369. } ;
  370. printf (" %3d %s\n", k, name) ;
  371. } ;
  372. putchar ('\n') ;
  373. free (channel_map) ;
  374. return 0 ;
  375. } /* chanmap_dump */
  376. static int
  377. cart_dump (const char *filename)
  378. { SNDFILE *file ;
  379. SF_INFO sfinfo ;
  380. SF_CART_INFO_VAR (1024) cart ;
  381. int got_cart, k ;
  382. memset (&sfinfo, 0, sizeof (sfinfo)) ;
  383. memset (&cart, 0, sizeof (cart)) ;
  384. if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
  385. { printf ("Error : Not able to open input file %s.\n", filename) ;
  386. fflush (stdout) ;
  387. memset (data, 0, sizeof (data)) ;
  388. puts (sf_strerror (NULL)) ;
  389. return 1 ;
  390. } ;
  391. got_cart = sf_command (file, SFC_GET_CART_INFO, &cart, sizeof (cart)) ;
  392. sf_close (file) ;
  393. if (got_cart == SF_FALSE)
  394. { printf ("Error : File '%s' does not contain cart information.\n\n", filename) ;
  395. return 1 ;
  396. } ;
  397. printf ("Version : %.*s\n", (int) sizeof (cart.version), cart.version) ;
  398. printf ("Title : %.*s\n", (int) sizeof (cart.title), cart.title) ;
  399. printf ("Artist : %.*s\n", (int) sizeof (cart.artist), cart.artist) ;
  400. printf ("Cut id : %.*s\n", (int) sizeof (cart.cut_id), cart.cut_id) ;
  401. printf ("Category : %.*s\n", (int) sizeof (cart.category), cart.category) ;
  402. printf ("Classification : %.*s\n", (int) sizeof (cart.classification), cart.classification) ;
  403. printf ("Out cue : %.*s\n", (int) sizeof (cart.out_cue), cart.out_cue) ;
  404. printf ("Start date : %.*s\n", (int) sizeof (cart.start_date), cart.start_date) ;
  405. printf ("Start time : %.*s\n", (int) sizeof (cart.start_time), cart.start_time) ;
  406. printf ("End date : %.*s\n", (int) sizeof (cart.end_date), cart.end_date) ;
  407. printf ("End time : %.*s\n", (int) sizeof (cart.end_time), cart.end_time) ;
  408. printf ("App id : %.*s\n", (int) sizeof (cart.producer_app_id), cart.producer_app_id) ;
  409. printf ("App version : %.*s\n", (int) sizeof (cart.producer_app_version), cart.producer_app_version) ;
  410. printf ("User defined : %.*s\n", (int) sizeof (cart.user_def), cart.user_def) ;
  411. printf ("Level ref. : %d\n", cart.level_reference) ;
  412. printf ("Post timers :\n") ;
  413. for (k = 0 ; k < ARRAY_LEN (cart.post_timers) ; k++)
  414. if (cart.post_timers [k].usage [0])
  415. printf (" %d %.*s %d\n", k, (int) sizeof (cart.post_timers [k].usage), cart.post_timers [k].usage, cart.post_timers [k].value) ;
  416. printf ("Reserved : %.*s\n", (int) sizeof (cart.reserved), cart.reserved) ;
  417. printf ("Url : %.*s\n", (int) sizeof (cart.url), cart.url) ;
  418. printf ("Tag text : %.*s\n", cart.tag_text_size, cart.tag_text) ;
  419. return 0 ;
  420. } /* cart_dump */
  421. static void
  422. total_dump (void)
  423. { printf ("========================================\n") ;
  424. printf ("Total Duration : %s\n", format_duration_str (total_seconds)) ;
  425. } /* total_dump */