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
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'

View File

@ -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

View File

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

View File

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