So I have some sound data already in memory and what im wanting to do is to give the sound over to fmod.
Currently when ‘loading’ the sound I’m giving the flags, FMOD_CREATESTREAM, FMOD_2D, FMOD_SOFTWARE, FMOD_OPENMEMORY_POINT, FMOD_NONBLOCKING.
However, I still get a hitch when the initial load to fmod is done, and when i call sound->release ..
This shouldnt be happening if the data is already loaded in my own way, huh?
- adanklefsen asked 10 years ago
I’ve had the same experience but instead of being code or memory based it was audio driver based. For instance I had your same issue when running audio through an older Digigram audio device and some Sound Blaster devices. But out of my onboard Intel audio device and my other Lexicon gear everything is extremely responsive. I could explain my Digigram lag based upon the driver due to the way their driver is created using additional WAV drivers to play out through DirectX.
Maybe testing another audio device would answer your question.
- cxvjeff answered 10 years ago
you seem to be using conflicting flags. Do you want it to be a ‘compressed sample’ or a ‘stream’? Why specify both?
If you play the sound then call release while it is still playing, it will stall waiting for the engine to stop using it in the other thread. You have to make sure it has stopped and if it is a stream use getopenstate to make sure it is not still streaming before calling release.
I must still be doing something wrong since i’m getting a hickup. I tried playing around with the flags only to get the same case. It seems like there is something internal going on that I dont want to happen.
For example, I have a wav file already loaded into memory, I want to just hand the memory pointer over to fmod and let it play. What im doing is saying this:
unsigned int flags = 0;
flags |= FMOD_2D;
flags |= FMOD_SOFTWARE;
flags |= FMOD_OPENMEMORY_POINT;
flags |= FMOD_NONBLOCKING;
and I’ve tried each of these seperately
flags |= FMOD_CREATESAMPLE;
flags |= FMOD_CREATESTREAM;
memset(&sCreateSoundInfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
sCreateSoundInfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
sCreateSoundInfo.length = GetMemLength();
system->createSound((const char*)GetMemData(), flags, &sCreateSoundInfo, &m_pSound)
Some of that is shorthanded, but should give an idea of what im trying to do.
This seem right / wrong?
Please login first to submit.