更新 'src/Network/fgcom.cxx'
This commit is contained in:
+10
-16
@@ -244,7 +244,7 @@ void FGCom::postinit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//WARNING: this _must_ be executed after sound system is totally initialized !
|
//WARNING: this _must_ be executed after sound system is totally initialized !
|
||||||
if( iaxc_initialize(NUM_CALLS) ) {
|
if( iaxc_initialize(4) ) {
|
||||||
SG_LOG(SG_IO, SG_ALERT, "FGCom: cannot initialize iaxclient");
|
SG_LOG(SG_IO, SG_ALERT, "FGCom: cannot initialize iaxclient");
|
||||||
_enabled = false;
|
_enabled = false;
|
||||||
return;
|
return;
|
||||||
@@ -262,14 +262,14 @@ void FGCom::postinit()
|
|||||||
|
|
||||||
iaxc_set_callerid( _callsign_node->getStringValue().c_str(), app.c_str() );
|
iaxc_set_callerid( _callsign_node->getStringValue().c_str(), app.c_str() );
|
||||||
|
|
||||||
iaxc_set_formats (IAXC_FORMAT_SPEEX, IAXC_FORMAT_ULAW|IAXC_FORMAT_SPEEX);
|
//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_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, 5, 0, 1, 0, 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
void iaxc_set_speex_settings(int decode_enhance, float quality,
|
void iaxc_set_speex_settings(int decode_enhance, float quality,
|
||||||
@@ -277,8 +277,8 @@ void FGCom::postinit()
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
iaxc_set_filters(IAXC_FILTER_AGC | IAXC_FILTER_DENOISE);
|
//iaxc_set_filters(IAXC_FILTER_AGC | IAXC_FILTER_DENOISE);
|
||||||
iaxc_set_silence_threshold(_silenceThd_node->getFloatValue());
|
//iaxc_set_silence_threshold(_silenceThd_node->getFloatValue());
|
||||||
|
|
||||||
iaxc_start_processing_thread ();
|
iaxc_start_processing_thread ();
|
||||||
|
|
||||||
@@ -315,6 +315,7 @@ void FGCom::postinit()
|
|||||||
// so all following is unused finally until someone
|
// so all following is unused finally until someone
|
||||||
// implement "multi-device" support in IAX audio driver
|
// implement "multi-device" support in IAX audio driver
|
||||||
|
|
||||||
|
/*
|
||||||
SGPropertyNode *node = fgGetNode("/sim/fgcom", 0, true);
|
SGPropertyNode *node = fgGetNode("/sim/fgcom", 0, true);
|
||||||
|
|
||||||
struct iaxc_audio_device *devs;
|
struct iaxc_audio_device *devs;
|
||||||
@@ -360,28 +361,21 @@ void FGCom::postinit()
|
|||||||
if( devs[i].capabilities & IAXC_AD_OUTPUT_DEFAULT )
|
if( devs[i].capabilities & IAXC_AD_OUTPUT_DEFAULT )
|
||||||
_selectedOutput_node->setIntValue(devs[i].devID);
|
_selectedOutput_node->setIntValue(devs[i].devID);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Mute the mic and set speaker at start
|
iaxc_input_level_set(0.0);
|
||||||
iaxc_input_level_set( 0.0 );
|
|
||||||
//iaxc_output_level_set(getCurrentCommVolume());
|
|
||||||
iaxc_output_level_set(1.0);
|
iaxc_output_level_set(1.0);
|
||||||
|
|
||||||
|
iaxc_millisleep(300);
|
||||||
iaxc_millisleep(50);
|
|
||||||
|
|
||||||
|
|
||||||
// Do the first call at start
|
// Do the first call at start
|
||||||
setupCommFrequency();
|
setupCommFrequency();
|
||||||
|
|
||||||
iaxc_millisleep(500);
|
|
||||||
|
|
||||||
connectToCommFrequency();
|
connectToCommFrequency();
|
||||||
|
|
||||||
SG_LOG(SG_SOUND, SG_INFO, "FGCom: postinit 初始化完成");
|
SG_LOG(SG_SOUND, SG_INFO, "FGCom: postinit 初始化完成");
|
||||||
|
|
||||||
iaxc_millisleep(500);
|
|
||||||
|
|
||||||
iaxc_output_level_set(1.0);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user