I have a binary file containing data recorded using a c program. the data stored in files are float values. Now I need to retrieve the float numbers from binary file in after effects script. This is my code:
var myFile = File.openDialog('select file');
myFile.open("r");
myFile.encoding = "binary";
for(x=0;x<myFile.length;x += 4){
myFile.seek(x,0);
buffer = myFile.read(4);
???
}
the question is how to convert the buffer to a float number. Many Thanks in advance.
the input file is somthing like this :
7.26,-3.32,-5.18 7.66,3.65,-5.37 8.11,-4.17,5.11 8.40,-5.17,4.80
whitout any sepration character (,)
Each floating-point number uses 4 byte.