0
0

If I load a sample using the load from memory option, does fmod use the passed memory block directly, or does it make an internal copy? ie, I’m loading a sound that is from a memory mapped file, that I’m passing as a pointer to a memory block to fmod. I cant unload the file because it has other stuff i need, and I cant tell windows to page the memory out. if fmod makes an internal copy then in
this case it would waste a lot of memory.

  • You must to post comments
0
0

I believe it does copy the memory. The following code, where I free the source after creating a sample is working fine for me. So either it makes an internal copy, or I’m just getting really lucky with my memory manager.

[code:9hwxz3n9]p->sample = FSOUND_Sample_Load(FSOUND_FREE, (const char*)p->rawData, FSOUND_LOADMEMORY | flags, p->size);
if (p->sample)
{
free(p->rawData); // don’t want 2 copies of the waveData
p->rawData = NULL;
}
[/code:9hwxz3n9]

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.