0
0

Hi im experiencing sound stutering in my app.
My code is a poor adptation of the sample for recording. The sample doesnt produce this stutter..
I wonder if you can help me

FMOD::System          *system  = 0;
FMOD::Sound           *sound   = 0;

FMOD_RESULT            result;
FMOD_CREATESOUNDEXINFO exinfo;
int                    key, driver, numdrivers, count;
unsigned int           version;    
wxString msbox;

result = FMOD::System_Create(&system);
// ERRCHECK(result);

result = system->getVersion(&version);

// ERRCHECK(result);

 if (version < FMOD_VERSION)
{ 
    msbox.Printf(_T("Error!  You are using an old version of FMOD %08x.  This program requires %08x\n"), version, FMOD_VERSION);
    wxMessageBox(msbox, _T("Erro"), wxOK|wxICON_INFORMATION,this);
    return;
}


result = system->setDriver(-1);

result = system->getRecordNumDrivers(&numdrivers);
result = system->setRecordDriver(1);
result = system->init(32, FMOD_INIT_NORMAL, 0);

memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));

exinfo.cbsize           = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.numchannels      = 1;
exinfo.format           = FMOD_SOUND_FORMAT_PCM16;
exinfo.defaultfrequency = 44100;
exinfo.length           = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels *5;
sound->setMode(FMOD_LOOP_NORMAL);
result = system->createSound(0, FMOD_2D | FMOD_OPENUSER, &exinfo, &sound);


 while(event.IsChecked()==true){ //this is a checkbox event..
 static FMOD::Channel         *channel = 0;
/*
    Create a System object and initialize.
*/

 system->recordStart(sound,TRUE);
 Sleep(200);

 system->playSound(FMOD_CHANNEL_REUSE, sound, 0, &channel);
system->update();

// Sleep(10);

}
 result = sound->release();


result = system->release();
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.