@David-Healey Thanks, David. I did take your courses earlier, they’re true life savers!
It also makes sense that the File.loadAsBase64String() function isn't available on the release version of HISE. I previously compiled HISE following your tutorial, but I ran into the issues I described in this forum post, where the string returned from File.loadAsBase64String() didn’t seem to be a valid base64 string. I’ll compile it again, and hopefully I won’t run into the same error. Thanks a lot!
Posts
-
RE: What’s the correct way to send an audio file from a HISE plugin to a backend server?posted in Scripting
-
RE: What’s the correct way to send an audio file from a HISE plugin to a backend server?posted in Scripting
@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 -
RE: What’s the correct way to send an audio file from a HISE plugin to a backend server?posted in Scripting
@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:

-
RE: What’s the correct way to send an audio file from a HISE plugin to a backend server?posted in Scripting
@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. -
RE: What’s the correct way to send an audio file from a HISE plugin to a backend server?posted in Scripting
@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. -
RE: What’s the correct way to send an audio file from a HISE plugin to a backend server?posted in Scripting
@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
-
What’s the correct way to send an audio file from a HISE plugin to a backend server?posted in Scripting
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.
-
File.loadAsBase64String() seem not to return valid a base64 string?posted in Scripting
Hi, I am newbie to HISE, and I want to implement a feature where a file (selected by a user) would be converted to a base64 string and sent as part of a JSON to a backend server using the Server.callWithPOST function.
In my python backend, I try to validate that the base64 string is valid base64 but it never passes. Given that the length of the string never changes between HISE and the backend, I think suggests that the string doesn't get corrupted when converted to JSON.
Also taking a look at the string returned from the loadAsBase64String, (In my case):var base64AudioData = f.loadAsBase64String(); Console.print(base64AudioData); // 1048558.RkjQFY9+O.vUAYUQl0Fcf.A...P..H..DwJ...QrB..A..A.jEF...<CONTINUES> Console.print(base64AudioData.length); // 1398086I noticed that it doesn't quit have the characteristics of a base64 string (I think).
- The length of the string is not a multiple of four, even though it's always a multiple of two.
- It is always prefixed with a number. in this case
1048558(The size of the file.) - Makes use of multiple periods (.) which I do not expect in a base64 string.
Is there a step I am missing before loading the file as a base64 string or is there a way to convert it into one in the backend, probably using zstd or does loadAsBase64String function not return a base64 string representation of the file?