Custom folder with audio samples



  • My idea is creating simply plugin where user can load samples from defined folder by combobox.
    I created custom folder (MySamples) in project folder where i store all audio samples which will be loaded into Loop Player.
    But after export i can't load samples from this folder.

    That's how plugin folder structure looks

    --PLUGIN FOLDER
    |--Expansion
    |--MySamples
    |--User Presets
    |--GeneralSettings.xml

    Here's code

    Content.makeFrontInterface(500, 500);
    Engine.loadAudioFilesIntoPool();
    
    const var ComboBox1 = Content.getComponent("ComboBox1");
    const var ScriptLabel1 = Content.getComponent("ScriptLabel1");
    
    
    
    
    var arr = [];
    const var folder = Engine.getSampleFilesFromDirectory("../MySamples", true);
    
    
    function getSamples(){
        for(i = 0; i < folder.length; i++) {
            arr.push(folder[i]);
        }
        ComboBox1.set("items", arr.join("\n"));
    }
    
    getSamples();
    
    ScriptLabel1.set("text", "Detected samples: " + arr.length);
    

    In HISE everything works fine, problem occurs in exported plugin.
    Is it possible to create it at all? Or did I go a little too far with my idea?



  • BumpBumpBump 🙂



  • @arminh said in Custom folder with audio samples:

    getSampleFilesFromDirectory

    I wonder if the exported plugin is looking in a different location than within HISE?



  • Unfortunately no. I tried also put samples like this and still not detecting any samples

    |--My Company
    |
    | --PLUGIN FOLDER
    | |--Expansion
    | |--User Presets
    | |--GeneralSettings.xml
    |--MySamples



  • @Christoph-Hart is it possible to create?


Log in to reply
 

19
Online

884
Users

3.2k
Topics

26.8k
Posts