In the product I’m working on I do not have the ability to give FMOD a file, but rather, I have all of the data that is contained in an event file becuase I loaded it myself from the disk. Basically at run time I have a resource that represents the file, but no file or filename.
Is there a way to pass the bytes that represent the event file to fmod and have it read them like they are the event file?
- werlkjh asked 12 years ago
Try setFilesystem. Encode the address of the data into a filename (hexadecimal or decimal would work) and pass that to FMod. FMod will pass that filename to your filesystem and then you can use it to access the data.
You might want to pass the address of a structure instead so that you can include length and other information for bounds checking purposes, or use numeric indexes into a table instead. But that’s a basic way to do it.
- Janus answered 12 years ago
I understand what you are saying, and in the end, this might be our only way of getting the results that we want.
I would much rather pass an address in ram where the bytes that represent the event file are and have fmod read that. Hopefully the read functions dont rely entirely on the file system to read files from disk and a new function can be created easily.
The idea of an "EVENT_LOADFROMMEMORY" flag has been raised before and we’ll probably implement this soon. Incidentally, are all your .fsbs in memory as well? If so, then System::setFileSystem would be the only way to get FMOD to be able to access them.
I dont currently have all of the .fsbs in memory, but I intend to have them loaded seperately than through fmods load from file type functions. Will an "EVENT_LOADFROMMEMORY" flag be available for all file types that fmod loads or will this only be for the EventFiles?
Please login first to submit.