Samuel Hart wrote:
this would definitely be a nice idea, but you’d need
serious DSP (digital signal processing) to get from
voice commands to an sdl event.
Not necessarily.
I could envision some games where simple “claps” or other
loud noices could be used as controls for a game (perhaps
you must clap to the beat, or something…
Unless the hardware handles it, don’t you still have to run a power spectrum
on the raw data to detect that a “loud noise” occured?
Regimental Command
Generic Armored Combat System
http://regcom.sourceforge.net> On Tue, 27 Mar 2001, you wrote:
Samuel Hart wrote:
this would definitely be a nice idea, but you’d need
serious DSP (digital signal processing) to get from
voice commands to an sdl event.
Not necessarily.
I could envision some games where simple “claps” or other
loud noices could be used as controls for a game (perhaps
you must clap to the beat, or something…
Unless the hardware handles it, don’t you still have to run a power
spectrum on the raw data to detect that a “loud noise” occured?
“Power” could be substituted for “P-P level”, which is very easy to extract.
Just integrate the absolute values of samples over some reasonable time
frame, say the time corresponding to one period of 50 Hz. (Preferably throw
in a simple high pass filter before the integration, so you don’t get crap
from low frequency components in the input.)
Then have a variable “chase” the current “power” (the output of the above),
and consider positive transients (ie “power increasing rapidly”) over a
certaion magnitude “trigger condition”, and post an event when it’s detected.
A “cheat” to make it less sensitive to irrelevant noise, and to the sound
output from the computer itself, apply a narrow band pass filter. One could
even apply a corresponding notch filter to the audio output, effectively
reserving an audio frequency for input only… 
Anyway, all of this is stuff that’s easilly strapped on as an external lib.
There are so many variations of this kind of stuff that it can’t be kept
simple and still be of much use. If you can just get the raw audio input via
SDL, the rest is just a matter of feeding it to something that does something
useful with it.
//David
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
--------------------------------------> david at linuxdj.com -'On Tuesday 27 March 2001 17:57, Randi J. Relander wrote:
On Tue, 27 Mar 2001, you wrote: