更新 'src/Network/fgcom.cxx'

next
zhongjin 2 years ago
parent 387fb56b2a
commit 19edc89613

@ -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; i<nDevs; i++ ) {
SGPropertyNode *in_node = node->getChild("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");

Loading…
Cancel
Save