hi guys,
i am trying to develop an application having a capability to detect voice
activity in voice stream and then record only portion of this stream which
contains the activity. i went through these steps.
1. Captured voice through Waveform Functions of Windows Multimedia API
2. Started Speex Preprocessing liberary
3. Turned on preprocessor by calling speex_preprocess_state_init and passing
it 20 ms frame size and sampling rate
4. Set VAD on
5. Copied byte data into __int16 variables and passed it to
speex_preprocess_run function.
in return of these steps i got wrong date back to me. could you please send me
the sample code or could you identify the problem?
i'll be thankful
regards
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.xiph.org/pipermail/speex-dev/attachments/20080107/6a45f26e/attachment.html
Jean-Marc Valin
2008-Jan-07 12:32 UTC
[Speex-dev] Problem related to Voice activity detection
Abdul Basit a ?crit :> hi guys, > i am trying to develop an application having a capability to detect voice activity in voice stream and then record only portion of this stream which contains the activity. i went through these steps. > 1. Captured voice through Waveform Functions of Windows Multimedia API > 2. Started Speex Preprocessing liberary > 3. Turned on preprocessor by calling speex_preprocess_state_init and passing it 20 ms frame size and sampling rate > 4. Set VAD on > 5. Copied byte data into __int16 variables and passed it to speex_preprocess_run function. > in return of these steps i got wrong date back to me. could you please send me the sample code or could you identify the problem? > i'll be thankful...and what's the actual problem you're seeing? Jean-Marc
This must be a simple issue, but I cannot figure it out.
I want to use VAD, but I don't know how to check if the actual frame has
voice in it or not.
So, in my code, I do:
int tmp = 1;
speex_preprocess_ctl(preprocess_state, SPEEX_PREPROCESS_SET_VAD, &tmp);
speex_preprocess_ctl(preprocess_state, SPEEX_PREPROCESS_SET_DENOISE,
&tmp);
then later, for each frame
speex_preprocess_run(preprocess_state, shortPointer);
but how do I know if the frame contained voice? I tried
if (preprocess_state->was_voice == 1)
{
...Do voice present code...
}
But the compiler complains that was_voice is not defined, which, I
assume, comes from the fact that preprocess_state is declared in
speech_preprocess.h as struct SpeexPreprocessState_;
How do I check the preprocessor for the presence of voice in a frame?
Thanks,
Evgueni