I am trying to record audio using arecord
, encode it to .flac using the flac
tool, and then pipe it through a couple more processes (gzip, gpg, but irrelevant here).
If I write the result from flac
to file using the -o
parameter, everything works fine:
arecord -t raw -f S16_LE -r16000 -d 10 -D sysdefault:CARD=1 | flac - -f --endian little --sign signed --channels 1 --bps 16 --sample-rate 16000 -o test.flac
If I instead use the -c
parameter and redirect the output to a file:
arecord -t raw -f S16_LE -r16000 -d 10 -D sysdefault:CARD=1 | flac - -f --endian little --sign signed --channels 1 --bps 16 --sample-rate 16000 -c > test.flac
...the resulting file plays back fine (the sound works), but VLC does not display a length for the audio recording, and audacity starts an import process with a steadily increasing ETA of several hours and hangs on cancel.
The only difference between both commands is -o test.flac
vs -c > test.flac
. Why does this break the file?
If it makes a difference: flac 1.3.2, arecord 1.1.3, running on latest raspbian on a Pi3 with USB microphone.