I'm trying to use the FMOD audio API in my game but the app starts and then closes. I tried to debug it and the program crashes at the FMOD_System_Init function.
void AudioSystem::Init() {
FMOD_System_Create(&sys); // FMOD_SYSTEM* sys;
FMOD_System_Init(sys, 32, FMOD_INIT_NORMAL, 0); // Crash
}
Called here:
int Game::MainLoop(int fpscap) {
// ...
// Expose classes to the scripting engine
// FPS calculations
m_audiosys->Init(); // AudioSystem* m_audiosys;
// Initialize Input, Window, Main Game, etc...
// Game Loop...
// ...
}
This is the fmod.log file:
FMOD: SystemI::init : FMOD Ex Version: 00044458
FMOD: SystemI::init : maxchannels = 16, flags = 00000000, extradriverdata = 00000000
FMOD: SystemI::close :
FMOD: SystemI::close : Stop all sounds
FMOD: SystemI::close : Remove miscllaneous DSP stuff.
FMOD: SystemI::close : done.
FMOD: OutputWASAPI::enumerate : Enumerating...
FMOD: OutputWASAPI::enumerate : Initialise COM library.
FMOD: OutputWASAPI::enumerate : Found Driver: "SONY TV (Áudio do vídeo Intel(R))".
FMOD: OutputWASAPI::enumerate : Found Driver: "Alto-falantes (Dispositivo de High Definition Audio)".
FMOD: OutputWASAPI::enumerate : Found Driver: "Alto-falantes (XSplit Stream Audio Renderer)".
FMOD: OutputWASAPI::enumerate : Found Driver: "Microfone (Dispositivo de High Definition Audio)".
FMOD: OutputWASAPI::enumerate : Done.
FMOD: OutputWASAPI::initEx : Initialising...
FMOD: OutputWASAPI::initEx : Done.
FMOD: SystemI::init : Set up software engine
FMOD: Thread::initThread : Initializing FMOD (WASAPI) feeder thread. priority 0
FMOD: Thread::initThread : - Stacksize 0. Stack pointer 00000000 : usesemaphore = 0 : sleeptime = 0
FMOD: Thread::callback : * FMOD (WASAPI) feeder thread started
FMOD: Thread::initThread : done.
FMOD: OutputWASAPI::feederUpdate : WASAPI feeder thread set to 'Audio' characteristic
FMOD: Thread::initThread : Initializing FMOD mixer thread. priority 2
FMOD: Thread::initThread : - Stacksize 49152. Stack pointer 00000000 : usesemaphore = 1 : sleeptime = 0
It works if I run step-by-step. It goes on a bunch of machine code and if I keep jumping the program starts and everything works just fine.
I'm not trying to play any sound yet, just FMOD initialization for now.
Thanks in advance.