Silicon Technix Forums

Please login or register.

Author Topic: apply filter options & codec selection  (Read 2011 times)

Offline Jurik

  • Regular Memeber
  • ***
  • Posts: 14
  • Karma: +0/-0
    • View Profile
apply filter options & codec selection
« on: May 16, 2006, 03:05:29 PM »
Quote
//ApplyFilter(AGC, NoiseReduce,EchoCancel,AAGC,CN)

if (document.IaxVoicePhoneCtrl.chknoise.checked)
  iaxWebPhone.ApplyFilter(1,0,0,1,1);

if (document.IaxVoicePhoneCtrl.chkagc.checked)
  iaxWebPhone.ApplyFilter(1,1,0,0,1);

if (document.IaxVoicePhoneCtrl.chkcn.checked)
  iaxWebPhone.ApplyFilter(1,1,0,0,1);

if (document.IaxVoicePhoneCtrl.chkaagc.checked)
  iaxWebPhone.ApplyFilter(1,1,0,1,1);

I am not familiar with those filters and how * works. But could it be that some filters replace the function of other filter?
Or is it possible to call the function like this:

  iaxWebPhone.ApplyFilter(1,1,0,1,1);

Or do I have to call this function several times to initialize all the filters step by step? Cuz of the fact that I overwrite each time the function while having checked all fields.

My thoughts are just that there is no way to have only the last box checked without having all others (beside EchoCancel) initialized too.

==============================================
codec question:

Quote
if (document.IaxVoicePhoneCtrl.lineQuality_ulaw.checked)
   iaxWebPhone.Codec = 3;
else if (document.IaxVoicePhoneCtrl.lineQuality_GSM.checked)
   iaxWebPhone.Codec = 0;
else if (document.IaxVoicePhoneCtrl.lineQuality_ilbc.checked)
   iaxWebPhone.Codec = 2;
else if (document.IaxVoicePhoneCtrl.lineQuality_speex.checked)
   iaxWebPhone.Codec = 1;
else if (document.IaxVoicePhoneCtrl.lineQuality_alaw.checked)
   iaxWebPhone.Codec = 1;
else if (document.IaxVoicePhoneCtrl.lineQuality_g729.checked)
{
   alert("G729 Codec is selected, its for testing only");
   iaxWebPhone.Codec = 5;
}


Is iaxWebPhone.Codec = 1; speex or alaw codec?
« Last Edit: January 01, 1970, 05:00:00 AM by Jurik »

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 151
  • Karma: +87/-0
    • View Profile
    • http://www.silicontechnix.com
apply filter options & codec selection
« Reply #1 on: May 16, 2006, 04:17:11 PM »
Apply filter needs to call once you don\'t need to call it again n again, actually in the webpage it is checking which check box is on/off to set the filter.

you can call it like this

Code: [Select]
iaxWebPhone.ApplyFilter(1,1,0,1,1);  

to enable all the filters.

iaxWebPhone.Codec = 1; is speex
and
iaxWebPhone.Codec = 4; is alaw


iaxWebPhone.Codec=0 //for GSM
iaxWebPhone.Codec=1 //for SPEEX
iaxWebPhone.Codec=2 //for ILBC
iaxWebPhone.Codec=3 //for ULAW
iaxWebPhone.Codec=4 //for ALAW
iaxWebPhone.Codec=5 //for G729A


Regards,
Babar Shafiq Nazmi.
« Last Edit: January 01, 1970, 05:00:00 AM by babar »
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline Jurik

  • Regular Memeber
  • ***
  • Posts: 14
  • Karma: +0/-0
    • View Profile
(No subject)
« Reply #2 on: May 16, 2006, 07:14:53 PM »
Well thanks :)

I copied those quotes from the main code of IaxwebTelephone.php so there is a little bug with the codecs.

But with the filters - I just was confused about the if-clauses.
If all checkboxes (beside the last one) are unchecked you will have following filters:

AGC, NoiseReduce, AAGC, CN

