Lately I stumbled over Win32::SoundRec and immediately thought that roughly the same thing should exist for Linux, too. A quick scan over the CPAN revealed nothing so I started with
Needless to say, I missed
Audio::DSP altogether. This module even has a nicer interface than mine. The oddity though is that its author seems to have achieved tricks that did not work for me. Both his and my module are written in XS and naturally, recording from an OSS device will usually require doing a read(2). XSUB.h #defines
PerlIO_read() which expects a
PerlIO* as first argument. Any attempts I have made to get rid of this annoying #define have failed so that I eventually did use the PerlIO interface (which fortunately does work, too, even though
perlapio.pod claims that this is actually an
fread which in my understanding should not properly work with device files because of buffering).
Audio::DSP is happily using a raw
read and I now have to find out why I can't do that.