Change output sample rate to 48 kHz.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2700 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-10-29 13:42:09 +00:00
parent 4895feb95f
commit 4829eeb76e
3 changed files with 12 additions and 10 deletions

View File

@ -1,4 +1,4 @@
//---------------------------------------------------------------- MainWindow
//--------------------------------------------------------------- MainWindow
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "devsetup.h"

View File

@ -564,10 +564,10 @@ p, li { white-space: pre-wrap; }
<string>Tx +</string>
</property>
<property name="minimum">
<number>1000</number>
<number>500</number>
</property>
<property name="maximum">
<number>2000</number>
<number>20000</number>
</property>
<property name="value">
<number>1500</number>

View File

@ -1,6 +1,6 @@
#include "soundout.h"
#define FRAMES_PER_BUFFER 256
#define FRAMES_PER_BUFFER 1024
extern "C" {
#include <portaudio.h>
@ -39,23 +39,25 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer,
static double snr;
static double fac;
static int ic=0;
static int ncall=0;
static int isym0=-99;
static short int i2;
int isym;
ncall++;
if(udata->bRestart) {
// Time according to this computer
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
int mstr = ms % (1000*udata->ntrperiod );
if(mstr<1000) return 0;
ic=(mstr-1000)*12;
ic=(mstr-1000)*48;
udata->bRestart=false;
}
isym=ic/udata->nsps;
if(isym>=85) return 0;
isym=ic/(4*udata->nsps); //Actual fsample=48000
if(isym>=85) return 1;
baud=12000.0/udata->nsps;
freq=udata->ntxfreq + itone[isym]*baud;
dphi=twopi*freq/12000.0;
dphi=twopi*freq/48000.0;
if(udata->txsnrdb < 0.0) {
snr=pow(10.0,0.05*(udata->txsnrdb-1.0));
fac=3000.0;
@ -98,7 +100,7 @@ void SoundOutThread::run()
outParam.suggestedLatency=0.05;
outParam.hostApiSpecificStreamInfo=NULL;
paerr=Pa_IsFormatSupported(NULL,&outParam,12000.0);
paerr=Pa_IsFormatSupported(NULL,&outParam,48000.0);
if(paerr<0) {
qDebug() << "PortAudio says requested output format not supported.";
qDebug() << paerr << m_nDevOut;
@ -116,7 +118,7 @@ void SoundOutThread::run()
paerr=Pa_OpenStream(&outStream, //Output stream
NULL, //No input parameters
&outParam, //Output parameters
12000.0, //Sample rate
48000.0, //Sample rate
FRAMES_PER_BUFFER, //Frames per buffer
paClipOff, //No clipping
d2aCallback, //output callbeck routine