[Speex-dev] Voice activity detection

Evgueni Tsygankov eugenet at rusmex.com
Fri Feb 15 03:53:30 PST 2008


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




More information about the Speex-dev mailing list