Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to build a delayed / buffered pipe? [closed]

Tags:

linux

bash

pipe

Is it possible to build a buffered pipe that retains data (for some given amount of bytes or some given time) from standard linux tools like cat, dd etc.?

For example to collect a defined amount of packets, audio data or something else.

Eg. to build a script delaybuffer to do something like that:

arecord | delaybuffer 16000 | aplay

to playback the recorded audio 16000 bytes delayed.

like image 369
dronus Avatar asked Dec 21 '22 22:12

dronus


1 Answers

Another way of doing it is with dd (if buffer does not exist on your dist).

    arecord | dd ibs=16000 iflag=fullblock oflag=dsync | aplay

I am not really sure about the flags, there might be better ways than just burst a block at a time.

like image 181
Martin Avatar answered Dec 24 '22 01:12

Martin