I'm trying to trigger an event when a user stops speaking.
My approach is to trace a single input audio volume-level integer and to measure it through time.
I've looked into the aurioTouch and speakHere example.
The first utilize an FFT buffer which get parsed every time it is fills - i couldn't see how to determine the volume of the speech from it. The second doesn't do any sound analysis.
Do you know of a way?
Is there a mic-incoming-sound-level hidden var?
If you are processing the audio in an audio input queue, then you can calculate the volume level for a given short block of time by taking the maximum and the minimum audio buffer values in that block. To determine when someone stops speaking, you would look for a drop in volume. But there are many parameters to consider: how much a drop do you want? how long must the drop persist? (You don't want to declare that they stopped speaking just because they took a breath.) You will probably have to fine-tune these and other parameters to get performance that is correct for your application.
But make sure you read the documentation, and watch the levels a bit, as they are in dB from -50 up to 0. The article VU meter - Wikipedia, the free encyclopedia shows the real world meter that the level is imitating.
But make sure you read the documentation, and watch the levels a bit, as they are in dB from -50 up to 0. The article VU meter - Wikipedia, the free encyclopedia shows the real world meter that the level is imitating.
Wow, much simpler than I expected.. thanks so much!!!