File.loadAsBase64String() seem not to return valid a base64 string?
-
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?