34 mThisSec = mTimeVals = mTimeSum = 0;
44 const char * sPath =
mPath.c_str();
46 char * dot = (
char *) strrchr(sPath,
'.');
48 if (strcmp(dot,
".wav") == 0)
50 else if (strcmp(dot,
".snd") == 0)
53 mFile->openForWrite(format, channels, rate);
54 if ( !
mFile->isValid()) {
59 mDuration = (int)((
float)blockSize / (float)rate * 1000000.0f);
65 mIsThreadRunning =
false;
68 logMsg(
"Starting sound file output loop");
69 while (mNumFramesPlayed < numFrames)
72 logMsg(
"Starting sound file output thread");
73 mThread->createThread(threadFunction,
this);
112 struct timeval *meThen = &me->mThen;
113 struct timeval *meNow = & me->mNow;
122 me->printTimeStatistics(meNow, meThen, & me->mThisSec, & me->mTimeSum, & me->mTimeVals);
124 sleepTime = me->
mDuration - (((meNow->tv_sec - meThen->tv_sec) * 1000000) + (meNow->tv_usec - meThen->tv_usec));
134 logMsg(
"Stopping sound file output thread");