Answered
0
0

include “FAudiolib.h”

void FAudioLib::LoadSoundData(std::string filename) {
std::string header;
long version;
long nofdefines;
long nofstreams;
long nofwaves;
long nofsoundarchives;
long nofmodules;
std::ifstream myfile(filename, std::ios::binary);
myfile.close();
}

void FAudioLib::CreateStream() {
memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.length = myfile.getBuffLen(); //length;
result = system->createSound((const char *)buff, FMOD_OPENMEMORY, &exinfo, &sound);
ERRCHECK(result);
Common_UnloadFileMemory(buff); // don’t need the original memory any more. Note! If loading as a stream, the memory must stay active so do not free it!
}

void FAudioLib::InitAudioSystem() {
Common_Init(&extradriverdata);

/*
Create a System object and initialize
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);

result = system->getVersion(&version);
ERRCHECK(result);

if (version < FMOD_VERSION)
{
    Common_Fatal("FMOD lib version %08x doesn't match header version %08x", version, FMOD_VERSION);
}

result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);

}

  • You must to post comments
Best Answer
0
0
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.