Re:Pipes and Filters
by icebraining on Wednesday September 17, 2014 @05:44AM
(#8329267)
There's also buffer(1). I found it because it never occurred to me to use dd for that! Nice tip.
So what would that look like? Makes sense, but dd has a lot of options, and I haven't fiddled with it much.
Recording 48Khz, raw, piping through a five second buffer, encode to flac and dump on a USB stick:
arecord -D hw:1,0 -v --fatal-errors --buffer-size=192000 -f dat -t raw | dd bs=480000 | flac --endian=little --channels=2 --bps=16 --sample-rate=48000 --sign=signed -o /mnt/usbstick/`date '+%s'`.flac -
Gotta love Linux :)
Re:Pipes and Filters
by morenoh149 on Tuesday September 16, 2014 @07:58PM
(#8327765)
that's insanely cool. I would have probably spent a lot of time implementing the buffer in software.
Example: the raspberry pi has pretty slow SD performance and the USB bus can get hogged. If you record audio and want to encode + write it to SD you can easily get buffer overruns. Easily solved by a 10sec buffer between arecord and flac in my case.