If I want to package some wav files (e.g., some impulse responses, or a set of HRTFs) with an iPlug effect, what’s the best way? I’m assuming there is some way to put them in the resources folder, then load them, but I only see examples doing that with bitmaps and fonts. Are there functions to do it with audio data?
where filename and filetype are both const char* parameters with the file name (including path) and the file extension respectively. I don’t know if this is the best approach but at least it works for me.
As mentioned above you can use LocateResource for finding the file but there’s nothing in plug itself for loading audio.
I use IAudioFile here, which should be pretty portable and which is in a library I maintain with a liberal licenses (allowing inclusion in commercial products).
Hi Ric, I’m trying to use LocateResource to load a file but it seems that it works on Mac but when I try that in windows it just compiles and build fine but then the .exe crashes because it doesn’t find the file itself, did you have the same problem?
Yes l remember that for Windows some additional steps were required where you have to modify some files inside the solution’s file manager. l think all of that is explained somewhere in the IPlug2 FAQ or tutorials under “including external files” or something like that.
I’m actually trying to include a .nam file inside the plugin itself, it works for mac but not for windows, even if I included it in the config.h #define MYAMP_FN “myamp.nam” and also in the main.rc “MYAMP_FN NAM MYAMP_FN”. Still not working, Idk what I’m doing wrong.
Sorry to bother again, I had no luck by doing this, but I was also thinking (before going even further) that I don’t really want to edit the NAMCore because if there’s an update I should redo every edit previously did, so I might want to find a solution to use the nam file and embed it in the .exe and .vst3. But currently having trouble with this on windows. I’ve included the file in the main.rc but the code: