<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.8">
  <compounddef id="ec-calibrator_8c" kind="file">
    <compoundname>ec-calibrator.c</compoundname>
    <includes refid="private_8h" local="yes">private.h</includes>
    <includes local="yes">mediastreamer2/mstonedetector.h</includes>
    <includes local="yes">mediastreamer2/dtmfgen.h</includes>
    <includes refid="lpconfig_8h" local="yes">lpconfig.h</includes>
    <incdepgraph>
      <node id="59">
        <label>ec-calibrator.c</label>
        <link refid="ec-calibrator.c"/>
        <childnode refid="60" relation="include">
        </childnode>
        <childnode refid="61" relation="include">
        </childnode>
      </node>
      <node id="60">
        <label>mediastreamer2/mstonedetector.h</label>
      </node>
      <node id="61">
        <label>mediastreamer2/dtmfgen.h</label>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="ec-calibrator_8c_1a544ce08cb3883fdded4dea0b8019720c" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void ecc_init_filters</definition>
        <argsstring>(EcCalibrator *ecc)</argsstring>
        <name>ecc_init_filters</name>
        <param>
          <type>EcCalibrator *</type>
          <declname>ecc</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="30" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="30" bodyend="84"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1a403e771779c559d4dcade4ccadc992f0" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void ecc_deinit_filters</definition>
        <argsstring>(EcCalibrator *ecc)</argsstring>
        <name>ecc_deinit_filters</name>
        <param>
          <type>EcCalibrator *</type>
          <declname>ecc</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="86" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="86" bodyend="112"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1a6f698a8826d6693ee8ea3cd8cb1409aa" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void on_tone_sent</definition>
        <argsstring>(void *data, MSFilter *f, unsigned int event_id, void *arg)</argsstring>
        <name>on_tone_sent</name>
        <param>
          <type>void *</type>
          <declname>data</declname>
        </param>
        <param>
          <type>MSFilter *</type>
          <declname>f</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>event_id</declname>
        </param>
        <param>
          <type>void *</type>
          <declname>arg</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="114" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="114" bodyend="119"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1a6dcdaa907552092bd911a2a985d56566" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>bool_t</type>
        <definition>static bool_t is_valid_tone</definition>
        <argsstring>(EcCalibrator *ecc, MSToneDetectorEvent *ev)</argsstring>
        <name>is_valid_tone</name>
        <param>
          <type>EcCalibrator *</type>
          <declname>ecc</declname>
        </param>
        <param>
          <type>MSToneDetectorEvent *</type>
          <declname>ev</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="121" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="121" bodyend="139"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1a4684851cf4f9678be501df0ea303390b" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void on_tone_received</definition>
        <argsstring>(void *data, MSFilter *f, unsigned int event_id, void *arg)</argsstring>
        <name>on_tone_received</name>
        <param>
          <type>void *</type>
          <declname>data</declname>
        </param>
        <param>
          <type>MSFilter *</type>
          <declname>f</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>event_id</declname>
        </param>
        <param>
          <type>void *</type>
          <declname>arg</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="141" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="141" bodyend="148"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1a15115f1a4d5c84f8d3b3353ba8e57910" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void ecc_play_tones</definition>
        <argsstring>(EcCalibrator *ecc)</argsstring>
        <name>ecc_play_tones</name>
        <param>
          <type>EcCalibrator *</type>
          <declname>ecc</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="150" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="150" bodyend="230"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1a249b32ccdb76fbdf822a6db24bce902b" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void *</type>
        <definition>static void* ecc_thread</definition>
        <argsstring>(void *p)</argsstring>
        <name>ecc_thread</name>
        <param>
          <type>void *</type>
          <declname>p</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="232" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="232" bodyend="240"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1ab8b1b4a2ef3768bf9dcbea385807a23e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>EcCalibrator *</type>
        <definition>EcCalibrator* ec_calibrator_new</definition>
        <argsstring>(MSSndCard *play_card, MSSndCard *capt_card, unsigned int rate, LinphoneEcCalibrationCallback cb, LinphoneEcCalibrationAudioInit audio_init_cb, LinphoneEcCalibrationAudioUninit audio_uninit_cb, void *cb_data)</argsstring>
        <name>ec_calibrator_new</name>
        <param>
          <type>MSSndCard *</type>
          <declname>play_card</declname>
        </param>
        <param>
          <type>MSSndCard *</type>
          <declname>capt_card</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rate</declname>
        </param>
        <param>
          <type>LinphoneEcCalibrationCallback</type>
          <declname>cb</declname>
        </param>
        <param>
          <type>LinphoneEcCalibrationAudioInit</type>
          <declname>audio_init_cb</declname>
        </param>
        <param>
          <type>LinphoneEcCalibrationAudioUninit</type>
          <declname>audio_uninit_cb</declname>
        </param>
        <param>
          <type>void *</type>
          <declname>cb_data</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="242" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="242" bodyend="255"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1ab17d630656c6d7c3278bc69afefc6b89" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>LinphoneEcCalibratorStatus</type>
        <definition>LinphoneEcCalibratorStatus ec_calibrator_get_status</definition>
        <argsstring>(EcCalibrator *ecc)</argsstring>
        <name>ec_calibrator_get_status</name>
        <param>
          <type>EcCalibrator *</type>
          <declname>ecc</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="257" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="257" bodyend="259"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1af845ca72153c4db09c236f0ce997c2ac" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void ec_calibrator_destroy</definition>
        <argsstring>(EcCalibrator *ecc)</argsstring>
        <name>ec_calibrator_destroy</name>
        <param>
          <type>EcCalibrator *</type>
          <declname>ecc</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="261" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="261" bodyend="264"/>
      </memberdef>
      <memberdef kind="function" id="ec-calibrator_8c_1ad98ad12dd84d433b078275d985a60edb" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int linphone_core_start_echo_calibration</definition>
        <argsstring>(LinphoneCore *lc, LinphoneEcCalibrationCallback cb, LinphoneEcCalibrationAudioInit audio_init_cb, LinphoneEcCalibrationAudioUninit audio_uninit_cb, void *cb_data)</argsstring>
        <name>linphone_core_start_echo_calibration</name>
        <param>
          <type><ref refid="group__initializing_1gaa5cf635b82dd338e7ee2dd3599d05f0a" kindref="member">LinphoneCore</ref> *</type>
          <declname>lc</declname>
        </param>
        <param>
          <type>LinphoneEcCalibrationCallback</type>
          <declname>cb</declname>
        </param>
        <param>
          <type>LinphoneEcCalibrationAudioInit</type>
          <declname>audio_init_cb</declname>
        </param>
        <param>
          <type>LinphoneEcCalibrationAudioUninit</type>
          <declname>audio_uninit_cb</declname>
        </param>
        <param>
          <type>void *</type>
          <declname>cb_data</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Start an echo calibration of the sound devices, in order to find adequate settings for the echo canceller automatically. </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" line="266" column="1" bodyfile="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c" bodystart="266" bodyend="277"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*</highlight></codeline>
<codeline lineno="2"><highlight class="comment">linphone</highlight></codeline>
<codeline lineno="3"><highlight class="comment">Copyright<sp/>(C)<sp/>2011<sp/>Belledonne<sp/>Communications<sp/>SARL</highlight></codeline>
<codeline lineno="4"><highlight class="comment">Author:<sp/>Simon<sp/>MORLAT<sp/>(simon.morlat@linphone.org)</highlight></codeline>
<codeline lineno="5"><highlight class="comment"></highlight></codeline>
<codeline lineno="6"><highlight class="comment">This<sp/>program<sp/>is<sp/>free<sp/>software;<sp/>you<sp/>can<sp/>redistribute<sp/>it<sp/>and/or</highlight></codeline>
<codeline lineno="7"><highlight class="comment">modify<sp/>it<sp/>under<sp/>the<sp/>terms<sp/>of<sp/>the<sp/>GNU<sp/>General<sp/>Public<sp/>License</highlight></codeline>
<codeline lineno="8"><highlight class="comment">as<sp/>published<sp/>by<sp/>the<sp/>Free<sp/>Software<sp/>Foundation;<sp/>either<sp/>version<sp/>2</highlight></codeline>
<codeline lineno="9"><highlight class="comment">of<sp/>the<sp/>License,<sp/>or<sp/>(at<sp/>your<sp/>option)<sp/>any<sp/>later<sp/>version.</highlight></codeline>
<codeline lineno="10"><highlight class="comment"></highlight></codeline>
<codeline lineno="11"><highlight class="comment">This<sp/>program<sp/>is<sp/>distributed<sp/>in<sp/>the<sp/>hope<sp/>that<sp/>it<sp/>will<sp/>be<sp/>useful,</highlight></codeline>
<codeline lineno="12"><highlight class="comment">but<sp/>WITHOUT<sp/>ANY<sp/>WARRANTY;<sp/>without<sp/>even<sp/>the<sp/>implied<sp/>warranty<sp/>of</highlight></codeline>
<codeline lineno="13"><highlight class="comment">MERCHANTABILITY<sp/>or<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE.<sp/><sp/>See<sp/>the</highlight></codeline>
<codeline lineno="14"><highlight class="comment">GNU<sp/>General<sp/>Public<sp/>License<sp/>for<sp/>more<sp/>details.</highlight></codeline>
<codeline lineno="15"><highlight class="comment"></highlight></codeline>
<codeline lineno="16"><highlight class="comment">You<sp/>should<sp/>have<sp/>received<sp/>a<sp/>copy<sp/>of<sp/>the<sp/>GNU<sp/>General<sp/>Public<sp/>License</highlight></codeline>
<codeline lineno="17"><highlight class="comment">along<sp/>with<sp/>this<sp/>program;<sp/>if<sp/>not,<sp/>write<sp/>to<sp/>the<sp/>Free<sp/>Software</highlight></codeline>
<codeline lineno="18"><highlight class="comment">Foundation,<sp/>Inc.,<sp/>59<sp/>Temple<sp/>Place<sp/>-<sp/>Suite<sp/>330,<sp/>Boston,<sp/>MA<sp/><sp/>02111-1307,<sp/>USA.</highlight></codeline>
<codeline lineno="19"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;private.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;mediastreamer2/mstonedetector.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;mediastreamer2/dtmfgen.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;lpconfig.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ecc_init_filters(EcCalibrator<sp/>*ecc){</highlight></codeline>
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rate;</highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>channels<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ecc_channels<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MSTickerParams<sp/>params={0};</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>params.name=</highlight><highlight class="stringliteral">&quot;Echo<sp/>calibrator&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>params.prio=MS_TICKER_PRIO_HIGH;</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;ticker=ms_ticker_new_with_params(&amp;params);</highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;sndread=ms_snd_card_create_reader(ecc-&gt;capt_card);</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;sndread,MS_FILTER_SET_SAMPLE_RATE,&amp;ecc-&gt;rate);</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;sndread,MS_FILTER_GET_SAMPLE_RATE,&amp;rate);</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;sndread,MS_FILTER_SET_NCHANNELS,&amp;ecc_channels);</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;sndread,MS_FILTER_GET_NCHANNELS,&amp;channels);</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;read_resampler=ms_filter_new(MS_RESAMPLE_ID);</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;read_resampler,MS_FILTER_SET_SAMPLE_RATE,&amp;rate);</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;read_resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&amp;ecc-&gt;rate);</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;read_resampler,MS_FILTER_SET_NCHANNELS,&amp;ecc_channels);</highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;read_resampler,MS_FILTER_SET_OUTPUT_NCHANNELS,&amp;channels);</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;det=ms_filter_new(MS_TONE_DETECTOR_ID);</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;det,MS_FILTER_SET_SAMPLE_RATE,&amp;ecc-&gt;rate);</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;rec=ms_filter_new(MS_VOID_SINK_ID);</highlight></codeline>
<codeline lineno="54"><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_link(ecc-&gt;sndread,0,ecc-&gt;read_resampler,0);</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_link(ecc-&gt;read_resampler,0,ecc-&gt;det,0);</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_link(ecc-&gt;det,0,ecc-&gt;rec,0);</highlight></codeline>
<codeline lineno="58"><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;play=ms_filter_new(MS_VOID_SOURCE_ID);</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;gen=ms_filter_new(MS_DTMF_GEN_ID);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;gen,MS_FILTER_SET_SAMPLE_RATE,&amp;ecc-&gt;rate);</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;write_resampler=ms_filter_new(MS_RESAMPLE_ID);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;sndwrite=ms_snd_card_create_writer(ecc-&gt;play_card);</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;sndwrite,MS_FILTER_SET_SAMPLE_RATE,&amp;ecc-&gt;rate);</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;sndwrite,MS_FILTER_GET_SAMPLE_RATE,&amp;rate);</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;sndwrite,MS_FILTER_SET_NCHANNELS,&amp;ecc_channels);</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;sndwrite,MS_FILTER_GET_NCHANNELS,&amp;channels);</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;write_resampler,MS_FILTER_SET_SAMPLE_RATE,&amp;ecc-&gt;rate);</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;write_resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&amp;rate);</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;write_resampler,MS_FILTER_SET_NCHANNELS,&amp;ecc_channels);</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;write_resampler,MS_FILTER_SET_OUTPUT_NCHANNELS,&amp;channels);</highlight></codeline>
<codeline lineno="73"><highlight class="normal"></highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_link(ecc-&gt;play,0,ecc-&gt;gen,0);</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_link(ecc-&gt;gen,0,ecc-&gt;write_resampler,0);</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_link(ecc-&gt;write_resampler,0,ecc-&gt;sndwrite,0);</highlight></codeline>
<codeline lineno="77"><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_ticker_attach(ecc-&gt;ticker,ecc-&gt;sndread);</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_ticker_attach(ecc-&gt;ticker,ecc-&gt;play);</highlight></codeline>
<codeline lineno="80"><highlight class="normal"></highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ecc-&gt;audio_init_cb<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(*ecc-&gt;audio_init_cb)(ecc-&gt;cb_data);</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="84"><highlight class="normal">}</highlight></codeline>
<codeline lineno="85"><highlight class="normal"></highlight></codeline>
<codeline lineno="86"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ecc_deinit_filters(EcCalibrator<sp/>*ecc){</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ecc-&gt;audio_uninit_cb<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(*ecc-&gt;audio_uninit_cb)(ecc-&gt;cb_data);</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_ticker_detach(ecc-&gt;ticker,ecc-&gt;sndread);</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_ticker_detach(ecc-&gt;ticker,ecc-&gt;play);</highlight></codeline>
<codeline lineno="93"><highlight class="normal"></highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_unlink(ecc-&gt;play,0,ecc-&gt;gen,0);</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_unlink(ecc-&gt;gen,0,ecc-&gt;write_resampler,0);</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_unlink(ecc-&gt;write_resampler,0,ecc-&gt;sndwrite,0);</highlight></codeline>
<codeline lineno="97"><highlight class="normal"></highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_unlink(ecc-&gt;sndread,0,ecc-&gt;read_resampler,0);</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_unlink(ecc-&gt;read_resampler,0,ecc-&gt;det,0);</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_unlink(ecc-&gt;det,0,ecc-&gt;rec,0);</highlight></codeline>
<codeline lineno="101"><highlight class="normal"></highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_destroy(ecc-&gt;sndread);</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_destroy(ecc-&gt;det);</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_destroy(ecc-&gt;rec);</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_destroy(ecc-&gt;play);</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_destroy(ecc-&gt;gen);</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_destroy(ecc-&gt;read_resampler);</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_destroy(ecc-&gt;write_resampler);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_destroy(ecc-&gt;sndwrite);</highlight></codeline>
<codeline lineno="110"><highlight class="normal"></highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_ticker_destroy(ecc-&gt;ticker);</highlight></codeline>
<codeline lineno="112"><highlight class="normal">}</highlight></codeline>
<codeline lineno="113"><highlight class="normal"></highlight></codeline>
<codeline lineno="114"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>on_tone_sent(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*data,<sp/>MSFilter<sp/>*f,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>event_id,<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*arg){</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MSDtmfGenEvent<sp/>*ev=(MSDtmfGenEvent*)arg;</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>EcCalibrator<sp/>*ecc=(EcCalibrator*)data;</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;acc-=ev-&gt;tone_start_time;</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_message(</highlight><highlight class="stringliteral">&quot;Sent<sp/>tone<sp/>at<sp/>%u&quot;</highlight><highlight class="normal">,(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)ev-&gt;tone_start_time);</highlight></codeline>
<codeline lineno="119"><highlight class="normal">}</highlight></codeline>
<codeline lineno="120"><highlight class="normal"></highlight></codeline>
<codeline lineno="121"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>bool_t<sp/>is_valid_tone(EcCalibrator<sp/>*ecc,<sp/>MSToneDetectorEvent<sp/>*ev){</highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>bool_t<sp/>*toneflag=NULL;</highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strcmp(ev-&gt;tone_name,</highlight><highlight class="stringliteral">&quot;freq1&quot;</highlight><highlight class="normal">)==0){</highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>toneflag=&amp;ecc-&gt;freq1;</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strcmp(ev-&gt;tone_name,</highlight><highlight class="stringliteral">&quot;freq2&quot;</highlight><highlight class="normal">)==0){</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>toneflag=&amp;ecc-&gt;freq2;</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strcmp(ev-&gt;tone_name,</highlight><highlight class="stringliteral">&quot;freq3&quot;</highlight><highlight class="normal">)==0){</highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>toneflag=&amp;ecc-&gt;freq3;</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight><highlight class="keywordflow">else</highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_error(</highlight><highlight class="stringliteral">&quot;Calibrator<sp/>bug.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>FALSE;</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*toneflag){</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_message(</highlight><highlight class="stringliteral">&quot;Duplicated<sp/>tone<sp/>event,<sp/>ignored.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>FALSE;</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*toneflag=TRUE;</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>TRUE;</highlight></codeline>
<codeline lineno="139"><highlight class="normal">}</highlight></codeline>
<codeline lineno="140"><highlight class="normal"></highlight></codeline>
<codeline lineno="141"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>on_tone_received(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*data,<sp/>MSFilter<sp/>*f,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>event_id,<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*arg){</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MSToneDetectorEvent<sp/>*ev=(MSToneDetectorEvent*)arg;</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>EcCalibrator<sp/>*ecc=(EcCalibrator*)data;</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(is_valid_tone(ecc,ev)){</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;acc+=ev-&gt;tone_start_time;</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_message(</highlight><highlight class="stringliteral">&quot;Received<sp/>tone<sp/>at<sp/>%u&quot;</highlight><highlight class="normal">,(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)ev-&gt;tone_start_time);</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="148"><highlight class="normal">}</highlight></codeline>
<codeline lineno="149"><highlight class="normal"></highlight></codeline>
<codeline lineno="150"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ecc_play_tones(EcCalibrator<sp/>*ecc){</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MSDtmfGenCustomTone<sp/>tone;</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MSToneDetectorDef<sp/>expected_tone;</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memset(&amp;tone,0,</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(tone));</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memset(&amp;expected_tone,0,</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(expected_tone));</highlight></codeline>
<codeline lineno="156"><highlight class="normal"></highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_add_notify_callback(ecc-&gt;det,on_tone_received,ecc,TRUE);</highlight></codeline>
<codeline lineno="158"><highlight class="normal"></highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>configure<sp/>the<sp/>tones<sp/>to<sp/>be<sp/>scanned<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strncpy(expected_tone.tone_name,</highlight><highlight class="stringliteral">&quot;freq1&quot;</highlight><highlight class="normal">,</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(expected_tone.tone_name));</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expected_tone.frequency=2000;</highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expected_tone.min_duration=40;</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expected_tone.min_amplitude=0.1;</highlight></codeline>
<codeline lineno="165"><highlight class="normal"></highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method<sp/>(ecc-&gt;det,MS_TONE_DETECTOR_ADD_SCAN,&amp;expected_tone);</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strncpy(expected_tone.tone_name,</highlight><highlight class="stringliteral">&quot;freq2&quot;</highlight><highlight class="normal">,</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(expected_tone.tone_name));</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expected_tone.frequency=2300;</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expected_tone.min_duration=40;</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expected_tone.min_amplitude=0.1;</highlight></codeline>
<codeline lineno="172"><highlight class="normal"></highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method<sp/>(ecc-&gt;det,MS_TONE_DETECTOR_ADD_SCAN,&amp;expected_tone);</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strncpy(expected_tone.tone_name,</highlight><highlight class="stringliteral">&quot;freq3&quot;</highlight><highlight class="normal">,</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(expected_tone.tone_name));</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expected_tone.frequency=2500;</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expected_tone.min_duration=40;</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expected_tone.min_amplitude=0.1;</highlight></codeline>
<codeline lineno="179"><highlight class="normal"></highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method<sp/>(ecc-&gt;det,MS_TONE_DETECTOR_ADD_SCAN,&amp;expected_tone);</highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*play<sp/>an<sp/>initial<sp/>tone<sp/>to<sp/>startup<sp/>the<sp/>audio<sp/>playback/capture*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tone.frequencies[0]=140;</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tone.duration=1000;</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tone.amplitude=0.5;</highlight></codeline>
<codeline lineno="187"><highlight class="normal"></highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;gen,MS_DTMF_GEN_PLAY_CUSTOM,&amp;tone);</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_sleep(2);</highlight></codeline>
<codeline lineno="190"><highlight class="normal"></highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_add_notify_callback(ecc-&gt;gen,on_tone_sent,ecc,TRUE);</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>play<sp/>the<sp/>three<sp/>tones*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tone.frequencies[0]=2000;</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tone.duration=100;</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;gen,MS_DTMF_GEN_PLAY_CUSTOM,&amp;tone);</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_usleep(300000);</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tone.frequencies[0]=2300;</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tone.duration=100;</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;gen,MS_DTMF_GEN_PLAY_CUSTOM,&amp;tone);</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_usleep(300000);</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tone.frequencies[0]=2500;</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tone.duration=100;</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(ecc-&gt;gen,MS_DTMF_GEN_PLAY_CUSTOM,&amp;tone);</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_sleep(1);</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ecc-&gt;freq1<sp/>&amp;&amp;<sp/>ecc-&gt;freq2<sp/>&amp;&amp;<sp/>ecc-&gt;freq3)<sp/>{</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>delay=ecc-&gt;acc/3;</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(delay&lt;0){</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_error(</highlight><highlight class="stringliteral">&quot;Quite<sp/>surprising<sp/>calibration<sp/>result,<sp/>delay=%i&quot;</highlight><highlight class="normal">,delay);</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;status=LinphoneEcCalibratorFailed;</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight><highlight class="keywordflow">else</highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_message(</highlight><highlight class="stringliteral">&quot;Echo<sp/>calibration<sp/>estimated<sp/>delay<sp/>to<sp/>be<sp/>%i<sp/>ms&quot;</highlight><highlight class="normal">,delay);</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;delay=delay;</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;status=LinphoneEcCalibratorDone;</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ecc-&gt;freq1<sp/>||<sp/>ecc-&gt;freq2<sp/>||<sp/>ecc-&gt;freq3)==FALSE)<sp/>{</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_message(</highlight><highlight class="stringliteral">&quot;Echo<sp/>calibration<sp/>succeeded,<sp/>no<sp/>echo<sp/>has<sp/>been<sp/>detected&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;status<sp/>=<sp/>LinphoneEcCalibratorDoneNoEcho;</highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;status<sp/>=<sp/>LinphoneEcCalibratorFailed;</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="226"><highlight class="normal"></highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ecc-&gt;status<sp/>==<sp/>LinphoneEcCalibratorFailed)<sp/>{</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_error(</highlight><highlight class="stringliteral">&quot;Echo<sp/>calibration<sp/>failed.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="230"><highlight class="normal">}</highlight></codeline>
<codeline lineno="231"><highlight class="normal"></highlight></codeline>
<codeline lineno="232"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><sp/>*<sp/>ecc_thread(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*p){</highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>EcCalibrator<sp/>*ecc=(EcCalibrator*)p;</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc_init_filters(ecc);</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc_play_tones(ecc);</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc_deinit_filters(ecc);</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_thread_exit(NULL);</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="240"><highlight class="normal">}</highlight></codeline>
<codeline lineno="241"><highlight class="normal"></highlight></codeline>
<codeline lineno="242"><highlight class="normal">EcCalibrator<sp/>*<sp/>ec_calibrator_new(MSSndCard<sp/>*play_card,<sp/>MSSndCard<sp/>*capt_card,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rate,<sp/>LinphoneEcCalibrationCallback<sp/>cb,</highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>LinphoneEcCalibrationAudioInit<sp/>audio_init_cb,<sp/>LinphoneEcCalibrationAudioUninit<sp/>audio_uninit_cb,<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*cb_data){</highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>EcCalibrator<sp/>*ecc=ms_new0(EcCalibrator,1);</highlight></codeline>
<codeline lineno="245"><highlight class="normal"></highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;rate=rate;</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;cb=cb;</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;cb_data=cb_data;</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;audio_init_cb=audio_init_cb;</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;audio_uninit_cb=audio_uninit_cb;</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;capt_card=capt_card;</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ecc-&gt;play_card=play_card;</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_thread_create(&amp;ecc-&gt;thread,NULL,ecc_thread,ecc);</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ecc;</highlight></codeline>
<codeline lineno="255"><highlight class="normal">}</highlight></codeline>
<codeline lineno="256"><highlight class="normal"></highlight></codeline>
<codeline lineno="257"><highlight class="normal">LinphoneEcCalibratorStatus<sp/>ec_calibrator_get_status(EcCalibrator<sp/>*ecc){</highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ecc-&gt;status;</highlight></codeline>
<codeline lineno="259"><highlight class="normal">}</highlight></codeline>
<codeline lineno="260"><highlight class="normal"></highlight></codeline>
<codeline lineno="261"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ec_calibrator_destroy(EcCalibrator<sp/>*ecc){</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_thread_join(ecc-&gt;thread,NULL);</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(ecc);</highlight></codeline>
<codeline lineno="264"><highlight class="normal">}</highlight></codeline>
<codeline lineno="265"><highlight class="normal"></highlight></codeline>
<codeline lineno="266"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>linphone_core_start_echo_calibration(<ref refid="group__initializing_1gaa5cf635b82dd338e7ee2dd3599d05f0a" kindref="member">LinphoneCore</ref><sp/>*lc,<sp/>LinphoneEcCalibrationCallback<sp/>cb,</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>LinphoneEcCalibrationAudioInit<sp/>audio_init_cb,<sp/>LinphoneEcCalibrationAudioUninit<sp/>audio_uninit_cb,<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*cb_data){</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rate;</highlight></codeline>
<codeline lineno="269"><highlight class="normal"></highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(lc-&gt;ecc!=NULL){</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_error(</highlight><highlight class="stringliteral">&quot;Echo<sp/>calibration<sp/>is<sp/>still<sp/>on<sp/>going<sp/>!&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rate<sp/>=<sp/><ref refid="group__misc_1ga36d08c0cbc78d88fd4f043e61e9b9637" kindref="member">lp_config_get_int</ref>(lc-&gt;config,</highlight><highlight class="stringliteral">&quot;sound&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;echo_cancellation_rate&quot;</highlight><highlight class="normal">,8000);</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>lc-&gt;ecc=ec_calibrator_new(lc-&gt;sound_conf.play_sndcard,lc-&gt;sound_conf.capt_sndcard,rate,cb,audio_init_cb,audio_uninit_cb,cb_data);</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="277"><highlight class="normal">}</highlight></codeline>
<codeline lineno="278"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="C:/Jenkins/workspace/linphone-gtk-win32/coreapi/ec-calibrator.c"/>
  </compounddef>
</doxygen>
