mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-04 16:31:17 -05:00
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:
parent
861c4dc71b
commit
03750fab97
4
a2d.f90
4
a2d.f90
@ -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'
|
||||||
|
@ -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
|
||||||
|
@ -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++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user