Save imported audio to AudioFiles folder?
-
Hi all, I'm wondering if anyone knows if it's possible to save an audio file that's been dragged onto the Waveform component into the AudioFiles folder, rather than keep store the absolute file path?
-
@paper_lung When you get the file that has been dragged you can use File.copy(target) to copy it to the AudioFiles Folder
https://docs.hise.audio/scripting/scripting-api/file/index.html#copy
-
@oskarsh Perfect, thanks. Do you know if this is then used as the file within the waveform component? so if a user saves a preset, the path is set to the copied file, not the original file?
-
@paper_lung No you only copy the file to the AudioFiles Folder it does not automatically overwrites the file in the AudioLoopPlayer. You could change the file in the loop player manually or on PresetLoad load the correct one from the AudioFiles Folder.