From 4da4c678989d90241b28b8e9d43af127f20eb051 Mon Sep 17 00:00:00 2001 From: DL1YCF Date: Thu, 4 Aug 2022 18:08:35 +0200 Subject: [PATCH] If the keyer side tone volume is zero, do not use cw_audio_write. --- audio.c | 2 +- portaudio.c | 2 +- pulseaudio.c | 2 +- transmitter.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/audio.c b/audio.c index 4bb6eb0..6e24365 100644 --- a/audio.c +++ b/audio.c @@ -456,7 +456,7 @@ int audio_write(RECEIVER *rx,float left_sample,float right_sample) { // to listen to this rx while transmitting. // - if (rx == active_receiver && isTransmitting() && (txmode==modeCWU || txmode==modeCWL)) { + if (rx == active_receiver && isTransmitting() && (txmode==modeCWU || txmode==modeCWL) && cw_keyer_sidetone_volume > 0) { return 0; } diff --git a/portaudio.c b/portaudio.c index 0a78bcc..c4156e4 100644 --- a/portaudio.c +++ b/portaudio.c @@ -513,7 +513,7 @@ int audio_write (RECEIVER *rx, float left, float right) if (can_transmit) { mode=transmitter->mode; } - if (rx == active_receiver && isTransmitting() && (mode==modeCWU || mode==modeCWL)) { + if (rx == active_receiver && isTransmitting() && (mode==modeCWU || mode==modeCWL) && cw_keyer_sidetone_volume > 0) { // // If a CW side tone may occur, quickly return // diff --git a/pulseaudio.c b/pulseaudio.c index ccd6b57..3726233 100644 --- a/pulseaudio.c +++ b/pulseaudio.c @@ -377,7 +377,7 @@ int audio_write(RECEIVER *rx,float left_sample,float right_sample) { int err; int txmode=get_tx_mode(); - if (rx == active_receiver && isTransmitting() && (txmode==modeCWU || txmode==modeCWL)) { + if (rx == active_receiver && isTransmitting() && (txmode==modeCWU || txmode==modeCWL) && cw_keyer_sidetone_volume > 0) { return 0; } diff --git a/transmitter.c b/transmitter.c index b1f09d6..84ac13e 100644 --- a/transmitter.c +++ b/transmitter.c @@ -1404,7 +1404,7 @@ void add_mic_sample(TRANSMITTER *tx,float mic_sample) { // side tone ramp=cwramp48[cw_shape]; cwsample=0.00197 * getNextSideToneSample() * cw_keyer_sidetone_volume * ramp; - if(active_receiver->local_audio) cw_audio_write(active_receiver,cwsample); + if(active_receiver->local_audio && cw_keyer_sidetone_volume > 0) cw_audio_write(active_receiver,cwsample); cw_shape_buffer48[tx->samples]=ramp; // // In the new protocol, we MUST maintain a constant flow of audio samples to the radio -- 2.45.2