add a more compact display

This commit is contained in:
tTh 2023-12-18 00:49:51 +01:00
parent 462d24b717
commit 123b97cce2
4 changed files with 21 additions and 9 deletions

View File

@ -4,7 +4,12 @@ Support utilities for SoundBrotching.
### wav2text ### wav2text
Conversion d'un fichier son en text machinable. Conversion d'un fichier son en texte machinable, actuellement
en *space separated*, directement utilisable par `Awk`.
Un export `csv` est planifié. Ce prgramme ne prend
pas (encore) d'options.
Usage : `wav2txt 1337.wav > fichier.txt`
### text2wav ### text2wav

View File

@ -10,14 +10,20 @@
#include "support.h" #include "support.h"
/* --------------------------------------------------------------- */ /* --------------------------------------------------------------- */
int display_sf_info(SF_INFO *psf, char *text) int display_sf_info(SF_INFO *psf, char *text, int bla)
{ {
if (bla) {
fprintf(stderr, " +-- sf info [%s] %p\n", text, psf); fprintf(stderr, " +-- sf info [%s] %p\n", text, psf);
fprintf(stderr, " | samplerate %d\n", psf->samplerate); fprintf(stderr, " | samplerate %d\n", psf->samplerate);
fprintf(stderr, " | channels %d\n", psf->channels); fprintf(stderr, " | channels %d\n", psf->channels);
fprintf(stderr, " | frames %ld\n", psf->frames); fprintf(stderr, " | frames %ld\n", psf->frames);
fprintf(stderr, " | format 0x%x\n", psf->format); fprintf(stderr, " | format 0x%x\n", psf->format);
}
else {
fprintf(stderr, "%-25s %6d %2d %10ld 0x%x\n", text, \
psf->samplerate, psf->channels, psf->frames, psf->format);
}
return 0; return 0;
} }

View File

@ -6,7 +6,7 @@
/* --------------------------------------------------------- */ /* --------------------------------------------------------- */
int display_sf_info(SF_INFO *psf, char *text); int display_sf_info(SF_INFO *psf, char *text, int bla);
void print_version(char *title); void print_version(char *title);

View File

@ -41,7 +41,7 @@ if (sndf==NULL)
exit(1); exit(1);
} }
foo = display_sf_info(&sfinfo, infname); foo = display_sf_info(&sfinfo, infname, 0);
if (foo) { if (foo) {
fprintf(stderr, "%s: corrupted sf_info ?\n", __func__); fprintf(stderr, "%s: corrupted sf_info ?\n", __func__);
abort(); abort();
@ -83,6 +83,7 @@ int main(int argc, char *argv[])
{ {
int foo; int foo;
int format = 0; int format = 0;
print_version(argv[0]); print_version(argv[0]);
if (2 != argc) usage(); if (2 != argc) usage();