What’s the correct way to send an audio file from a HISE plugin to a backend server?
-
I’m working on a simple workflow: a HISE plugin that sends a text prompt and optionally, an audio file to a backend. The backend uses both as input for a MusicGen model, then returns the generated audio for the plugin to download and insert into the DAW.
Everything is working, except that I haven’t been able to send an audio file from the HISE plugin to the backend. I previously attempted this using File.loadAsBase64String() function but like I discussed in a recent forum topic, it didn’t seem to return a valid base64 string and in the latest update, this function also appears to be missing from the File API.
I’ve made good progress on the rest of the plugin, but I’m still stuck on this final step. I would really appreciate any guidance or clarification on whether sending a file this way is currently supported in HISE.
-
@daniel_101 Can you pass the File directly to the backend - As in just give it the path to the file on the system?
-
This post is deleted! -
@David-Healey Okay, How do you mean? I don't see how I can do that because unless the backend server is also running on a users device, it can't access the file using its system path and my backend server is hosted on vercel
-
@daniel_101 Aha ok, when you said backend I didn't realise you meant a remote system. What about using cURL to upload the file to your server?
-
You can probably convert the audio file to Base64 and send that way. Only for small files though.
-
@David-Healey Thanks david, Using cURL sounds nice. Can I use cURL within HISE while in production?
I am currently using the Server.callWithPOST function but I can only send the file in a string format (in base64) or as a multipart/form-data format. -
@dannytaurus Thanks Danny, Yes sending it as a base64 string seemed to the best approach and I've tried using the "File.loadAsBase64()" function to do that but the function on HISE did not return a valid base64 string, As I explained in a previous post and as of the latest update, isn't part of the "File" API anymore.
I would be very grateful if there is any other way to convert a file to base64 in HISE. -
@daniel_101 Yes I think curl should work across platforms, but older versions of Windows might be missing it. I can't remember the details there.
@daniel_101 said in What’s the correct way to send an audio file from a HISE plugin to a backend server?:
"File.loadAsBase64()" function to do that but the function on HISE did not return a valid base64 string,
The function is
File.loadAsBase64String();It's still in the API. -
@David-Healey said in What’s the correct way to send an audio file from a HISE plugin to a backend server?:
The function is File.loadAsBase64String(); It's still in the API.
Yes the
File.loadAsBase64String()function used to exist on HISE but I did not seem to return a valid base64 string. And as of the HISE version I installed today, theFile.loadAsBase64String();no longer exists. Here's a screenshot picture from the HISE API interface:

-
@daniel_101 said in What’s the correct way to send an audio file from a HISE plugin to a backend server?:
HISE version I installed today
Built from the develop branch?
-
@David-Healey said in What’s the correct way to send an audio file from a HISE plugin to a backend server?:
Built from the develop branch?
To be honest, I do not know much about how the HISE github repo is structured, but I do not think its from the develop branch, because I downloaded from the
Download Installerpage on the HISE website. url: https://github.com/christophhart/HISE/releases