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
This commit is contained in:
Joe Taylor 2006-01-10 20:32:53 +00:00
parent 861c4dc71b
commit 03750fab97
4 changed files with 8 additions and 8 deletions

View File

@ -1,8 +1,8 @@
!---------------------------------------------------- a2d !---------------------------------------------------- a2d
subroutine a2d(iarg) subroutine a2d(iarg)
#if 1 !#if 1
!--- # ifdef USE_PORTAUDIO # ifdef USE_PORTAUDIO
! Start the PortAudio streams for audio input and output. ! Start the PortAudio streams for audio input and output.
integer nchin(0:20),nchout(0:20) integer nchin(0:20),nchout(0:20)
include 'gcom1.f90' include 'gcom1.f90'

View File

@ -190,7 +190,6 @@ subroutine fivehztx
if(first) then if(first) then
first=.false. first=.false.
ncall=-1 ncall=-1
tt0=tt
fsample=11025.d0 fsample=11025.d0
nsec0=-999 nsec0=-999
u=0.05d0 u=0.05d0
@ -198,8 +197,9 @@ subroutine fivehztx
endif endif
ncall=ncall+1 ncall=ncall+1
if(ncall.gt.0) then if(ncall.eq.8) tt0=tt
fs=ncall*2048.d0/(tt-tt0) if(ncall.gt.8) then
fs=(ncall-8)*2048.d0/(tt-tt0)
fsample=u*fs + (1.d0-u)*fsample fsample=u*fs + (1.d0-u)*fsample
mfsample2=nint(10.d0*fsample) mfsample2=nint(10.d0*fsample)
endif endif

View File

@ -113,8 +113,8 @@ static int SoundIn( void *inputBuffer, void *outputBuffer,
*data->ibuf=ib; *data->ibuf=ib;
data->tbuf[ib-1]=stime; data->tbuf[ib-1]=stime;
for(i=0; i<framesPerBuffer; i++) { for(i=0; i<framesPerBuffer; i++) {
data->y1[ia] = (*in++)>>1; //NB: divide by 2! data->y1[ia] = (*in++);
data->y2[ia] = (*in++)>>1; data->y2[ia] = (*in++);
ia++; ia++;
} }
} }

View File

@ -1,4 +1,4 @@
#----------------------------------------------------------- WSJT #------------------------------------------------------------ WSJT
from Tkinter import * from Tkinter import *
from tkFileDialog import * from tkFileDialog import *
import Pmw import Pmw