質問

I'm using FMODEx 4.40.10 currently. We load OGG samples like this:

uint uiFlags(FMOD_SOFTWARE | FMOD_LOWMEM | FMOD_CREATESAMPLE);
FMOD::SOUND* pSound(NULL);
m_pFMODSystem->createSound(sPath, uiFlags, NULL, &pSound);

When looking at the memory usage of this sound via:

FMOD_MEMORY_USAGE_DETAILS usage;
pSound->getMemoryInfo(FMOD_MEMBITS_ALL, 0, NULL, &usage);

usage.codec reports greater than 0. This doesn't make sense to me, as the FMOD documentation states that FMOD_MEMORY_USAGE_DETAILS::codec is:

 codec
  [out] Codecs allocated for streaming 

As you can see from how sounds are loaded, there should be no streaming.

With multiple OGG files loaded, when I query the system's memory usage, it shows codec being a large number - all of the individual file codec usages added together. The memory numbers being reported by FMOD match the memory usage that I see from my own memory profiling.

When I load raw PCM data, usage.codec reports as 0.

Why is "codec" greater than 0 when I'm loading non-streaming OGG files? Is there a way to disable this memory usage?

Edit: As a test, after loading the OGG, I extract the PCM data and have FMOD create a new sound. I then free the sound made from the OGG and replace it with the new sound loaded from the PCM data. This works flawlessly. This is further evidence that the codec memory it has allocated is unnecessary.

役に立ちましたか?

解決

http://www.fmod.org/forum/viewtopic.php?f=7&t=15762

FMOD confirmed my findings and said the workaround of loading the compressed sound, extracting the PCM data, unloading the sound, and then creating a new one from the extracted PCM data is fine.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top