mirror of https://github.com/wb2osz/direwolf.git
reduce phase shiift between subsequent tone buffers
This commit is contained in:
parent
7463853757
commit
7685502c9b
|
@ -106,7 +106,7 @@ static void * ptt_thread (void *arg)
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
short* pnData;
|
short* pnData;
|
||||||
short sample;
|
short sample;
|
||||||
int nSamples = save_audio_config_p->adev[a].samples_per_sec / 5;
|
int nSamples = (int)( ( (double)save_audio_config_p->adev[a].samples_per_sec / (double)freq ) * ceil( (double)freq / 5.0 ) );
|
||||||
int nBufferLength = save_audio_config_p->adev[a].num_channels * nSamples * sizeof(short);
|
int nBufferLength = save_audio_config_p->adev[a].num_channels * nSamples * sizeof(short);
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
@ -198,7 +198,7 @@ static void * ptt_thread (void *arg)
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
nSamples = samples_per_sec / 5;
|
nSamples = (int)( ( (double)samples_per_sec / (double)freq ) * ceil( (double)freq / 5.0 ) );
|
||||||
nBufferLength = num_channels * nSamples * sizeof(short);
|
nBufferLength = num_channels * nSamples * sizeof(short);
|
||||||
pnData = (short*)malloc (nBufferLength);
|
pnData = (short*)malloc (nBufferLength);
|
||||||
|
|
||||||
|
|
2
config.c
2
config.c
|
@ -1591,7 +1591,7 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
||||||
dw_printf ("Config file line %d: %s with RIG is only available when hamlib support is enabled.\n", line, otname);
|
dw_printf ("Config file line %d: %s with RIG is only available when hamlib support is enabled.\n", line, otname);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (strcasecmp( t, "CHANNEL") == 0) {
|
else if (strcasecmp(t, "CHANNEL") == 0) {
|
||||||
t = split(NULL, 0);
|
t = split(NULL, 0);
|
||||||
if (t == NULL) {
|
if (t == NULL) {
|
||||||
text_color_set( DW_COLOR_ERROR );
|
text_color_set( DW_COLOR_ERROR );
|
||||||
|
|
2
ptt.c
2
ptt.c
|
@ -1138,6 +1138,7 @@ void ptt_term (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (n = 0; n < MAX_CHANS; n++) {
|
for (n = 0; n < MAX_CHANS; n++) {
|
||||||
|
if (save_audio_config_p->achan[n].valid) {
|
||||||
if (save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_method == PTT_METHOD_AUDIO) {
|
if (save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_method == PTT_METHOD_AUDIO) {
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
SetEvent (save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_close) ;
|
SetEvent (save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_close) ;
|
||||||
|
@ -1149,6 +1150,7 @@ void ptt_term (void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_HAMLIB
|
#ifdef USE_HAMLIB
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue