[Speex-dev] Voice activity detection
jean-marc.valin at usherbrooke.ca
Fri Feb 15 04:15:39 PST 2008
Just use the return value of speex_preprocess_run()
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,
> 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?
> Speex-dev mailing list
> Speex-dev at xiph.org
More information about the Speex-dev