Re: [LAD] Audio Trigger

From: Gene Heskett <gene.heskett@email-addr-hidden>
Date: Thu Nov 06 2008 - 15:10:37 EET

On Thursday 06 November 2008, OrazioPirataDelloSpazio (Lorenzo) wrote:
>Hi all,
>I need to use a microphone input as a trigger. In other words my idea is
>to connect a switch to the microphone input. In this way, when the
>switch is turned on it generates a spike in the captured track.
>I would like to create a program that trigger an event every spike it
>receives.

1st, the switch needs to switch a voltage, otherwise there is nothing to
record. Most voltages (think carbon zinc 1.5 volt battery) are going to be
too high for a mic input, but will drive it to saturation in the A-d stage.
This could be used to advantage, but depends on the card. If the input is DC
coupled, then the output data should be a 16 bit signed integer, with a zero
value when the switch is open, and full scale when it is closed.

>I succeed in capturing the mic input through a simple program that uses
>alsa driver, but I don't know how to "parse" the raw data to search for
>the spikes. Any hints?

Sure, read the data stream as signed integers and look for that point where it
suddenly goes full scale from some value that is lose to zero.

>Second question: on a "full duplex" sound card, can I capture at 8 bit,
>mono, 22.050 bit/s , and on the same time playback at 16 bit, stereo,
>44.100 ?

The capture clocking will likely be the same as the playback, and likely will
be a 16 bit per sample capture since 8 bit, without a lot of monkey business
in the capture channel, is pretty poor telephone quality. More than adequate
for what you want to do, but probably not something the hardware can be
talked into doing.

>Thank you!
>
>Lorenzo
>_______________________________________________
>Linux-audio-dev mailing list
>Linux-audio-dev@email-addr-hidden
>http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
QOTD:
	Silence is the only virtue he has left.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Thu Nov 6 16:15:01 2008

This archive was generated by hypermail 2.1.8 : Thu Nov 06 2008 - 16:15:01 EET