using namespace std; #include #include #include "portaudiotest.h" #define PA_FRAMESPERBUF 512 #define __uint32 unsigned long int HD24UserInterface::portaudio_process( const void *inputBuffer, void *outputBuffer, __uint32 nframes, const PaStreamCallbackTimeInfo* timeinfo, PaStreamCallbackFlags, void *userData) { HD24UserInterface* mythis=(HD24UserInterface*)userData; if (!mythis->havestreamtime) { mythis->streamtime=0; mythis->timeoffset=timeinfo->currentTime; mythis->havestreamtime=true; } mythis->streamtime+=nframes; cout << ((mythis->streamtime)/48000) << " nframes=" << nframes <<" streamtime=" << timeinfo->currentTime-(mythis->timeoffset) << endl; float sval=1; for (int i=0;idevice=indevice; inputParameters->channelCount=1; inputParameters->sampleFormat=paFloat32; inputParameters->suggestedLatency = Pa_GetDeviceInfo( inputParameters->device )->defaultLowInputLatency; inputParameters->hostApiSpecificStreamInfo = NULL; cout << "Input params set" << endl; cout << "Device=" << inputParameters->device << endl; cout << "Channelcount=" << inputParameters->channelCount << endl; cout << "sampleFormat=" << inputParameters->sampleFormat << endl; cout << "suggestedlatency=" << inputParameters->suggestedLatency << endl; cout << "================================="<device=outdevice; outputParameters->channelCount=1; outputParameters->sampleFormat=paFloat32; outputParameters->suggestedLatency = Pa_GetDeviceInfo( outputParameters->device )->defaultLowOutputLatency; outputParameters->hostApiSpecificStreamInfo = NULL; cout << "Output params set" << endl; cout << "Device=" << outputParameters->device << endl; cout << "Channelcount=" << outputParameters->channelCount << endl; cout << "sampleFormat=" << outputParameters->sampleFormat << endl; cout << "suggestedlatency=" << outputParameters->suggestedLatency << endl; cout << "================================="<portaudioinit(); ui->portaudio_transport_start(); int blah; cin >> blah; }