]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
If the keyer side tone volume is zero, do not use cw_audio_write.
authorDL1YCF <dl1ycf@darc.de>
Thu, 4 Aug 2022 16:08:35 +0000 (18:08 +0200)
committerDL1YCF <dl1ycf@darc.de>
Thu, 4 Aug 2022 16:08:35 +0000 (18:08 +0200)
audio.c
portaudio.c
pulseaudio.c
transmitter.c

diff --git a/audio.c b/audio.c
index 4bb6eb05601b2021aef8c1b931b0899d23ea9283..6e2436583c0d4243e3c76dd5428c47060d51a673 100644 (file)
--- 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;
   }
 
index 0a78bccf1320434665d45789a54ab5d6aaff27a3..c4156e45c1bbffd476b8e0d07911cc88f6d463db 100644 (file)
@@ -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
     //
index ccd6b57bcd9bc5ef0e6ef849cb71d5fd450fa8d9..37262333fc0e9f8c45c797d98dc915fd91bb38b3 100644 (file)
@@ -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;
   }
 
index b1f09d6a1fe6dab4c7fed976ee13f329c6756f5b..84ac13eeebc46d5675cfbcf1a3347df42716a7f4 100644 (file)
@@ -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