After doing all these steps that to me look correct, the sound playes for like 3 updates and then just stops…
I debugged it and the channel and the sound seem to be right, fmod system gets updated correctly after I update all the 3d parameters and I also tried to set the 3d mode on the sound instead of the channel and also on both.
I’m not playing any other sound and even though I’m creating a 2D one.
Has anyone got any idea? Am I missing something here? (see code extracted from wrapping classes)
Created fmod system
Created fmod sound
Playing the sound, so that I can retrieve the channel
setting the volume
setting 3D parameters
updating them each loop
auto result = FMOD::System_Create(&m_fmodSystem);
// Initialise the system
result = m_fmodSystem->init(32, FMOD_INIT_NORMAL, nullptr);
// creating sound with some parameters
AudioManager::GetSystem()->createSound(filePath.c_str(), FMOD_DEFAULT | (FMOD_LOOP_OFF + loop), nullptr, &m_sound);
// setting the volume
AudioManager::GetSystem()->playSound(m_sound, nullptr, false, &m_channel);
// setting the mode to 3d
// setting distance rolloff and initial potition and velocity
// then each application update I update sound source values and system.
I noticed that the sound stops as soon as the window pops up, but I believe it’s just a coincidence or bad timing.