I’d like to stash a midi file and dls file in the fsb. I can’t seem to associate the midi file with the dls file. I know I can associate the two in the api by using FMOD_CREATESOUNDEXINFO, but it’s not clear how to do this in the designer.
- llm asked 11 years ago
i think at the moment fmod designer will try and convert the file into the target format you have specified, so if it was mp3 or xma for example, your midi would be decoded and stored in that format. For straight dls/midi, you would have to use code at the moment.
You could use a ‘programmer sound’ in fmod designer, then in code, you get a callback for when the event api asks you to create that sound. That is probably the best way.
In the sound definition view, right click on a sound definition, select "Add programmer sound". Whenever this sound needs to be loaded, the programmer gets an EVENT_CALLBACKTYPE_SOUNDDEF_CREATE callback and whenever it needs to be unloaded the programmer gets an EVENT_CALLBACKTYPE_SOUNDDEF_RELEASE callback. In this way, the programmer can control the loading/unloading of sounds using the low-level FMOD API (just call System::createSound) or whatever is required. This mechanism allows the programmer to choose whatever sound they like at runtime given that they control loading/unloading.
Maybe you can clear up my confusion. I have a callback function in which I’d like to load the midi & dls files using createSound. I’ve set up my programmer sound in the fsb, and in code I getGroup, then GetEvent. I can’t assign the callback using setCallback on the event until I’ve created the event. So how do I catch the EVENT_CALLBACKTYPE_SOUNDDEF_CREATE callback?
Please login first to submit.