Tweak Toggle Voice Synthesis for FDMA Sources;

This commit is contained in:
lwvmobile 2023-07-28 20:53:56 -04:00
parent 23f6c75257
commit 3bb9994589
5 changed files with 32 additions and 8 deletions

View File

@ -180,8 +180,8 @@ p - stop per call decoded wav files (Lower p)
t - toggle trunking (needs either rtl input, or rigctl connection)
y - toggle scanner (needs either rtl input, or rigctl connection)
0 - Toggle Audio Smoothing - May produce crackling if enabled on RTL/TCP or wav/bin files
1 - Toggle Voice Synthesis in TDMA Slot 1 (DMR and P25)
2 - Toggle Voice Synthesis in TDMA Slot 2 (DMR and P25)
1 - Toggle Voice Synthesis in TDMA Slot 1 or FDMA Conventional Voice
2 - Toggle Voice Synthesis in TDMA Slot 2
w - Toggle Trunking/Playback White List (Allow A Groups Only) / Black List (Block B or DE groups only) Mode
g - Toggle Trunking Tuning to Group Calls (DMR T3, Con+, Cap+, P25, NXDN)
u - Toggle Trunking Tuning to Private Calls (DMR T3, Cap+, P25)

View File

@ -456,6 +456,19 @@ playSynthesizedVoice (dsd_opts * opts, dsd_state * state)
ssize_t result;
UNUSED(result);
//don't synthesize voice if slot is turned off
if (opts->slot1_on == 0)
{
//clear any previously buffered audio
state->audio_out_float_buf_p = state->audio_out_float_buf + 100;
state->audio_out_buf_p = state->audio_out_buf + 100;
memset (state->audio_out_float_buf, 0, 100 * sizeof (float));
memset (state->audio_out_buf, 0, 100 * sizeof (short));
state->audio_out_idx2 = 0;
state->audio_out_idx = 0;
goto end_psv;
}
if (state->audio_out_idx > opts->delay)
{
if (opts->audio_out_type == 5) //OSS
@ -474,6 +487,8 @@ playSynthesizedVoice (dsd_opts * opts, dsd_state * state)
}
end_psv:
if (state->audio_out_idx2 >= 800000)
{
state->audio_out_float_buf_p = state->audio_out_float_buf + 100;

View File

@ -409,6 +409,8 @@ void playSynthesizedVoiceFS (dsd_opts * opts, dsd_state * state)
//TODO: add option to bypass enc with a toggle as well
if (opts->slot1_on == 0) encL = 1;
//run autogain on the f_ buffers
agf (opts, state, state->f_l,0);
@ -477,12 +479,16 @@ void playSynthesizedVoiceFM (dsd_opts * opts, dsd_state * state)
agf(opts, state, state->f_l,0);
if (opts->slot1_on == 0) goto vfm_end;
if (opts->audio_out_type == 0)
pa_simple_write(opts->pulse_digi_dev_out, state->f_l, 160*4, NULL);
if (opts->audio_out_type == 1 || opts->audio_out_type == 5)
write(opts->audio_out_fd, state->f_l, 160*4);
vfm_end:
if (state->audio_out_idx2 >= 800000)
{
state->audio_out_float_buf_p = state->audio_out_float_buf + 100;
@ -512,6 +518,8 @@ void playSynthesizedVoiceSS (dsd_opts * opts, dsd_state * state)
//TODO: add option to bypass enc with a toggle as well
if (opts->slot1_on == 0) encL = 1;
//interleave left and right channels from the short storage area
for (i = 0; i < 160; i++)
{

View File

@ -97,6 +97,8 @@ unsigned long long int p2vars = 0;
char * pEnd; //bugfix
int slotson = 3;
void
noCarrier (dsd_opts * opts, dsd_state * state)
{
@ -1525,9 +1527,9 @@ main (int argc, char **argv)
}
#ifdef AERO_BUILD
fprintf (stderr, "Build Version: v2.1c (20230720)\n");
fprintf (stderr, "Build Version: AW (WIP) \n");
#else
fprintf (stderr, "Build Version: %s \n", GIT_TAG);
fprintf (stderr, "Build Version: AW (WIP) %s \n", GIT_TAG);
#endif
fprintf (stderr,"MBElib Version: %s\n", versionstr);
@ -1635,7 +1637,6 @@ main (int argc, char **argv)
// break;
case 'V':
int slotson = 3;
sscanf (optarg, "%d", &slotson);
if (slotson > 3) slotson = 3;
opts.slot1_on = (slotson & 1) >> 0;

View File

@ -2251,12 +2251,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
if (i == 4) printw (" MBElib %s", versionstr);
#ifdef AERO_BUILD
if (i == 5) printw (" %s ", "Aero Build");
if (i == 6) printw (" v2.1c (20230720) \n");
if (i == 6) printw (" AW (WIP) \n");
#elif ZDEV_BUILD
if (i == 5) printw (" %s ", "Audio WIP ");
if (i == 5) printw (" %s ", "AW (WIP)");
if (i == 6) printw (" %s \n", GIT_TAG);
#else
if (i == 5) printw (" %s ", "Audio WIP");
if (i == 5) printw (" %s ", "AW (WIP)");
if (i == 6) printw (" %s \n", GIT_TAG);
#endif
else printw ("\n");