]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
audio interface
authorc vw <dl1ycf@darc.de>
Fri, 22 Nov 2019 08:26:17 +0000 (09:26 +0100)
committerc vw <dl1ycf@darc.de>
Fri, 22 Nov 2019 08:26:17 +0000 (09:26 +0100)
transmitter.c

index a2b3340b69008ba6e874fa1e288ec80b7f15a2b2..bf41168eb5e4fba831dd703e9f3b27b6bfdfd367 100644 (file)
@@ -52,6 +52,7 @@
 #include "freedv.h"
 #endif
 #include "audio_waterfall.h"
+#include "audio.h"
 #include "ext.h"
 
 double getNextSideToneSample();
@@ -96,8 +97,6 @@ static int cw_shape = 0;
 extern double cwramp48[];              // see cwramp.c, for 48 kHz sample rate
 extern double cwramp192[];             // see cwramp.c, for 192 kHz sample rate
 
-extern void cw_audio_write(double sample);
-
 static void init_analyzer(TRANSMITTER *tx);
 
 static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) {
@@ -1070,7 +1069,7 @@ static void full_tx_buffer(TRANSMITTER *tx) {
 
 void add_mic_sample(TRANSMITTER *tx,short mic_sample) {
   int mode=tx->mode;
-  double sample;
+  float cwsample;
   double mic_sample_double, ramp;
   int i,s;
   int updown;
@@ -1122,8 +1121,8 @@ void add_mic_sample(TRANSMITTER *tx,short mic_sample) {
        // store the ramp value in cw_shape_buffer, but also use it for shaping the "local"
        // side tone
        ramp=cwramp48[cw_shape];
-       sample=0.0078 * getNextSideToneSample() * cw_keyer_sidetone_volume * ramp;
-       cw_audio_write(sample);
+       cwsample=0.0078 * getNextSideToneSample() * cw_keyer_sidetone_volume * ramp;
+       cw_audio_write(cwsample);
         cw_shape_buffer48[tx->samples]=ramp;
        //
        // In the new protocol, we MUST maintain a constant flow of audio samples to the radio
@@ -1138,7 +1137,7 @@ void add_mic_sample(TRANSMITTER *tx,short mic_sample) {
        //
         if (protocol == NEW_PROTOCOL) {
            s=0;
-           if (!cw_keyer_internal || CAT_cw_is_active) s=(int) (sample * 32767.0);
+           if (!cw_keyer_internal || CAT_cw_is_active) s=(int) (cwsample * 32767.0);
            new_protocol_cw_audio_samples(s, s);
            s=4*cw_shape;
            i=4*tx->samples;