[Speex-dev] Voice activity detection

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Fri Feb 15 04:15:39 PST 2008


Just use the return value of speex_preprocess_run()

Cheers,

	Jean-Marc

Evgueni Tsygankov a écrit :
> 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
> 
> 
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev
> 
> 


More information about the Speex-dev mailing list