git-svn-id: svn://elaine/murooma/trunk@170 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-08-10 10:45:08 +00:00
parent 6f5d597a79
commit ef4a6d6942
2 changed files with 12 additions and 7 deletions

View file

@ -87,6 +87,7 @@ static int paStreamCallback( const void *inputBuffer, void *outputBuffer,
PaStreamCallbackFlags statusFlags, PaStreamCallbackFlags statusFlags,
void *userData ) void *userData )
{ {
//cout << "paStreamCallback: " << statusFlags << ", currentTime: " << timeInfo->currentTime << ", out: " << timeInfo->outputBufferDacTime << "\n";
Stream* stream = (Stream*)userData; Stream* stream = (Stream*)userData;
short* out = (short*)outputBuffer; short* out = (short*)outputBuffer;
@ -137,7 +138,7 @@ int initAudio()
outputParameters.sampleFormat = paInt16; /* 32 bit floating point output */ outputParameters.sampleFormat = paInt16; /* 32 bit floating point output */
outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency; outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
outputParameters.hostApiSpecificStreamInfo = NULL; outputParameters.hostApiSpecificStreamInfo = NULL;
std::cerr << "HighLatency: " << outputParameters.suggestedLatency << "\t LowLatency: " << Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency << "\n"; std::cerr << "HighLatency: " << outputParameters.suggestedLatency << "\t LowLatency: " << Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency << "\n";
err = Pa_OpenStream( err = Pa_OpenStream(
&paStream, &paStream,
NULL, /* no input */ NULL, /* no input */

View file

@ -163,9 +163,9 @@ void Stream::getPlayerChunk(short* outputBuffer, double outputBufferDacTime, uns
age += outputBufferDacTime*1000; age += outputBufferDacTime*1000;
// if (pCardBuffer->full()) // if (pCardBuffer->full())
age += 4*cardBuffer; // age += 4*cardBuffer;
// cout << age << "\t" << outputBufferDacTime*1000 << "\n"; cout << age << "\t" << framesPerBuffer << "\t" << msBuffer << "\t" << ticks << "\t" << cardBuffer << "\t" << outputBufferDacTime*1000 << "\n";
if (sleep == 0) if (sleep == 0)
@ -193,14 +193,18 @@ void Stream::getPlayerChunk(short* outputBuffer, double outputBufferDacTime, uns
// std::cerr << "Chunk: " << age << "\t" << outputBufferDacTime*1000 << "\n"; // std::cerr << "Chunk: " << age << "\t" << outputBufferDacTime*1000 << "\n";
updateBuffers(age); if (ticks > 2)
{
// cout << age << "\n";
updateBuffers(age);
}
time_t now = time(NULL); time_t now = time(NULL);
if (now != lastUpdate) if (now != lastUpdate)
{ {
lastUpdate = now; lastUpdate = now;
median = pBuffer->mean(); median = pBuffer->median();
shortMedian = pShortBuffer->mean(); shortMedian = pShortBuffer->median();
std::cerr << "Chunk: " << age << "\t" << pMiniBuffer->mean() << "\t" << shortMedian << "\t" << median << "\t" << pBuffer->size() << "\t" << cardBuffer << "\t" << outputBufferDacTime*1000 << "\n"; std::cerr << "Chunk: " << age << "\t" << pMiniBuffer->mean() << "\t" << shortMedian << "\t" << median << /*"\tmean: " << pBuffer->mean() <<*/ "\t" << pBuffer->size() << "\t" << cardBuffer << "\t" << outputBufferDacTime*1000 << "\n";
} }
} }