Passing data via the ‘userdata’ member of ‘createsoundexinfo’ should work, are you saying the codec isn’t receiving the exinfo structure at all? or that userdata isn’t coming through? Can you double check you are passing the struct correct in createSound?
I’m not familiar with your codec or your particular crashes but I’m guessing the format is very similar to MP3 if it’s fooling FMOD into thinking it has a valid MP3 file. If you send us the file causing the crash I may be able to fix it.
well, this would be great. How can I access the Sound inside a codec?
The Open function looks like:
FMOD_RESULT F_CALLBACK open(FMOD_CODEC_STATE *codec, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);
There is no FMOD::SOUND or FMOD_SOUND structure.
Actually that’s my bad, no you can’t access the sound in the codec, you would need to pass the name in via createsoundexinfo.
Codecs should use the generic file interface, the codec really shouldn’t know about filenames since that implies the data is coming from the disk, where it could be a net stream or in memory data for instance. Why do you need the filename?
Well, as I said I tried the createsoundexinfo-version in the second place. This doesn’t work for some reason. craeteSound probably ignores this structure for normale file loads.
Sure I use the "generic file interface". I just want to test the file name for validity.
Background info: I had a codec running at priority 9999. So my own codec is the very last in order. Ok, this worked until I found a file that is actually meant for my codec BUT it was loaded by fmods internal MP3 codec and crashed (Yes, the application crashes in FMOD) it. So, I had to go ahead and I changed the behaiour. First I changed the priority to 0. Now, my own codec is the very first one. Now I have exactly the same problem (vice versa) my Codec crashes on some MP3 files. I know I could check the file extension. This is the most exact check I can imagine. Therefore I really like to check the file name extension to prevent crashes.
Please login first to submit.