[Speex-dev] DTX mode using preprocessor?

Thorvald Natvig speex at natvig.com
Sun Sep 4 19:54:14 PDT 2005

> Hi,
> It could (and should) definitely be done, but it's somewhere
> (unfortunately not on top) on my TODO list. I think the simplest way
> (until I really integrate the preprocessor with the codec, which will
> take a while) to do it is to add a speex_encoder_ctl() call as you
> proposed. I'd call it SPEEX_SET_EXT_VAD_STATUS and I'm willing to merge
> a patch :-)
> 	Jean-Marc
> Le samedi 03 septembre 2005 à 00:47 +0200, Thorvald Natvig a écrit :
>> Could a method be added to use the VAD from the preprocessor to send the
>> packet with the 'dtx_enable' flag in it, so the decoder on the other end
>> knows it's in dtx mode? (and SPEEX_GET_DTX_STATUS returns 1)
>> At the moment, I can hack around it by doing something like:
>> if (VAD for prev frame && ! VAD for this frame) {
>>  		iArg = 0;
>>  		speex_encoder_ctl(m_esEncState,SPEEX_SET_VBR, &iArg);
>>  		speex_encoder_ctl(m_esEncState,SPEEX_SET_QUALITY, &iArg);
>>  		SBEncState *sbe = static_cast<SBEncState *>(m_esEncState);
>>  		EncState *es = static_cast<EncState *>(sbe->st_low);
>>  		es->dtx_count = 1;
>> }

(snip snip)

I ran into another problem, actually. The jitter buffer doesn't really 
cope well with DTX. It will (naturally) reset as soon as speech resumes, 
but then it takes quite a few frames before it's adjusted again, meaning 
the first part of whatever is being said gets garbled pretty badly on the 
receiver side... So at the moment I'm back to just continous transmission. 
I'll peek a bit at the jitter buffer internals tomorrow and see if I can 
figure out what's going on.

More information about the Speex-dev mailing list