IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
speex_encoder_ctl always returning 0 (DTX), adding Speex DTX support to Asterisk
JimmyJames
post Jun 23 2005, 08:00
Post #1





Group: Members
Posts: 3
Joined: 23-June 05
Member No.: 22908



I'm currently playing with the Asterisk source code getting it to support Speex DTX mode. There are a few bugs left to sort out but one of the problems I've got is determining if a given frame in DTX is silent and need not be transmitted.

The libspeex API reference guide says that a call (any call?) to speex_encoder_ctl should return 0 in the case of silence (and 1 otherwise) but every time I call it I get a return value of 0, regardless of whether there's silence or not.

I'm currently trying to doing a:
CODE
int dtx_transmit = speex_encoder_ctl(tmp->speex, SPEEX_GET_FRAME_SIZE, &tmp->framesize);


After every call to:
CODE
speex_encode(tmp->speex, fbuf, &tmp->bits);


Has anyone been able to determine silence status using speex_encoder_ctl? Please let me know if I'm using it incorrectly.

Thanks,

James
Go to the top of the page
+Quote Post
JimmyJames
post Jun 23 2005, 08:28
Post #2





Group: Members
Posts: 3
Joined: 23-June 05
Member No.: 22908



Hold the phone...

It seems that speex_encode returns the dtx-silence flag, as would make sense, rather than speex_encoder_ctl as claimed in the documentation.

The lesson here? Never trust an API smile.gif
Go to the top of the page
+Quote Post
jmvalin
post Jun 24 2005, 05:51
Post #3


Xiph.org Speex developer


Group: Developer
Posts: 487
Joined: 21-August 02
Member No.: 3134



QUOTE (JimmyJames @ Jun 23 2005, 04:28 PM)
Hold the phone...

It seems that speex_encode returns the dtx-silence flag, as would make sense, rather than speex_encoder_ctl as claimed in the documentation.

The lesson here?  Never trust an API smile.gif
*


Sorry about that. I fixed it in SVN. Any other stpuid thing in the API doc?
Go to the top of the page
+Quote Post
JimmyJames
post Jun 24 2005, 06:01
Post #4





Group: Members
Posts: 3
Joined: 23-June 05
Member No.: 22908



QUOTE (jmvalin @ Jun 24 2005, 03:51 PM)
Sorry about that. I fixed it in SVN. Any other stpuid thing in the API doc?
*


No worries Jean-Marc.

The only other problem I noticed in the codec manual is in section 4.5
QUOTE
That terminator consists of the code 15 (decimal), encoded with 5 bits, as shown in figure 4.
with no figure 4 shown. Not that we need a figure anyway.

Thanks for all your work putting Speex together - great piece of software! smile.gif
Go to the top of the page
+Quote Post
jmvalin
post Jun 27 2005, 05:17
Post #5


Xiph.org Speex developer


Group: Developer
Posts: 487
Joined: 21-August 02
Member No.: 3134



QUOTE (JimmyJames @ Jun 24 2005, 02:01 PM)
The only other problem I noticed in the codec manual is in section 4.5
QUOTE
That terminator consists of the code 15 (decimal), encoded with 5 bits, as shown in figure 4.
with no figure 4 shown. Not that we need a figure anyway.

Thanks for all your work putting Speex together - great piece of software! smile.gif
*



Oops... I meant *Table* 4.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd December 2014 - 10:29