Trying to Embed Audio Files into Plugin Binary - file_player node causing issues?
-
Not sure if I am missing something or if there is a bug somewhere but I've been trying to build my plugin with some audio files and I'm not able to get it working.
My setup:
- ~10MB of .wav files in the AudioFiles Folder.
- Added
Engine.loadAudioFilesIntoPool();
to the onInit script. - Have Embed Audio Files into plugin binaries checked in the project settings.
- It's an FX Plugin so Enable Sound Generator FX is also enabled.
- I am using the core.file_player node for loading/playing the audio samples.
Actually as I wrote this I am realizing the issue is probably in this node. Maybe the files need to be embedded as a sample map instead...
Does anyone have any ideas?
The node works fine in the DAW, it's completely capable of loading and playing audio files with the drag and drop feature. I know I can also just package the audio samples in my installer but it would be convenient to have them embedded.
The situation is equally true on Mac and Windows.
-
@HISEnberg Okay I see my error now. I was loading the audio files from the Audio Files folder (using the File System API) and not the Pool which explains why it works in HISE but not in the compiled plugin.
So for anyone else who comes here the answer looks something like this:
const var audioFileList = Engine.loadAudioFilesIntoPool(); // get the audio files from the pool const var AudioReference = Synth.getAudioSampleProcessor("AudioReference"); const var cmb_MatchLoader = Content.getComponent("cmb_MatchLoader"); cmb_MatchLoader.set("items", ""); for (file in audioFileList) { var displayName = file.replace("{PROJECT_FOLDER}", "").replace(".wav", ""); cmb_MatchLoader.addItem(displayName); } inline function oncmb_MatchLoaderControl(component, value) { if (value > 0) { AudioReference.setFile(audioFileList[value - 1]); } } cmb_MatchLoader.setControlCallback(oncmb_MatchLoaderControl);
-
H HISEnberg has marked this topic as solved