From 03750fab973df82233bd3a706e41af3ffa48f124 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 10 Jan 2006 20:32:53 +0000 Subject: [PATCH] Tweaked fivehztx.f90 to give correct fsample with the alsa callback. Removed the divide-by-2 of input samples in portaudio callback. Re-activated #ifdef USE_PORTAUDIO in a2d.f90. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@80 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- a2d.f90 | 4 ++-- fivehz.f90 | 6 +++--- jtaudio.c | 4 ++-- wsjt.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/a2d.f90 b/a2d.f90 index 71809c42e..7dc05af9f 100644 --- a/a2d.f90 +++ b/a2d.f90 @@ -1,8 +1,8 @@ !---------------------------------------------------- a2d subroutine a2d(iarg) -#if 1 -!--- # ifdef USE_PORTAUDIO +!#if 1 +# ifdef USE_PORTAUDIO ! Start the PortAudio streams for audio input and output. integer nchin(0:20),nchout(0:20) include 'gcom1.f90' diff --git a/fivehz.f90 b/fivehz.f90 index 02443cb4e..9de6a2dd0 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -190,7 +190,6 @@ subroutine fivehztx if(first) then first=.false. ncall=-1 - tt0=tt fsample=11025.d0 nsec0=-999 u=0.05d0 @@ -198,8 +197,9 @@ subroutine fivehztx endif ncall=ncall+1 - if(ncall.gt.0) then - fs=ncall*2048.d0/(tt-tt0) + if(ncall.eq.8) tt0=tt + if(ncall.gt.8) then + fs=(ncall-8)*2048.d0/(tt-tt0) fsample=u*fs + (1.d0-u)*fsample mfsample2=nint(10.d0*fsample) endif diff --git a/jtaudio.c b/jtaudio.c index fbd4dbeb6..c1a78b9ac 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -113,8 +113,8 @@ static int SoundIn( void *inputBuffer, void *outputBuffer, *data->ibuf=ib; data->tbuf[ib-1]=stime; for(i=0; iy1[ia] = (*in++)>>1; //NB: divide by 2! - data->y2[ia] = (*in++)>>1; + data->y1[ia] = (*in++); + data->y2[ia] = (*in++); ia++; } } diff --git a/wsjt.py b/wsjt.py index 2eec00775..f1d4c2c6d 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#----------------------------------------------------------- WSJT +#------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw