mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-23 03:06:30 +01:00
aplay: print vu-meter to stderr, not stdout
It allows showing the vu-meter while recording to stdout, eg: aplay -C -V stereo | oggenc - > out.ogg Signed-off-by: Jerome Carretero <cJ@zougloub.eu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
f7eb87ddc7
commit
6bbeb78dba
1 changed files with 7 additions and 7 deletions
|
@ -1453,9 +1453,9 @@ static void print_vu_meter_mono(int perc, int maxperc)
|
||||||
sprintf(line + val, "| MAX");
|
sprintf(line + val, "| MAX");
|
||||||
else
|
else
|
||||||
sprintf(line + val, "| %02i%%", maxperc);
|
sprintf(line + val, "| %02i%%", maxperc);
|
||||||
fputs(line, stdout);
|
fputs(line, stderr);
|
||||||
if (perc > 100)
|
if (perc > 100)
|
||||||
printf(_(" !clip "));
|
fprintf(stderr, _(" !clip "));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_vu_meter_stereo(int *perc, int *maxperc)
|
static void print_vu_meter_stereo(int *perc, int *maxperc)
|
||||||
|
@ -1493,7 +1493,7 @@ static void print_vu_meter_stereo(int *perc, int *maxperc)
|
||||||
memcpy(line + bar_length, tmp, 3);
|
memcpy(line + bar_length, tmp, 3);
|
||||||
}
|
}
|
||||||
line[bar_length * 2 + 6 + 2] = 0;
|
line[bar_length * 2 + 6 + 2] = 0;
|
||||||
fputs(line, stdout);
|
fputs(line, stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_vu_meter(signed int *perc, signed int *maxperc)
|
static void print_vu_meter(signed int *perc, signed int *maxperc)
|
||||||
|
@ -1631,9 +1631,9 @@ static void compute_max_peak(u_char *data, size_t count)
|
||||||
if (perc[c] > maxperc[c])
|
if (perc[c] > maxperc[c])
|
||||||
maxperc[c] = perc[c];
|
maxperc[c] = perc[c];
|
||||||
|
|
||||||
putchar('\r');
|
putc('\r', stderr);
|
||||||
print_vu_meter(perc, maxperc);
|
print_vu_meter(perc, maxperc);
|
||||||
fflush(stdout);
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
else if(verbose==3) {
|
else if(verbose==3) {
|
||||||
printf(_("Max peak (%li samples): 0x%08x "), (long)ocount, max_peak[0]);
|
printf(_("Max peak (%li samples): 0x%08x "), (long)ocount, max_peak[0]);
|
||||||
|
@ -1642,8 +1642,8 @@ static void compute_max_peak(u_char *data, size_t count)
|
||||||
putchar('#');
|
putchar('#');
|
||||||
else
|
else
|
||||||
putchar(' ');
|
putchar(' ');
|
||||||
printf(" %i%%\n", perc[0]);
|
fprintf(stderr, " %i%%\n", perc[0]);
|
||||||
fflush(stdout);
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue