From 19edc89613a59aab461e444a71667d8fa3150d43 Mon Sep 17 00:00:00 2001 From: zhongjin Date: Tue, 6 Dec 2022 23:32:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'src/Network/fgcom.cxx'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Network/fgcom.cxx | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/src/Network/fgcom.cxx b/src/Network/fgcom.cxx index 387859f..1161d46 100644 --- a/src/Network/fgcom.cxx +++ b/src/Network/fgcom.cxx @@ -90,7 +90,7 @@ static int iaxc_callback( iaxc_event e ) } //zhongjin - SG_LOG(SG_SOUND, SG_ALERT, "FCCom iaxc_callback:" << e.type); + //SG_LOG(SG_SOUND, SG_ALERT, "FCCom iaxc_callback:" << e.type); return 1; } @@ -272,23 +272,15 @@ void FGCom::postinit() app += _version_node->getStringValue(); iaxc_set_callerid( _callsign_node->getStringValue().c_str(), app.c_str() ); - - //iaxc_set_callerid("guest","FGCOM"); - iaxc_set_formats (IAXC_FORMAT_SPEEX, IAXC_FORMAT_ULAW|IAXC_FORMAT_SPEEX); - //iaxc_set_formats (IAXC_FORMAT_GSM, IAXC_FORMAT_ULAW|IAXC_FORMAT_GSM); - - - - //iaxc_set_speex_settings(1, 5, 0, 1, 0, 3); - iaxc_set_speex_settings(1,-1,-1,0,8000,3); + iaxc_set_speex_settings(1, 5, 0, 1, 0, 3); + //iaxc_set_speex_settings(1,-1,-1,0,8000,3); /* void iaxc_set_speex_settings(int decode_enhance, float quality, int bitrate, int vbr, int abr, int complexity) - */ iaxc_set_filters(IAXC_FILTER_AGC | IAXC_FILTER_DENOISE); @@ -338,14 +330,12 @@ void FGCom::postinit() iaxc_audio_devices_get(&devs,&nDevs, &input, &output, &ring); //zhongjin - SG_LOG(SG_SOUND, SG_INFO, "设备总数:" << nDevs); - - + //SG_LOG(SG_SOUND, SG_INFO, "设备总数:" << nDevs); for(int i=0; igetChild("device", i, true); //zhongjin - SG_LOG(SG_SOUND, SG_INFO, "设备:" << i); + //SG_LOG(SG_SOUND, SG_INFO, "设备:" << i); // devID _deviceID_node[i] = in_node->getChild("id", 0, true); @@ -380,8 +370,7 @@ void FGCom::postinit() iaxc_input_level_set(0.1); iaxc_output_level_set(0.8); - iaxc_millisleep(300); - + iaxc_millisleep(30); // Do the first call at start setupCommFrequency(); @@ -391,9 +380,6 @@ void FGCom::postinit() //iaxc_call("guest:guest@fgcom.jingweiht.com/01118300"); SG_LOG(SG_SOUND, SG_ALERT, "FGCom: postinit 初始化完成"); - - - } double FGCom::getCurrentCommVolume() const { @@ -652,15 +638,12 @@ void FGCom::valueChanged(SGPropertyNode *prop) mesPopup("PTT按下,请讲...",5); - setupCommFrequency(); iaxc_output_level_set(0.0); iaxc_input_level_set(_micLevel_node->getFloatValue()); //0.0 = min , 1.0 = max _mpTransmitFrequencyNode->setValue(_currentCallFrequency * 1000000); _mpTransmitPowerNode->setValue(1.0); - - SGPath soundpath( globals->get_fg_root() ); soundpath.append("/Sounds/ptt.wav"); @@ -669,19 +652,13 @@ void FGCom::valueChanged(SGPropertyNode *prop) std::string urlcmd = "ffplay -nodisp -autoexit -loglevel quiet -i "; urlcmd.append(soundpath.c_str()); - - SG_LOG(SG_SOUND, SG_INFO, "CMD :" << urlcmd ); + //SG_LOG(SG_SOUND, SG_INFO, "CMD :" << urlcmd ); system(urlcmd.c_str()); - - - - } else { // iaxc_output_level_set(getCurrentCommVolume()); - SGPath soundpath( globals->get_fg_root() ); soundpath.append("/Sounds/click.wav");