Several years ago, I wrote some C code which turns one's
computer's sound interface in to a sound-activated recorder that
I could then connect to radio receivers or microphones and record
when audio started and stop recording when there is nothing but
silence.  One essentially sets a sound card to record
continuously but the sound samples go through code that knows
what silence looks like.  In short, silence looks like samples
whose numeric value is exactly half-way between the lowest and
highest voltage that the analog-to-digital converter reads,
commonly either 32,767 representing silence, give or take a count
or two due to digital sampling errors or decimal 128, hex 80 for
8-bit mono audio.

        The Advanced Linux Sound Architecture Project has C library
functions for setting sample rates, mono, stereo, big or little
endianness and 8 or 16-bit audio, whatever one needs for their
application.  One can even define samples as signed or unsigned
integers.

        Once one gets a stream of ints which are usually 32-bits
wide for stereo or 16-bit shorts for mono, the sound processing
can begin which C is really good at but perl is just as good at
so if one could get the same alsa modules which are used by aplay
and arecord for setting up one's audio interfaces or sound cards,
the manipulation of those data that was done in C could also be
done in perl without hardly any modification to it at all.

        Perl has just the right mix of low-level logic and
bitwise operators plus a much more easy-to-use string handling
capability which is why I am asking this question.

        I may be looking in the wrong places but, so far, I seem
to be batting zeros when looking for perl and alsa together.

        Any good ideas are greatly appreciated, here.

        Martin McCormick

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to