Hi, I am having trouble reading the data from a .json file that I embedded in my projucer project resources as binary data. This is what I currently have:
(jsonFile is a juce::File, and the json file is named “data.json”)
//------------------------------------------------
jsonFile(BinaryData::data_json);
auto fileText = jsonFile.loadFileAsString();
data = JSON::parse(fileText);
numChannels = data[“num_channels”];
outputChannels = data[“output_channels”];
//------------------------------------------------
…and so on to read the json fields. However, the fields aren’t being read correctly, and all come out as “0”. The .json file is about 400kb in size. Using the debugger, it looks like it’s not able to loadFileAsString(), but if I drill down into the “jsonFile” variable I can see the expected data from the file under the “Value” field in the debugger, but with backslashes added prior to the parentheses surrounding each value. When reading the same json file not included in BinaryData, and just loaded separately from the projucer project it works fine. I’m guessing I need some kind of conversion to use the binary form of the json file? The reason I want to do it this way is so I can embed the json file in the .vst.
Thank you,
-Keith