I do not know what all the filters do or what kind of filters they are. But in my opinion it\'s not possible to set several on and some off as long as the last checkbox is checked. Or is the last checkbox for "all filters on" ?

I am still confused  :oops:
« Last Edit: January 01, 1970, 05:00:00 AM by Jurik »

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 151
  • Karma: +87/-0
    • View Profile
    • http://www.silicontechnix.com
confusion
« Reply #3 on: May 16, 2006, 07:22:15 PM »
Yes i know applyfilter javascript is very wrong :) not checking the filters checkboxes properly.

Code: [Select]
ApplyFilter(AGC As Integer, NoiseReduce As Integer, EchoCancel As Integer, AAGC As Integer, CN As Integer)

AGC is Automatic Gain Control
AAGC is Analog Automatic Gain Control

But the actuall thing is that, that 1 is enable 0 is disable, you can enable / disable filters like this (1,1,0,1,1) which means all are enable , echo cancellation is disable. you can fix that javascript confusion, i m not good with php or javascript at all...


Actually its not by me, Aldo Amrento did that :)

Regards,
Babar Shafiq Nazmi.
« Last Edit: January 01, 1970, 05:00:00 AM by babar »
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline Jurik

  • Regular Memeber
  • ***
  • Posts: 14
  • Karma: +0/-0
    • View Profile
(No subject)
« Reply #4 on: May 16, 2006, 08:01:53 PM »
I think that should work.

Code: [Select]
/* ApplyFilter(AGC, NoiseReduce, EchoCancel, AAGC, CN) */

/* Set all vars on 0 */
var AGC = 0;
var NoiseReduce = 0;
var EchoCancel = 0;
var AAGC = 0;
var CN = 0;


/* if-clauses for all checkboxes */
if (document.IaxVoicePhoneCtrl.chknoise.checked)
AGC = 1;

if (document.IaxVoicePhoneCtrl.chkagc.checked)
NoiseReduce = 1;

if (document.IaxVoicePhoneCtrl.chkcn.checked)
AAGC = 1;

if (document.IaxVoicePhoneCtrl.chkaagc.checked)
CN = 1;

/* call function ApplyFilter with declared vars */
iaxWebPhone.ApplyFilter(AGC,NoiseReduce,EchoCancel,AAGC,CN);
« Last Edit: January 01, 1970, 05:00:00 AM by Jurik »

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 151
  • Karma: +87/-0
    • View Profile
    • http://www.silicontechnix.com
ApplyFilter
« Reply #5 on: May 17, 2006, 12:39:22 AM »
Hi Jurik,

Thanks for the fix and update, code looks correct to me just a simple typo mistake.

Code: [Select]
/* ApplyFilter(AGC, NoiseReduce, EchoCancel, AAGC, CN) */

/* Set all vars on 0 */
var AGC = 0;
var NoiseReduce = 0;
var EchoCancel = 0;
var AAGC = 0;
var CN = 0;


/* if-clauses for all checkboxes */
if (document.IaxVoicePhoneCtrl.chknoise.checked)
NoiseReduce = 1;

if (document.IaxVoicePhoneCtrl.chkagc.checked)
AGC = 1;

if (document.IaxVoicePhoneCtrl.chkcn.checked)
CN = 1;

if (document.IaxVoicePhoneCtrl.chkaagc.checked)
AAGC = 1;

/* call function ApplyFilter with declared vars */
iaxWebPhone.ApplyFilter(AGC,NoiseReduce,EchoCancel,AAGC,CN);
« Last Edit: January 01, 1970, 05:00:00 AM by babar »
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline Jurik

  • Regular Memeber
  • ***
  • Posts: 14
  • Karma: +0/-0
    • View Profile
(No subject)
« Reply #6 on: May 17, 2006, 01:40:58 PM »
:oops: , yes *smile* I mixed them up :P
« Last Edit: January 01, 1970, 05:00:00 AM by Jurik »

 

Page created in 0.107 seconds with 15 queries.