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; } (in wideband) .. which forces speex to send the DTX packet and the remote side knows it can safely ignore that stream for the time being -- the lack of packets is completely intentional. While this works, it's an incredibly ugly hack, and I have to include a lot of the internal speex header files to compile. I've pondered adding a forced_vad flag to the encoder states, so you can write speex_encoder_ctl(state, SPEEX_SET_FORCED_VAD, <whatever>) but I'm not sure that's the right way to proceed. Any ideas?
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; > } > > (in wideband) > > .. which forces speex to send the DTX packet and the remote side knows it > can safely ignore that stream for the time being -- the lack of packets is > completely intentional. > > While this works, it's an incredibly ugly hack, and I have to include a > lot of the internal speex header files to compile. > > > I've pondered adding a forced_vad flag to the encoder states, so you can > write > speex_encoder_ctl(state, SPEEX_SET_FORCED_VAD, <whatever>) > but I'm not sure that's the right way to proceed. > > Any ideas? > > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev >-- Jean-Marc Valin <Jean-Marc.Valin@USherbrooke.ca> Universit? de Sherbrooke -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20050905/eb01ae2c/attachment-0001.pgp
> 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.