HISE Logo Forum
    • Categories
    • Register
    • Login

    Trying to Embed Audio Files into Plugin Binary - file_player node causing issues?

    Scheduled Pinned Locked Moved Solved General Questions
    2 Posts 1 Posters 14 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • HISEnbergH
      HISEnberg
      last edited by

      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:

      1. ~10MB of .wav files in the AudioFiles Folder.
      2. Added Engine.loadAudioFilesIntoPool(); to the onInit script.
      3. Have Embed Audio Files into plugin binaries checked in the project settings.
      4. It's an FX Plugin so Enable Sound Generator FX is also enabled.
      5. 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.

      HISEnbergH 1 Reply Last reply Reply Quote 0
      • HISEnbergH
        HISEnberg @HISEnberg
        last edited by

        @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);
        
        1 Reply Last reply Reply Quote 2
        • HISEnbergH HISEnberg has marked this topic as solved
        • First post
          Last post

        26

        Online

        2.0k

        Users

        12.6k

        Topics

        109.5k

        Posts